dyninst.git
6 years agoAddress some issues found by coverity (1/3)
William Cohen [Thu, 21 Mar 2013 16:12:18 +0000 (12:12 -0400)]
Address some issues found by coverity (1/3)

Fixes two instances of RESOURCE_LEAK (CWE-772)

6 years agoFix additional warnings given by gcc 4.8 -m32
Josh Stone [Fri, 31 May 2013 02:13:18 +0000 (19:13 -0700)]
Fix additional warnings given by gcc 4.8 -m32

6 years agosymtabAPI: fix warnings given by gcc 4.8
Josh Stone [Fri, 31 May 2013 01:32:47 +0000 (18:32 -0700)]
symtabAPI: fix warnings given by gcc 4.8

Compiling ../src/parseStab.C
../src/parseStab.C: In function ‘std::string Dyninst::SymtabAPI::parseStabString(Dyninst::SymtabAPI::Module*, int, char*, int, Dyninst::SymtabAPI::typeCommon*)’:
../src/parseStab.C:207:11: warning: variable ‘newType’ set but not used [-Wunused-but-set-variable]
    Type * newType = NULL; // For new types to add to the collection
           ^
../src/parseStab.C: In function ‘Dyninst::SymtabAPI::Type* parseArrayDef(Dyninst::SymtabAPI::Module*, const char*, int, char*&, int&, unsigned int)’:
../src/parseStab.C:1089:11: warning: variable ‘symdesc’ set but not used [-Wunused-but-set-variable]
     char *symdesc;
           ^
../src/parseStab.C:1090:9: warning: variable ‘symdescID’ set but not used [-Wunused-but-set-variable]
     int symdescID;
         ^
../src/parseStab.C: In function ‘char* parseFieldList(Dyninst::SymtabAPI::Module*, Dyninst::SymtabAPI::fieldListType*, char*, bool)’:
../src/parseStab.C:1712:6: warning: variable ‘size’ set but not used [-Wunused-but-set-variable]
  int size = 0;
      ^
../src/parseStab.C: In function ‘char* parseCPlusPlusInfo(Dyninst::SymtabAPI::Module*, char*, const char*, int)’:
../src/parseStab.C:1935:6: warning: variable ‘structsize’ set but not used [-Wunused-but-set-variable]
  int structsize;
      ^
../src/parseStab.C:1937:10: warning: variable ‘nestedType’ set but not used [-Wunused-but-set-variable]
     bool nestedType = false;
          ^
../src/parseStab.C: In function ‘char* parseTypeDef(Dyninst::SymtabAPI::Module*, char*, const char*, int, unsigned int)’:
../src/parseStab.C:2126:9: warning: variable ‘structsize’ set but not used [-Wunused-but-set-variable]
     int structsize;
         ^
Compiling ../src/emitElfStatic.C
../src/emitElfStatic.C:1765:6: warning: unused parameter ‘target’ [-Wunused-parameter]
 bool emitElfStatic::buildPLT(Symtab *target, Offset globalOffset,
      ^
../src/emitElfStatic.C:1765:6: warning: unused parameter ‘err’ [-Wunused-parameter]
../src/emitElfStatic.C:1765:6: warning: unused parameter ‘errMsg’ [-Wunused-parameter]
../src/emitElfStatic.C: In member function ‘Dyninst::Offset Dyninst::SymtabAPI::emitElfStatic::allocateRelocationSection(std::map<Dyninst::SymtabAPI::Symbol*, std::pair<long unsigned int, long unsigned int> >&, Dyninst::Offset, Dyninst::Offset&, Dyninst::SymtabAPI::Symtab*)’:
../src/emitElfStatic.C:1817:11: warning: unused variable ‘obj’ [-Wunused-variable]
   Object *obj = target->getObject();
           ^
../src/emitElfStatic.C: In member function ‘Dyninst::Offset Dyninst::SymtabAPI::emitElfStatic::allocateRelGOTSection(const std::map<Dyninst::SymtabAPI::Symbol*, std::pair<long unsigned int, long unsigned int> >&, Dyninst::Offset, Dyninst::Offset&)’:
../src/emitElfStatic.C:1835:12: warning: unused variable ‘relocSize’ [-Wunused-variable]
   unsigned relocSize = sizeof(Elf64_Rela);
            ^
../src/emitElfStatic.C: At global scope:
../src/emitElfStatic.C:1846:6: warning: unused parameter ‘err’ [-Wunused-parameter]
 bool emitElfStatic::buildRela(Symtab *target, Offset globalOffset,
      ^
../src/emitElfStatic.C:1846:6: warning: unused parameter ‘errMsg’ [-Wunused-parameter]
Compiling ../src/emitElfStatic-x86.C
../src/emitElfStatic-x86.C: In member function ‘bool Dyninst::SymtabAPI::emitElfStatic::archSpecificRelocation(Dyninst::SymtabAPI::Symtab*, Dyninst::SymtabAPI::Symtab*, char*, Dyninst::SymtabAPI::relocationEntry&, Dyninst::Offset, Dyninst::Offset, Dyninst::Offset, Dyninst::SymtabAPI::LinkMap&, std::string&)’:
../src/emitElfStatic-x86.C:167:67: warning: ‘addend’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                 rel.getRelType(), symbolOffset, addend, relOffset);
                                                                   ^
../src/emitElfStatic-x86.C:153:20: note: ‘addend’ was declared here
         Elf32_Word addend;
                    ^
Compiling ../src/Function.C
../src/Function.C: In constructor ‘Dyninst::SymtabAPI::FunctionBase::FunctionBase(Dyninst::SymtabAPI::Symbol*)’:
../src/Function.C:64:15: warning: converting to non-pointer type ‘unsigned int’ from NULL [-Wconversion-null]
    data(NULL)
               ^
../src/Function.C: In constructor ‘Dyninst::SymtabAPI::FunctionBase::FunctionBase()’:
../src/Function.C:76:15: warning: converting to non-pointer type ‘unsigned int’ from NULL [-Wconversion-null]
    data(NULL)
               ^
../src/Function.C: In constructor ‘Dyninst::SymtabAPI::FunctionBase::FunctionBase(Dyninst::SymtabAPI::Module*)’:
../src/Function.C:88:15: warning: converting to non-pointer type ‘unsigned int’ from NULL [-Wconversion-null]
    data(NULL)
               ^
../src/Function.C: In member function ‘bool Dyninst::SymtabAPI::FunctionBase::operator==(const Dyninst::SymtabAPI::FunctionBase&)’:
../src/Function.C:444:49: warning: cast from type ‘const Dyninst::SymtabAPI::FunctionBase*’ to type ‘Dyninst::SymtabAPI::Aggregate*’ casts away qualifiers [-Wcast-qual]
  return ((Aggregate &)(*this)) == ((Aggregate &)f);
                                                 ^
Compiling ../src/Variable.C
../src/Variable.C: In member function ‘bool Dyninst::SymtabAPI::Variable::operator==(const Dyninst::SymtabAPI::Variable&)’:
../src/Variable.C:195:49: warning: cast from type ‘const Dyninst::SymtabAPI::Variable*’ to type ‘Dyninst::SymtabAPI::Aggregate*’ casts away qualifiers [-Wcast-qual]
  return ((Aggregate &)(*this)) == ((Aggregate &)v);
                                                 ^
Compiling ../src/dwarfWalker.C
../src/dwarfWalker.C: In member function ‘Dyninst::SymtabAPI::typeArray* Dyninst::SymtabAPI::DwarfWalker::parseMultiDimensionalArray(Dwarf_Die, Dyninst::SymtabAPI::Type*)’:
../src/dwarfWalker.C:1870:276: warning: converting ‘false’ to pointer type ‘Dyninst::SymtabAPI::typeArray*’ [-Wconversion-null]
   DWARF_FAIL_RET(dwarf_dieoffset( range, & dieOffset, NULL ));
                                                                                                                                                                                                                                                                                    ^
../src/dwarfWalker.C:1880:201: warning: converting ‘false’ to pointer type ‘Dyninst::SymtabAPI::typeArray*’ [-Wconversion-null]
   DWARF_CHECK_RET(status == DW_DLV_ERROR);
                                                                                                                                                                                                         ^

6 years agoparseThat: fix warnings given by gcc 4.8
Josh Stone [Fri, 31 May 2013 00:31:33 +0000 (17:31 -0700)]
parseThat: fix warnings given by gcc 4.8

../src/parseThat.C: In function ‘bool runHunt_binaryEdit()’:
../src/parseThat.C:201:9: warning: variable ‘result’ set but not used [-Wunused-but-set-variable]
     int result, status;
         ^
../src/parseThat.C: In function ‘void parseArgs(int, char**)’:
../src/parseThat.C:806:36: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
                         info->tool = "parseThat";
                                    ^
../src/reglist.C: In member function ‘const char* reglist::getReason(char*)’:
../src/reglist.C:94:9: warning: converting ‘false’ to pointer type ‘const char*’ [-Wconversion-null]
  return false;
         ^

6 years agodynC_API: fix warnings given by gcc 4.8
Josh Stone [Fri, 31 May 2013 00:18:18 +0000 (17:18 -0700)]
dynC_API: fix warnings given by gcc 4.8

For the "string constant" errors, convert the yywarn/yyerror functions
from char* to const char*, and remove a lot of unnecessary strdups.

The remaining few warnings are straightforward.

Compiling ../src/lex.dynC.C
../src/C.l: In function ‘int dynClex()’:
../src/C.l:64:19: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
 <<EOF>>        {yylval.context = "Syntax Error: Unterminated block comment"; return(ERROR);}
                   ^
../src/C.l:71:16: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
 "char"[ \t\v\f]*"*" {yylval.sval = "char *"; return TYPE; }
                ^
../src/C.l:133:36: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
                   yylval.context = "Unterminated string constant";
                                    ^
../src/C.l:144:40: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
                       yylval.context = "constant out of bounds";
                                        ^
../src/C.l:153:36: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
                   yylval.context = "bad escape sequence";
                                    ^
../src/C.l:222:238: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
 ^([^\n;{}])+\n {if(strstr(yytext, "//") != NULL){++line_num;}else{if(strncmp(yytext,"/*", 2) == 0){BEGIN(comment);++line_num;}else{if(lexVerbose)printf("No Semi!\n"); fatalError = true; dynClloc.first_column = yycolumn; yylval.context = "syntax error: missing ';'!"; yyless(yyleng - 1); return(ERROR);}}}
                                                                                                                                                                                                                                              ^
../src/C.l: In function ‘void set_lex_input(char*)’:
../src/C.l:236:20: warning: variable ‘bp’ set but not used [-Wunused-but-set-variable]

                    ^
Compiling ../src/dynC.tab.C
../src/C.y:41:25: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
 char *dynCSnippetName = "";
                         ^
../src/C.y: In function ‘int dynCparse()’:
../src/C.y:328:83: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
           yyerrorNoTok("Invalid number of arguments given in array initialization");
                                                                                   ^
../src/C.y:364:34: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
          yyerror("Syntax error");
                                  ^
../src/C.y:421:43: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
           yywarn("Statement does nothing!");
                                           ^
../src/C.y:612:88: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
           yyerrorNoTok("Local variables not allowed when snippet point is unspecified.");
                                                                                        ^
../src/C.y:642:88: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
           yyerrorNoTok("Local variables not allowed when snippet point is unspecified.");
                                                                                        ^
../src/C.y:646:59: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
           yyerror("Numbered indexes for parameters only");
                                                           ^
../src/C.y:771:83: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
              yyerrorNoTokNonUni("Return values only valid at function exit points");
                                                                                   ^
../src/C.y:796:59: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
        yyerror("Syntax error: unrecognized dyninst call");
                                                           ^
dynC.tab.c:2875:32: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dynC.tab.c:3024:32: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

6 years agodyninstAPI: fix warnings given by gcc 4.8
Josh Stone [Thu, 30 May 2013 23:15:05 +0000 (16:15 -0700)]
dyninstAPI: fix warnings given by gcc 4.8

Compiling ../../dyninstAPI/src/linux-x86.C
../../dyninstAPI/src/linux-x86.C: In member function ‘AstNodePtr PCProcess::createUnprotectStackAST()’:
../../dyninstAPI/src/linux-x86.C:179:68: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     args.push_back(AstNode::operandNode(AstNode::Constant, (void *)size));
                                                                    ^
Compiling ../../dyninstAPI/src/emit-x86.C
../../dyninstAPI/src/emit-x86.C: In member function ‘virtual bool EmitterIA32::emitBTRestores(baseTramp*, codeGen&)’:
../../dyninstAPI/src/emit-x86.C:702:10: warning: variable ‘localSpace’ set but not used [-Wunused-but-set-variable]
     bool localSpace;
          ^
Compiling ../../dyninstAPI/src/unix.C
../../dyninstAPI/src/unix.C:286:6: warning: unused parameter ‘rights’ [-Wunused-parameter]
 bool PCProcess::getMemoryAccessRights(Address start, PCMemPerm& rights) {
      ^
Compiling ../../dyninstAPI/src/stackwalk-x86.C
../../dyninstAPI/src/stackwalk-x86.C: In member function ‘virtual bool StackwalkInstrumentationHelper::isInstrumentation(Dyninst::Address, Dyninst::Address*, unsigned int*, bool*, bool*)’:
../../dyninstAPI/src/stackwalk-x86.C:131:18: warning: variable ‘func’ set but not used [-Wunused-but-set-variable]
   func_instance *func = NULL;
                  ^
Compiling ../../dyninstAPI/src/IAPI_to_AST.C
../../dyninstAPI/src/IAPI_to_AST.C: In member function ‘virtual void ASTFactory::visit(Dyninst::InstructionAPI::RegisterAST*)’:
../../dyninstAPI/src/IAPI_to_AST.C:93:54: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                       (void*)(convertRegID(r, unused))));
                                                      ^
Compiling ../src/Relocation/Widgets/CFWidget-x86.C
../src/Relocation/Widgets/CFWidget-x86.C: In member function ‘bool Dyninst::Relocation::CFWidget::generateIndirect(Dyninst::Relocation::CodeBuffer&, Dyninst::Relocation::CFWidget::Register, const Dyninst::Relocation::RelocBlock*, Dyninst::InstructionAPI::Instruction::Ptr)’:
../src/Relocation/Widgets/CFWidget-x86.C:85:98: warning: cast from type ‘const void*’ to type ‘unsigned char*’ casts away qualifiers [-Wcast-qual]
    ia32_decode(IA32_FULL_DECODER, (unsigned char *)insn->ptr(), orig_instr);
                                                                                                  ^
Compiling ../../dyninstAPI/src/BPatch_image.C
../../dyninstAPI/src/BPatch_image.C: In member function ‘BPatch_variableExpr* BPatch_image::findVariable(const char*, bool)’:
../../dyninstAPI/src/BPatch_image.C:699:19: warning: variable ‘var_as’ set but not used [-Wunused-but-set-variable]
     AddressSpace *var_as = NULL;
                   ^
Compiling ../../dyninstAPI/src/BPatch_snippet.C
../../dyninstAPI/src/BPatch_snippet.C: In constructor ‘BPatch_registerExpr::BPatch_registerExpr(Dyninst::MachRegister)’:
../../dyninstAPI/src/BPatch_snippet.C:967:58: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                                                  (void *)reg));
                                                          ^
../../dyninstAPI/src/BPatch_snippet.C: In function ‘void constructorHelper(void (* const&)(BPatch_point*, void*), bool, BPatch_stInterpret, AstNodePtr&, AstNodePtr&)’:
../../dyninstAPI/src/BPatch_snippet.C:1631:67: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     idNode = AstNode::operandNode(AstNode::Constant, (void*)(int) cb_id );
                                                                   ^
../../dyninstAPI/src/BPatch_snippet.C:1644:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     icNode = AstNode::operandNode(AstNode::Constant, (void*) ic );
                                                              ^
Compiling ../../dyninstAPI/src/BPatch_process.C
../../dyninstAPI/src/BPatch_process.C: In member function ‘virtual BPatch_object* BPatch_process::loadLibrary(const char*, bool)’:
../../dyninstAPI/src/BPatch_process.C:1009:18: warning: converting ‘false’ to pointer type ‘BPatch_object*’ [-Wconversion-null]
           return false;
                  ^
../../dyninstAPI/src/BPatch_process.C:1036:38: warning: converting ‘false’ to pointer type ‘BPatch_object*’ [-Wconversion-null]
    if (dlopen_func == NULL) return false;
                                      ^
../../dyninstAPI/src/BPatch_process.C: In member function ‘bool BPatch_process::protectAnalyzedCode()’:
../../dyninstAPI/src/BPatch_process.C:1740:10: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
     bool ret = true;
          ^
Compiling ../../dyninstAPI/src/ast.C
../../dyninstAPI/src/ast.C: In member function ‘bool AstOperatorNode::generateOptimizedAssignment(codeGen&, bool)’:
../../dyninstAPI/src/ast.C:902:13: warning: variable ‘data_oper’ set but not used [-Wunused-but-set-variable]
    AstNode *data_oper = NULL, *const_oper = NULL;
             ^
../../dyninstAPI/src/ast.C: In member function ‘virtual BPatch_type* AstOperatorNode::checkType()’:
../../dyninstAPI/src/ast.C:2270:52: warning: variable ‘eType’ set but not used [-Wunused-but-set-variable]
     BPatch_type *lType = NULL, *rType = NULL, *eType = NULL;
                                                    ^
Compiling ../../dyninstAPI/src/codegen.C
../../dyninstAPI/src/codegen.C: In member function ‘std::string codeGen::format() const’:
../../dyninstAPI/src/codegen.C:776:92: warning: cast from type ‘const void*’ to type ‘unsigned int*’ casts away qualifiers [-Wcast-qual]
      ret << "\t" << base << ": " << insn->format(base) << " / " << *((unsigned *)insn->ptr()) << endl;
                                                                                            ^
Compiling ../../dyninstAPI/src/image.C
../../dyninstAPI/src/image.C: In member function ‘Dyninst::SymtabAPI::Symbol* image::symbol_info(const string&)’:
../../dyninstAPI/src/image.C:2036:15: warning: converting ‘false’ to pointer type ‘Dyninst::SymtabAPI::Symbol*’ [-Wconversion-null]
        return false;
               ^
Compiling ../../dyninstAPI/src/mapped_object.C
../../dyninstAPI/src/mapped_object.C: In member function ‘block_instance* mapped_object::findBlockByEntry(Dyninst::Address)’:
../../dyninstAPI/src/mapped_object.C:632:52: warning: converting ‘false’ to pointer type ‘block_instance*’ [-Wconversion-null]
     if (!findBlocksByAddr(addr, allBlocks)) return false;
                                                    ^
Compiling ../../dyninstAPI/src/hybridOverwrites.C
../../dyninstAPI/src/hybridOverwrites.C: In member function ‘bool HybridAnalysisOW::removeLoop(HybridAnalysisOW::owLoop*, bool, BPatch_point*, bool)’:
../../dyninstAPI/src/hybridOverwrites.C:236:61: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
             overwriteAnalysis(writePoint,(void*)loop->getID());
                                                             ^
Compiling ../../dyninstAPI/src/dynProcess.C
../../dyninstAPI/src/dynProcess.C: In static member function ‘static PCProcess* PCProcess::setupForkedProcess(PCProcess*, Dyninst::ProcControlAPI::Process::ptr)’:
../../dyninstAPI/src/dynProcess.C:194:20: warning: converting ‘false’ to pointer type ‘PCProcess*’ [-Wconversion-null]
             return false;
                    ^
Compiling ../src/Relocation/Springboard.C
../src/Relocation/Springboard.C: In member function ‘Dyninst::Relocation::SpringboardBuilder::generateResult_t Dyninst::Relocation::SpringboardBuilder::generateSpringboard(std::list<codeGen>&, const Dyninst::Relocation::SpringboardReq&, Dyninst::Relocation::SpringboardMap&)’:
../src/Relocation/Springboard.C:217:13: warning: variable ‘size’ set but not used [-Wunused-but-set-variable]
    unsigned size;
             ^

6 years agoFix a typo in saving EFLAGS
Josh Stone [Thu, 30 May 2013 23:02:51 +0000 (16:02 -0700)]
Fix a typo in saving EFLAGS

This seems to be an obvious typo, flagged by a GCC warning:

Compiling ../../dyninstAPI/src/registerSpace.C
../../dyninstAPI/src/registerSpace.C: In member function ‘bool registerSpace::saveVolatileRegisters(codeGen&)’:
../../dyninstAPI/src/registerSpace.C:545:48: warning: value computed is not used [-Wunused-value]
           registers_[REGNUM_EFLAGS]->liveState == registerSlot::spilled;
                                                ^

6 years agodyninstAPI_RT: fix warnings given by gcc 4.8
Josh Stone [Thu, 30 May 2013 22:41:34 +0000 (15:41 -0700)]
dyninstAPI_RT: fix warnings given by gcc 4.8

Compiling ../src/RTstatic_ctors_dtors-x86.c (noPIC)
../src/RTstatic_ctors_dtors-x86.c: In function ‘DYNINSTglobal_irel_handler’:
../src/RTstatic_ctors_dtors-x86.c:123:11: warning: assignment makes pointer from integer without a cast [enabled by default]
       ptr = *(rel->offset);
           ^

6 years agostackwalk: fix warnings given by gcc 4.8
Josh Stone [Thu, 30 May 2013 22:34:38 +0000 (15:34 -0700)]
stackwalk: fix warnings given by gcc 4.8

Compiling ../src/dbginfo-stepper.C
../src/dbginfo-stepper.C: In member function ‘Dyninst::Stackwalker::gcframe_ret_t Dyninst::Stackwalker::DebugStepperImpl::getCallerFrameArch(Dyninst::Address, const Dyninst::Stackwalker::Frame&, Dyninst::Stackwalker::Frame&, Dyninst::Dwarf::DwarfFrameParser::Ptr, bool)’:
../src/dbginfo-stepper.C:306:26: warning: variable ‘arch’ set but not used [-Wunused-but-set-variable]
    Dyninst::Architecture arch;
                          ^
Compiling ../src/sw_pcontrol.C
../src/sw_pcontrol.C: In member function ‘std::string Dyninst::Stackwalker::ProcDebug::getExecutablePath()’:
../src/sw_pcontrol.C:378:216: warning: converting ‘false’ to pointer type for argument 1 of ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ [-Wconversion-null]
    CHECK_PROC_LIVE;
                                                                                                                                                                                                                        ^

6 years ago[API] Change sw_c out_frame parameters into actual outputs
Josh Stone [Thu, 30 May 2013 22:23:29 +0000 (15:23 -0700)]
[API] Change sw_c out_frame parameters into actual outputs

The out_frame parameters of walkSingleFrame and getInitialFrame are
frame_t, a struct which is passed by value.  GCC 4.8 warns that this
parameter is set but not used:

Compiling ../src/sw_c.C
../src/sw_c.C: In function ‘int walkSingleFrame(walker_t, frame_t, frame_t)’:
../src/sw_c.C:117:5: warning: parameter ‘out_frame’ set but not used [-Wunused-but-set-parameter]
 int walkSingleFrame(walker_t walker, frame_t frame, frame_t out_frame)
     ^
../src/sw_c.C: In function ‘int getInitialFrame(walker_t, frame_t)’:
../src/sw_c.C:131:5: warning: parameter ‘out_frame’ set but not used [-Wunused-but-set-parameter]
 int getInitialFrame(walker_t walker, frame_t out_frame)
     ^

In order for this to be an actual output parameter, these will have to
be frame_t* parameters.  This is a simple change, but it does change the
API of these functions.  Given that they formerly couldn't work at all,
I expect no one is using these anyway...

6 years agoproccontrol: fix warnings given by gcc 4.8
Josh Stone [Thu, 30 May 2013 22:12:23 +0000 (15:12 -0700)]
proccontrol: fix warnings given by gcc 4.8

Compiling ../src/linux.C
../src/linux.C: In member function ‘virtual bool linux_thread::plat_setAllRegisters(int_registerPool&)’:
../src/linux.C:2043:115: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
             result = do_ptrace((pt_req) PTRACE_POKEUSER, lwp, (void *) (unsigned long) di->second.first, (void *) res);
                                                                                                                   ^
../src/linux.C: In member function ‘virtual bool linux_thread::plat_setRegister(Dyninst::MachRegister, Dyninst::MachRegisterVal)’:
../src/linux.C:2175:52: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       result = do_ptrace((pt_req) PTRACE_POKEUSR, lwp, (void *) offset, (void *) value);
                                                    ^
../src/linux.C:2175:69: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       result = do_ptrace((pt_req) PTRACE_POKEUSR, lwp, (void *) offset, (void *) value);
                                                                     ^
../src/linux.C:2179:52: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       result = do_ptrace((pt_req) PTRACE_POKEUSR, lwp, (void *) offset, (void *) value);
                                                    ^
../src/linux.C: In member function ‘virtual bool linux_thread::thrdb_getThreadArea(int, Dyninst::Address&)’:
../src/linux.C:2295:60: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
          int result = do_ptrace((pt_req) PTRACE_GET_THREAD_AREA, lwp, (void *) val, &addrv);
                                                            ^
../src/linux.C:2316:68: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
          int result = do_ptrace((pt_req) PTRACE_ARCH_PRCTL, lwp, &addrv, (void *) op);
                                                                    ^
Compiling ../src/unix.C
../src/unix.C: In member function ‘virtual bool unix_process::plat_findAllocatedRegionAround(Dyninst::Address, Dyninst::ProcControlAPI::Process::MemoryRegion&)’:
../src/unix.C:241:21: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
     memRegion.first  = NULL;
                     ^
../src/unix.C:242:22: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
     memRegion.second = NULL;
                      ^
Compiling ../src/event.C
../src/event.C: In destructor ‘virtual Dyninst::ProcControlAPI::EventRPC::~EventRPC()’:
../src/event.C:601:29: warning: argument to ‘sizeof’ in ‘void* memset(void*, int, size_t)’ call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]
    memset(wrapper, 0, sizeof(wrapper));
                             ^
Compiling ../src/handler.C
../src/handler.C: In member function ‘bool HandlerPool::handleEvent(Dyninst::ProcControlAPI::Event::ptr)’:
../src/handler.C:364:14: warning: variable ‘etype’ set but not used [-Wunused-but-set-variable]
    EventType etype = orig_ev->getEventType();
              ^
Compiling ../src/process.C
../src/process.C: In member function ‘virtual bool int_process::forked()’:
../src/process.C:617:16: warning: variable ‘initial_thread’ set but not used [-Wunused-but-set-variable]
    int_thread *initial_thread;
                ^
../src/process.C: In constructor ‘int_process::int_process(Dyninst::PID, int_process*)’:
../src/process.C:1384:1: warning: ‘int_process::exec_mem_cache’ is initialized with itself [-Winit-self]
 int_process::int_process(Dyninst::PID pid_, int_process *p) :
 ^
../src/process.C: In member function ‘virtual bool int_process::plat_findAllocatedRegionAround(Dyninst::Address, Dyninst::ProcControlAPI::Process::MemoryRegion&)’:
../src/process.C:1875:21: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
     memRegion.first  = NULL;
                     ^
../src/process.C:1876:22: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
     memRegion.second = NULL;
                      ^
../src/process.C: In constructor ‘int_breakpoint::int_breakpoint(Dyninst::ProcControlAPI::Breakpoint::ptr)’:
../src/process.C:4605:25: warning: converting ‘false’ to pointer type ‘void*’ [-Wconversion-null]
    offset_transfer(false)
                         ^
../src/process.C: In constructor ‘int_breakpoint::int_breakpoint(Dyninst::Address, Dyninst::ProcControlAPI::Breakpoint::ptr, bool)’:
../src/process.C:4621:23: warning: converting ‘false’ to pointer type ‘void*’ [-Wconversion-null]
    offset_transfer(off)
                       ^
../src/process.C: In constructor ‘int_breakpoint::int_breakpoint(unsigned int, unsigned int, Dyninst::ProcControlAPI::Breakpoint::ptr)’:
../src/process.C:4636:27: warning: converting ‘false’ to pointer type ‘void*’ [-Wconversion-null]
   suppress_callbacks(false)
                           ^
Compiling ../src/irpc.C
../src/irpc.C: In destructor ‘Dyninst::ProcControlAPI::IRPC::~IRPC()’:
../src/irpc.C:1331:28: warning: argument to ‘sizeof’ in ‘void* memset(void*, int, size_t)’ call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]
   memset(wrapper, 0, sizeof(wrapper));
                            ^
Compiling ../src/processplat.C
../src/processplat.C: In member function ‘bool int_remoteIO::getFileStatData(Dyninst::ProcControlAPI::FileSet&)’:
../src/processplat.C:973:9: warning: variable ‘had_error’ set but not used [-Wunused-but-set-variable]
    bool had_error = false;
         ^

6 years agoCorrect several reversed prefix/postfix operators
Josh Stone [Thu, 30 May 2013 22:11:23 +0000 (15:11 -0700)]
Correct several reversed prefix/postfix operators

This was backwards in a few places, so a reminder:

  operator++() and operator--() are the *prefix* versions,
  which are expected to return the updated value.

  operator++(int) and operator--(int) are the *postfix* versions,
  which are expected to return the original value.

Of course, C++ is loose enough that you could do anything you like with
these operator overloads, but these corrections appear to have intended
normal semantics. :)

FWIW, the uses I surveyed were all ignoring the prefix/postfix return
value anyway, so hopefully there weren't any bugs lurking anywhere.

6 years agodataflowAPI: fix warnings given by gcc 4.8
Josh Stone [Thu, 30 May 2013 20:30:42 +0000 (13:30 -0700)]
dataflowAPI: fix warnings given by gcc 4.8

Compiling ../../dataflowAPI/src/stackanalysis.C
../../dataflowAPI/src/stackanalysis.C: In member function ‘void Dyninst::StackAnalysis::summarizeBlocks()’:
../../dataflowAPI/src/stackanalysis.C:147:14: warning: variable ‘next’ set but not used [-Wunused-but-set-variable]
       Offset next;
              ^

6 years agoparseAPI: fix warnings given by gcc 4.8
Josh Stone [Thu, 30 May 2013 20:24:22 +0000 (13:24 -0700)]
parseAPI: fix warnings given by gcc 4.8

Compiling ../src/IA_IAPI.C
../src/IA_IAPI.C: In member function ‘virtual bool Dyninst::InsnAdapter::IA_IAPI::isGarbageInsn() const’:
../src/IA_IAPI.C:350:45: warning: cast from type ‘const void*’ to type ‘char*’ casts away qualifiers [-Wcast-qual]
                 0 == ((char*)curInsn()->ptr())[0] &&
                                             ^
../src/IA_IAPI.C:351:45: warning: cast from type ‘const void*’ to type ‘char*’ casts away qualifiers [-Wcast-qual]
                 0 == ((char*)curInsn()->ptr())[1])
                                             ^
../src/IA_IAPI.C:373:44: warning: cast from type ‘const void*’ to type ‘char*’ casts away qualifiers [-Wcast-qual]
             switch (((char*)curInsn()->ptr())[0]) {
                                            ^
../src/IA_IAPI.C:384:67: warning: cast from type ‘const void*’ to type ‘unsigned char*’ casts away qualifiers [-Wcast-qual]
                         ((0xa0 == ((unsigned char*)curInsn()->ptr())[1]) || (0xa8 == ((unsigned char*)curInsn()->ptr())[1])))
                                                                   ^
../src/IA_IAPI.C:384:118: warning: cast from type ‘const void*’ to type ‘unsigned char*’ casts away qualifiers [-Wcast-qual]
                         ((0xa0 == ((unsigned char*)curInsn()->ptr())[1]) || (0xa8 == ((unsigned char*)curInsn()->ptr())[1])))
                                                                                                                      ^
Compiling ../src/IA_x86Details.C
../src/IA_x86Details.C: In member function ‘boost::tuples::tuple<boost::shared_ptr<Dyninst::InstructionAPI::Instruction>, boost::shared_ptr<Dyninst::InstructionAPI::Instruction>, bool> Dyninst::InsnAdapter::IA_x86Details::findMaxSwitchInsn(Dyninst::ParseAPI::Block*)’:
../src/IA_x86Details.C:623:13: warning: variable ‘maxSwitchAddr’ set but not used [-Wunused-but-set-variable]
     Address maxSwitchAddr = 0;
             ^

6 years agoinstructionAPI: fix warnings given by gcc 4.8
Josh Stone [Thu, 30 May 2013 19:51:46 +0000 (12:51 -0700)]
instructionAPI: fix warnings given by gcc 4.8

Fixes instances of this warning with various integral T:

../h/Result.h:263:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
           val.m512val = (void *) v;
                       ^
../h/Result.h:266:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    val.dbl128val = (void*) v;
                  ^
../h/Result.h:269:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    val.m14val = (void*) v;
               ^

6 years agosymlite: fix warnings given by gcc 4.8
Josh Stone [Thu, 30 May 2013 19:36:29 +0000 (12:36 -0700)]
symlite: fix warnings given by gcc 4.8

Compiling ../src/SymLite-elf.C
../src/SymLite-elf.C: In member function ‘virtual long unsigned int Dyninst::SymElf::getSymbolSize(const Dyninst::Symbol_t&)’:
../src/SymLite-elf.C:300:173: warning: variable ‘name’ set but not used [-Wunused-but-set-variable]
    GET_SYMBOL(sym, shdr, symbol, name, idx);
                                                                                                                                                                             ^
../src/SymLite-elf.C: In member function ‘virtual Dyninst::Offset Dyninst::SymElf::getSymbolOffset(const Dyninst::Symbol_t&)’:
../src/SymLite-elf.C:314:173: warning: variable ‘name’ set but not used [-Wunused-but-set-variable]
    GET_SYMBOL(sym, shdr, symbols, name, idx);
                                                                                                                                                                             ^
../src/SymLite-elf.C: In member function ‘virtual Dyninst::Offset Dyninst::SymElf::getSymbolTOC(const Dyninst::Symbol_t&)’:
../src/SymLite-elf.C:321:173: warning: variable ‘name’ set but not used [-Wunused-but-set-variable]
    GET_SYMBOL(sym, shdr, symbols, name, idx);
                                                                                                                                                                             ^
../src/SymLite-elf.C: In member function ‘virtual std::string Dyninst::SymElf::getSymbolName(const Dyninst::Symbol_t&)’:
../src/SymLite-elf.C:328:284: warning: variable ‘idx’ set but not used [-Wunused-but-set-variable]
    GET_SYMBOL(sym, shdr, symbols, name, idx);
                                                                                                                                                                                                                                                                                            ^
../src/SymLite-elf.C:328:358: warning: variable ‘symbols’ set but not used [-Wunused-but-set-variable]
    GET_SYMBOL(sym, shdr, symbols, name, idx);
                                                                                                                                                                                                                                                                                                                                                                      ^
../src/SymLite-elf.C: In function ‘int symcache_cmp(const void*, const void*)’:
../src/SymLite-elf.C:365:42: warning: cast from type ‘const void*’ to type ‘Dyninst::SymCacheEntry*’ casts away qualifiers [-Wcast-qual]
    SymCacheEntry *aa = (SymCacheEntry *) a;
                                          ^
../src/SymLite-elf.C:366:42: warning: cast from type ‘const void*’ to type ‘Dyninst::SymCacheEntry*’ casts away qualifiers [-Wcast-qual]
    SymCacheEntry *bb = (SymCacheEntry *) b;
                                          ^
../src/SymLite-elf.C: In member function ‘long unsigned int Dyninst::SymElf::getSymOffset(const Dyninst::Elf_X_Sym&, unsigned int)’:
../src/SymLite-elf.C:381:76: warning: cast from type ‘const char*’ to type ‘long unsigned int*’ casts away qualifiers [-Wcast-qual]
          sym_offset = *((unsigned long *) (odp_data + sym_offset - odp_addr));
                                                                            ^
../src/SymLite-elf.C: In member function ‘long unsigned int Dyninst::SymElf::getSymTOC(const Dyninst::Elf_X_Sym&, unsigned int)’:
../src/SymLite-elf.C:399:97: warning: cast from type ‘const char*’ to type ‘long unsigned int*’ casts away qualifiers [-Wcast-qual]
       unsigned long toc = *((unsigned long *) (odp_data + (sym_offset - odp_addr + sizeof(long))));
                                                                                                 ^
../src/SymLite-elf.C: In member function ‘void Dyninst::SymElf::createSymCache()’:
../src/SymLite-elf.C:441:260: warning: variable ‘str_buffer’ set but not used [-Wunused-but-set-variable]
       FOR_EACH_SYMBOL(shdr, symbols, str_buffer, idx)
                                                                                                                                                                                                                                                                    ^

6 years agoelf: fix warnings given by gcc 4.8
Josh Stone [Thu, 30 May 2013 19:22:58 +0000 (12:22 -0700)]
elf: fix warnings given by gcc 4.8

Compiling ../src/Elf_X.C
../src/Elf_X.C: In member function ‘Dyninst::Elf_X_Nhdr Dyninst::Elf_X_Nhdr::next() const’:
../src/Elf_X.C:1792:38: warning: cast from type ‘const void*’ to type ‘char*’ casts away qualifiers [-Wcast-qual]
     size_t offset = (char *)get_desc() + n_descsz() - (char *)data->d_buf;
                                      ^
Compiling ../src/SystemTap.C
../src/SystemTap.C: In member function ‘bool Dyninst::SystemTapEntries::readAddr(const unsigned char*, size_t, unsigned int&, Dyninst::Address&, unsigned int)’:
../src/SystemTap.C:217:47: warning: cast from type ‘const unsigned char*’ to type ‘uint32_t* {aka unsigned int*}’ casts away qualifiers [-Wcast-qual]
       result = *((uint32_t *) (buffer + offset));
                                               ^
../src/SystemTap.C:219:47: warning: cast from type ‘const unsigned char*’ to type ‘uint64_t* {aka long unsigned int*}’ casts away qualifiers [-Wcast-qual]
       result = *((uint64_t *) (buffer + offset));
                                               ^

6 years agoSimplify SystemTapEntries::parseNotes with Elf_X_Nhdr
Josh Stone [Thu, 30 May 2013 19:21:07 +0000 (12:21 -0700)]
Simplify SystemTapEntries::parseNotes with Elf_X_Nhdr

6 years agocommon: fix warnings given by gcc 4.8
Josh Stone [Thu, 30 May 2013 18:40:17 +0000 (11:40 -0700)]
common: fix warnings given by gcc 4.8

Compiling ../../common/src/addrtranslate-sysv.C
../../common/src/addrtranslate-sysv.C: In member function ‘std::vector<std::pair<long unsigned int, long unsigned int> >* Dyninst::LoadedLib::getMappedRegions()’:
../../common/src/addrtranslate-sysv.C:334:14: warning: converting ‘false’ to pointer type ‘std::vector<std::pair<long unsigned int, long unsigned int> >*’ [-Wconversion-null]
       return false;
              ^
Compiling ../../common/src/string-regex.C
../../common/src/string-regex.C: In function ‘void dedemangle(char*, char*)’:
../../common/src/string-regex.C:101:28: warning: variable ‘start_template_offset’ set but not used [-Wunused-but-set-variable]
       unsigned int offset, start_template_offset=0, stop_template_offset=0;
                            ^
../../common/src/string-regex.C:101:53: warning: variable ‘stop_template_offset’ set but not used [-Wunused-but-set-variable]
       unsigned int offset, start_template_offset=0, stop_template_offset=0;
                                                     ^
Compiling ../../common/src/arch-x86.C
../../common/src/arch-x86.C: In member function ‘bool NS_x86::instruction::isNop() const’:
../../common/src/arch-x86.C:5972:8: warning: variable ‘displacement_location’ set but not used [-Wunused-but-set-variable]
    int displacement_location = 0;
        ^
../../common/src/arch-x86.C:5973:8: warning: variable ‘displacement_size’ set but not used [-Wunused-but-set-variable]
    int displacement_size = 0;
        ^
Compiling ../../common/src/arch-power.C
In file included from ../../common/src/arch-power.C:32:0:
../../common/h/arch-power.h: In constructor ‘NS_power::instruction::instruction(const void*)’:
../../common/h/arch-power.h:782:34: warning: cast from type ‘const void*’ to type ‘NS_power::instructUnion*’ casts away qualifiers [-Wcast-qual]
       insn_ = *((instructUnion *)ptr);
                                  ^

6 years ago.gitignore longer DSO versions, *.so.?.?.?
Josh Stone [Thu, 30 May 2013 01:44:26 +0000 (18:44 -0700)]
.gitignore longer DSO versions, *.so.?.?.?

6 years agoFix PC on BGQ compilation error
Matthew LeGendre [Tue, 28 May 2013 23:17:58 +0000 (16:17 -0700)]
Fix PC on BGQ compilation error

6 years agoRemoved incorrect SymtabAPI assert on PPC64 binaries
Matthew LeGendre [Tue, 28 May 2013 23:17:30 +0000 (16:17 -0700)]
Removed incorrect SymtabAPI assert on PPC64 binaries

6 years agoAdded error timeouts when Stackwalking on BGQ
Matthew LeGendre [Tue, 28 May 2013 23:16:57 +0000 (16:16 -0700)]
Added error timeouts when Stackwalking on BGQ

6 years agoUpdated PC error code numbers to seperate out errors that will only occur on BGQ
Matthew LeGendre [Tue, 28 May 2013 23:15:39 +0000 (16:15 -0700)]
Updated PC error code numbers to seperate out errors that will only occur on BGQ

6 years agoMerge branch 'v8.1.x'
Bill Williams [Tue, 21 May 2013 17:45:30 +0000 (12:45 -0500)]
Merge branch 'v8.1.x'

6 years agoEnsure that we compile test suite and Dyninst with the same CXXFLAGS to work around...
Bill Williams [Tue, 21 May 2013 16:47:46 +0000 (11:47 -0500)]
Ensure that we compile test suite and Dyninst with the same CXXFLAGS to work around gcc 4.7.2 bug

6 years agoMerge branch 'v8.1.x'
Bill Williams [Fri, 10 May 2013 16:52:23 +0000 (11:52 -0500)]
Merge branch 'v8.1.x'

Conflicts:
dyninstAPI/src/ast.C

6 years agoTrack whether we've detected that attach will break, and skip Dyninst attach mode...
Bill Williams [Tue, 7 May 2013 18:28:01 +0000 (13:28 -0500)]
Track whether we've detected that attach will break, and skip Dyninst attach mode if so.

6 years agoMerge branch 'inlining' into legendre_batlab_test1
Matthew LeGendre [Mon, 6 May 2013 21:46:43 +0000 (14:46 -0700)]
Merge branch 'inlining' into legendre_batlab_test1

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.

6 years agoMerge branch 'master' into inlining
Matthew LeGendre [Mon, 6 May 2013 21:41:39 +0000 (14:41 -0700)]
Merge branch 'master' into inlining

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.

6 years agoFix PC problem with signals being dropped due to uninitialized signal mask
Matthew LeGendre [Mon, 6 May 2013 17:50:27 +0000 (10:50 -0700)]
Fix PC problem with signals being dropped due to uninitialized signal mask

6 years agoMerge branch 'master' into legendre_commits1
Matthew LeGendre [Mon, 6 May 2013 17:15:38 +0000 (10:15 -0700)]
Merge branch 'master' into legendre_commits1

6 years agoPrevent us accidentally rewriting indirect symbols as section typed
Andrew Bernat [Wed, 1 May 2013 20:21:29 +0000 (15:21 -0500)]
Prevent us accidentally rewriting indirect symbols as section typed

6 years agoFix a problem rewriting 32-bit static Ubuntu binaries; add better error handling.
Andrew Bernat [Mon, 1 Apr 2013 20:28:12 +0000 (15:28 -0500)]
Fix a problem rewriting 32-bit static Ubuntu binaries; add better error handling.

6 years agoFix a #define bug when instrumenting ia32 binaries
Andrew Bernat [Thu, 4 Apr 2013 16:22:07 +0000 (11:22 -0500)]
Fix a #define bug when instrumenting ia32 binaries

6 years agoUse Matt's patching mechanism for while loop generation as well as if statement gener...
Paradyn Project [Fri, 19 Apr 2013 09:26:57 +0000 (02:26 -0700)]
Use Matt's patching mechanism for while loop generation as well as if statement generation

Conflicts:
dyninstAPI/src/ast.C

6 years agoFix PPC64 proccontrol library injection; TOC value could be wrong
Andrew R. Bernat [Wed, 24 Apr 2013 16:21:34 +0000 (09:21 -0700)]
Fix PPC64 proccontrol library injection; TOC value could be wrong

6 years agoHandle compressed OPD sections in PPC64 binaries
Andrew R. Bernat [Wed, 24 Apr 2013 16:21:46 +0000 (09:21 -0700)]
Handle compressed OPD sections in PPC64 binaries

6 years agoRemoved non-scaling realpath from libcommon, added Library::getAbsolutePath to PC
Matthew LeGendre [Mon, 29 Apr 2013 21:32:02 +0000 (14:32 -0700)]
Removed non-scaling realpath from libcommon, added Library::getAbsolutePath to PC

6 years agoUse Matt's patching mechanism for while loop generation as well as if statement gener...
Paradyn Project [Fri, 19 Apr 2013 09:26:57 +0000 (02:26 -0700)]
Use Matt's patching mechanism for while loop generation as well as if statement generation

6 years agoAdd test for bug reported by Jean-Paul Laurent: mov %eax, 0x3(%rsp) was reporting...
Bill Williams [Thu, 18 Apr 2013 20:41:36 +0000 (15:41 -0500)]
Add test for bug reported by Jean-Paul Laurent: mov %eax, 0x3(%rsp) was reporting incorrect registers.

6 years agoAdd support for indirect symbols in statically linked 32-bit binaries with a 64-bit...
Paradyn Project [Thu, 18 Apr 2013 15:31:49 +0000 (08:31 -0700)]
Add support for indirect symbols in statically linked 32-bit binaries with a 64-bit mutator. Still haven't wired up 32/32.

6 years agoFix a #define bug when instrumenting ia32 binaries
Andrew Bernat [Thu, 4 Apr 2013 16:22:07 +0000 (11:22 -0500)]
Fix a #define bug when instrumenting ia32 binaries

6 years agoFix bug with whileOp register getting trashed
Andrew Bernat [Mon, 1 Apr 2013 21:37:12 +0000 (16:37 -0500)]
Fix bug with whileOp register getting trashed

6 years agoOptimize register saves at function calls (amd-64)
Andrew Bernat [Mon, 1 Apr 2013 20:28:30 +0000 (15:28 -0500)]
Optimize register saves at function calls (amd-64)

6 years agoFix a problem rewriting 32-bit static Ubuntu binaries; add better error handling.
Andrew Bernat [Mon, 1 Apr 2013 20:28:12 +0000 (15:28 -0500)]
Fix a problem rewriting 32-bit static Ubuntu binaries; add better error handling.

6 years agoMerge branch 'bgq_ramdisk_io' into legendre_commits1
Matthew LeGendre [Fri, 29 Mar 2013 17:24:52 +0000 (10:24 -0700)]
Merge branch 'bgq_ramdisk_io' into legendre_commits1

Conflicts:
proccontrol/h/PCErrors.h
proccontrol/src/bluegeneq.h

6 years agoMerge branch 'bgq_attach_timeout' into legendre_commits1
Matthew LeGendre [Fri, 29 Mar 2013 17:20:21 +0000 (10:20 -0700)]
Merge branch 'bgq_attach_timeout' into legendre_commits1

6 years agoclean up ProcControlAPI Windows Build Directory
Zuyu Zhang [Tue, 19 Mar 2013 22:21:30 +0000 (17:21 -0500)]
clean up ProcControlAPI Windows Build Directory

6 years agoSymlink path fix as suggested by Josh Stone
Andrew Bernat [Fri, 15 Mar 2013 00:30:52 +0000 (19:30 -0500)]
Symlink path fix as suggested by Josh Stone

6 years agoMerge branch 'master' of git.dyninst.org:/pub/dyninst
Zuyu Zhang [Tue, 19 Mar 2013 22:58:29 +0000 (17:58 -0500)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst

6 years agoclean up ProcControlAPI Windows Build Directory
Zuyu Zhang [Tue, 19 Mar 2013 22:21:30 +0000 (17:21 -0500)]
clean up ProcControlAPI Windows Build Directory

6 years agoMerge branch 'master' of git.dyninst.org:/pub/dyninst
Zuyu Zhang [Tue, 19 Mar 2013 21:45:51 +0000 (16:45 -0500)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst

6 years agoPC BGQ - Have decoder drop messages for processes in error state
Matthew LeGendre [Mon, 18 Mar 2013 17:35:32 +0000 (10:35 -0700)]
PC BGQ - Have decoder drop messages for processes in error state

6 years agoSymlink path fix as suggested by Josh Stone
Andrew Bernat [Fri, 15 Mar 2013 00:30:52 +0000 (19:30 -0500)]
Symlink path fix as suggested by Josh Stone

6 years ago* make.config now has a SONAME_NUM to go with RELEASE_NUM. The former is the ABI... v8.1.1
Bill Williams [Thu, 14 Mar 2013 22:27:22 +0000 (17:27 -0500)]
* make.config now has a SONAME_NUM to go with RELEASE_NUM. The former is the ABI-level version (8.1) that eventually goes into the DT_NEEDED field in the binaries; the latter is the name to go on the actual binary on disk.
* make.library.tmpl now produces a three-layer name system: libfoo.so points to libfoo.SONAME_NUM points to libfoo.RELEASE_NUM. Tools that want the current version at all times can continue to link against libfoo.so. Tools that want a particular version per DT_NEEDED can link against the current target of libfoo.SONAME_NUM. Linking against libfoo.RELEASE_NUM explicitly is discouraged.
* Added Josh Stone's fixes for minor valgrind-reported problems.

6 years agoPatch from Josh Stone to fix instruction decoding op_v/op_z bug.
Bill Williams [Thu, 14 Mar 2013 18:32:15 +0000 (13:32 -0500)]
Patch from Josh Stone to fix instruction decoding op_v/op_z bug.

6 years ago* Fix unhandled 8-byte offsets in handleAddSub. Shouldn't happen in current instructi...
Bill Williams [Thu, 14 Mar 2013 18:29:28 +0000 (13:29 -0500)]
* Fix unhandled 8-byte offsets in handleAddSub. Shouldn't happen in current instruction sets but now is future-proof.
* Use proper types for convert().
* Clean up debug print in debug stepper.

6 years agoRemove #ifdefs for cap_liveness, cap_dynamic_heap, and cap_threads, all of which...
Bill Williams [Wed, 6 Mar 2013 20:17:38 +0000 (14:17 -0600)]
Remove #ifdefs for cap_liveness, cap_dynamic_heap, and cap_threads, all of which should universally be true and required for new ports.

6 years agoUpdate version strings to 8.1.1; retire DepGraphAPI
Andrew Bernat [Thu, 14 Mar 2013 19:06:17 +0000 (14:06 -0500)]
Update version strings to 8.1.1; retire DepGraphAPI

6 years agoAdd support for indirect relocations in static binary rewriting
Andrew Bernat [Thu, 14 Mar 2013 18:20:53 +0000 (13:20 -0500)]
Add support for indirect relocations in static binary rewriting

6 years agoRemove unnecessary dwarf debugging output
Andrew Bernat [Thu, 14 Mar 2013 18:20:08 +0000 (13:20 -0500)]
Remove unnecessary dwarf debugging output

6 years agoMerge branch 'master' into bgq_attach_timeout
Matthew LeGendre [Wed, 13 Mar 2013 17:49:47 +0000 (10:49 -0700)]
Merge branch 'master' into bgq_attach_timeout

6 years agoFix BGQ PC Memory leak
Matthew LeGendre [Wed, 13 Mar 2013 17:48:44 +0000 (10:48 -0700)]
Fix BGQ PC Memory leak

6 years agoDon't steal signal handlers from app for PC emergency shutdown handling on BGQ
Matthew LeGendre [Tue, 12 Mar 2013 23:43:46 +0000 (16:43 -0700)]
Don't steal signal handlers from app for PC emergency shutdown handling on BGQ

6 years agoFix crash when we timeout waiting for a message, then receive the message.
Matthew LeGendre [Tue, 12 Mar 2013 23:42:41 +0000 (16:42 -0700)]
Fix crash when we timeout waiting for a message, then receive the message.

6 years agoFixes from testing SymtabAPI Inlined function support
Matthew LeGendre [Mon, 11 Mar 2013 23:14:46 +0000 (16:14 -0700)]
Fixes from testing SymtabAPI Inlined function support

6 years agoA missing symbol in static rewriting is an error case, not a silent skip case. Fixed.
bernat_tau [Fri, 8 Mar 2013 23:00:44 +0000 (15:00 -0800)]
A missing symbol in static rewriting is an error case, not a silent skip case. Fixed.

6 years agoMerge branch 'master' of git.dyninst.org:/pub/dyninst
bernat_tau [Fri, 8 Mar 2013 22:08:24 +0000 (14:08 -0800)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst

6 years agoFix instrumenting x86 conditional exits
bernat_tau [Fri, 8 Mar 2013 22:01:11 +0000 (14:01 -0800)]
Fix instrumenting x86 conditional exits

6 years agoMerge branch 'master' into inlining
Matthew LeGendre [Fri, 8 Mar 2013 18:44:13 +0000 (10:44 -0800)]
Merge branch 'master' into inlining

6 years agoInitial support for inlined functions in SymtabAPI
Matthew LeGendre [Fri, 8 Mar 2013 18:43:20 +0000 (10:43 -0800)]
Initial support for inlined functions in SymtabAPI

6 years agoFix weak symbol bug in static rewriting
Andrew Bernat [Thu, 7 Mar 2013 17:50:42 +0000 (11:50 -0600)]
Fix weak symbol bug in static rewriting

6 years agoRemove asserts that dwarf information is available; sometimes it just isn't.
Andrew Bernat [Wed, 6 Mar 2013 22:53:56 +0000 (16:53 -0600)]
Remove asserts that dwarf information is available; sometimes it just isn't.

6 years agoElf_X fix: caching would lead to using the information for the wrong file if we had...
Andrew Bernat [Wed, 6 Mar 2013 22:41:21 +0000 (16:41 -0600)]
Elf_X fix: caching would lead to using the information for the wrong file if we had duplicate names (e.g., two archives with identically-named .o files)

6 years agoRemove auto-copy of documentation; the docs directory should be specified if at all.
Andrew Bernat [Wed, 6 Mar 2013 15:16:03 +0000 (09:16 -0600)]
Remove auto-copy of documentation; the docs directory should be specified if at all.

6 years agoThere is no summary of type compatibility rules; removed misleading prose.
Andrew Bernat [Wed, 6 Mar 2013 15:13:44 +0000 (09:13 -0600)]
There is no summary of type compatibility rules; removed misleading prose.

6 years agoModify Manual Makefile to copy *.pdf to docs.git
Zuyu Zhang [Wed, 6 Mar 2013 02:41:01 +0000 (20:41 -0600)]
Modify Manual Makefile to copy *.pdf to docs.git

6 years agoSymtabAPI manual updates; Add .gitignore under stackWalkAPI/doc
Zuyu Zhang [Wed, 6 Mar 2013 02:11:16 +0000 (20:11 -0600)]
SymtabAPI manual updates; Add .gitignore under stackWalkAPI/doc

6 years agoFix typo for ParseAPI manual
Zuyu Zhang [Tue, 5 Mar 2013 21:07:02 +0000 (15:07 -0600)]
Fix typo for ParseAPI manual

6 years agoFixed typo in GCC version test
Andrew Bernat [Tue, 5 Mar 2013 03:39:47 +0000 (21:39 -0600)]
Fixed typo in GCC version test

6 years agoFoozle
Andrew Bernat [Tue, 5 Mar 2013 03:07:25 +0000 (21:07 -0600)]
Foozle

6 years agoUpdated C++11 check; only necessary for GCC 4.7.0/4.7.1.
Andrew Bernat [Tue, 5 Mar 2013 02:49:33 +0000 (20:49 -0600)]
Updated C++11 check; only necessary for GCC 4.7.0/4.7.1.

6 years agoCheck for c++11x in mutator code, and update parseThat to correctly be c++11x-compatible.
Bill Williams [Mon, 4 Mar 2013 22:46:00 +0000 (16:46 -0600)]
Check for c++11x in mutator code, and update parseThat to correctly be c++11x-compatible.

6 years agoDon't override libiberty location.
Andrew Bernat [Mon, 4 Mar 2013 19:54:24 +0000 (13:54 -0600)]
Don't override libiberty location.

6 years agoRemove size arg in getMemoryAccessRights in ProcControlAPI
Zuyu Zhang [Mon, 4 Mar 2013 16:48:47 +0000 (10:48 -0600)]
Remove size arg in getMemoryAccessRights in ProcControlAPI

6 years agoFix bad public headers. pre-8.1RC1
Bill Williams [Fri, 1 Mar 2013 19:06:35 +0000 (13:06 -0600)]
Fix bad public headers.

6 years agoUpdate ParseAPI example with better-looking graph; provided by E. Robbins.
Andrew Bernat [Fri, 1 Mar 2013 19:06:03 +0000 (13:06 -0600)]
Update ParseAPI example with better-looking graph; provided by E. Robbins.

6 years agoMerge branch 'master' of git.dyninst.org:/pub/dyninst
Andrew Bernat [Fri, 1 Mar 2013 18:15:56 +0000 (12:15 -0600)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst

6 years agoDyninst pkgconfig
Andrew Bernat [Fri, 1 Mar 2013 18:05:36 +0000 (12:05 -0600)]
Dyninst pkgconfig

6 years agoUpdated PC Version number
Matthew LeGendre [Fri, 1 Mar 2013 18:10:31 +0000 (10:10 -0800)]
Updated PC Version number

6 years agoUpdate versions missed by previous commit.
Bill Williams [Fri, 1 Mar 2013 17:49:58 +0000 (11:49 -0600)]
Update versions missed by previous commit.

6 years agoFix a bug where we'd use _m32 instrumenting a 64-bit binary on a 32-bit system, leadi...
Andrew Bernat [Fri, 1 Mar 2013 17:44:25 +0000 (11:44 -0600)]
Fix a bug where we'd use _m32 instrumenting a 64-bit binary on a 32-bit system, leading to user confusion.

6 years agoAdded example build line for ParseAPI example.
Andrew Bernat [Fri, 1 Mar 2013 02:58:02 +0000 (20:58 -0600)]
Added example build line for ParseAPI example.

6 years agoUpdate parseAPI example to compile and remove warnings. Rebuild patchAPI/symtabAPI...
Andrew Bernat [Fri, 1 Mar 2013 02:53:37 +0000 (20:53 -0600)]
Update parseAPI example to compile and remove warnings. Rebuild patchAPI/symtabAPI docs.

6 years agoMerge branch 'master' of git.dyninst.org:/pub/dyninst
Matthew LeGendre [Fri, 1 Mar 2013 01:30:56 +0000 (17:30 -0800)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst

6 years agoFix issue where parseThat was not respecting DESTDIR
Matthew LeGendre [Fri, 1 Mar 2013 01:30:15 +0000 (17:30 -0800)]
Fix issue where parseThat was not respecting DESTDIR

6 years agoFix issue where parseThat was building even when disable-testsuite was specified
Matthew LeGendre [Fri, 1 Mar 2013 01:29:45 +0000 (17:29 -0800)]
Fix issue where parseThat was building even when disable-testsuite was specified

6 years agoBump version to 8.1 in query methods and makefiles.
Bill Williams [Thu, 28 Feb 2013 23:25:44 +0000 (17:25 -0600)]
Bump version to 8.1 in query methods and makefiles.

6 years agoMerge branch 'master' of git.dyninst.org:/pub/dyninst
Andrew Bernat [Thu, 28 Feb 2013 22:21:23 +0000 (16:21 -0600)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst