7 years agoC++11 detection on a per-feature basis via BSD-licensed CMake scripts (that will...
Bill Williams [Wed, 30 Apr 2014 15:51:44 +0000 (10:51 -0500)]
C++11 detection on a per-feature basis via BSD-licensed CMake scripts (that will become part of 2.8.x at some point).

7 years agoInitialize DYNINSTstaticMode=0 from the mutator if present, not from common init...
Bill Williams [Wed, 30 Apr 2014 15:49:22 +0000 (10:49 -0500)]
Initialize DYNINSTstaticMode=0 from the mutator if present, not from common init code.

7 years agoInitial dynC CMakeLists
Bill Williams [Wed, 30 Apr 2014 15:48:44 +0000 (10:48 -0500)]
Initial dynC CMakeLists

7 years agoSyscall merge cleanup
Bill Williams [Wed, 30 Apr 2014 15:48:22 +0000 (10:48 -0500)]
Syscall merge cleanup

7 years agoFix the *other* place where we need to make shdr alignment >= data alignment
Bill Williams [Tue, 25 Mar 2014 21:02:33 +0000 (16:02 -0500)]
Fix the *other* place where we need to make shdr alignment >= data alignment

7 years agoAdded syscalls/ directory with processing script and current unistd.h files
Emily R. Jacobson [Mon, 10 Jun 2013 14:47:03 +0000 (09:47 -0500)]
Added syscalls/ directory with processing script and current unistd.h files

7 years agoInitial implementation of system call events in ProcControlAPI.
Emily R. Jacobson [Mon, 10 Jun 2013 14:42:44 +0000 (09:42 -0500)]
Initial implementation of system call events in ProcControlAPI.

7 years agodyninstAPI: Replace the sleep macro with a function pointer
Josh Stone [Wed, 23 Apr 2014 17:37:13 +0000 (12:37 -0500)]
dyninstAPI: Replace the sleep macro with a function pointer

Having "#define sleep" was breaking things deep in boost.  A simple
function pointer should have much more contained effects.

7 years agodyninstAPI: Initialize a few Address bounds
Josh Stone [Mon, 21 Apr 2014 18:06:07 +0000 (11:06 -0700)]
dyninstAPI: Initialize a few Address bounds

GCC complains again of maybe-uninitialized variable use.  Again it's
hard to see how, but easy to just initialize them.

7 years agodyninstAPI: Match EdgePredicateAdapter::pred_impl to its parent
Josh Stone [Mon, 21 Apr 2014 17:47:44 +0000 (10:47 -0700)]
dyninstAPI: Match EdgePredicateAdapter::pred_impl to its parent

GCC 4.8.2 says:

parseAPI/h/ParseContainers.h:58:15: warning: ‘bool Dyninst::ParseAPI::iterator_predicate<VALUE, REFERENCE>::pred_impl(REFERENCE) const [with VALUE = edge_instance*; REFERENCE = edge_instance*]’ was hidden [-Woverloaded-virtual]
  virtual bool pred_impl(const REFERENCE) const
dyninstAPI/src/block.h:75:17: warning:   by ‘virtual bool EdgePredicateAdapter::pred_impl(const edge_instance*) const’ [-Woverloaded-virtual]
    virtual bool pred_impl(const edge_instance *e) const { return int_->pred_impl(e->edge()); };

In this case, "REFERENCE" is "edge_instance *", and since the const
applies to the template type as a whole, the parameter at the base class
is effectively "edge_instance * const".  Derived EdgePredicateAdapter
needs to match that signature to avoid the warning.

Note: in iterator_predicate, with "REFERENCE = VALUE &", the effective
type of "const REFERENCE" is "VALUE & const", which is not a useful
thing to say since references are always unchanging.  The intent was
probably to arrive at "const VALUE &", equivalently "VALUE const &".
But since this is in a public interface, I'll leave it alone for now.

7 years agocommon: Initialize cur in addrRangeTree::find
Josh Stone [Mon, 21 Apr 2014 17:24:34 +0000 (10:24 -0700)]
common: Initialize cur in addrRangeTree::find

GCC warned that cur may be used uninitialized within treeSuccessor.  I
can't find that problematic path, but it's simple to just set it to nil.

7 years agoClean up library linkage
Josh Stone [Sat, 15 Mar 2014 00:37:54 +0000 (17:37 -0700)]
Clean up library linkage

- Add -Wl,--no-undefined to gnu link flags, so it's a link-time error if
  any library doesn't declare everything it uses.

- Add a 'target_link_private_libraries' function to set LINK_PRIVATE, so
  dependencies aren't implicitly propagated.  Each library must thus
  explicitly declare its link needs.  This only works for CMake 2.8.7+,
  but falls back gracefully otherwise.

- All libraries are now whittled down to link only against their direct
  dependencies to satisfy used symbols.  Check this with "ldd -r -u".
  The only extras now are libelf in libdynDwarf, because libdwarf
  doesn't always link libelf itself, and libm is always added by g++.

7 years agoFully separate symtab and symlite
Josh Stone [Sat, 15 Mar 2014 00:12:07 +0000 (17:12 -0700)]
Fully separate symtab and symlite

The cmake LIGHTWEIGHT_SYMTAB option is documented to toggle between
symtab and symlite for ParseAPI, ProcControl, and Stackwalker.  However,
these libraries didn't fully commit one way or the other, so we were
left in limbo with both loaded most of the time.  This patch fixes them
to be fully separated into just symtab or just symlite.

- All CMakeLists now respect LIGHTWEIGHT_SYMTAB when setting target
  libraries, so they'll fail to link if something is wrong.

- ParseAPI now builds with symlite, but note that DyninstAPI won't work
  yet in this mode, because it assumes full SymtabCodeSource.

- ProcControl's getElfReader() now works with either symtab or symlite.

- Stackwalker's DebugStepperImpl::GetReg is refactored a bit to work
  without symtab, and the latent cap_stackwalker_use_symtab is now
  converted to WITH_SYMTAB_API and enabled.

7 years agocmake: Look for plain libiberty after libiberty_pic
Josh Stone [Tue, 11 Mar 2014 20:36:56 +0000 (13:36 -0700)]
cmake: Look for plain libiberty after libiberty_pic

On Debian <= wheezy, the PIC library is named libiberty_pic.a.
On Debian >= jessie and all RHEL and Fedora, libiberty.a is PIC.

7 years agoMerge remote-tracking branch 'origin/master' into v8.2
Josh Stone [Tue, 22 Apr 2014 22:05:03 +0000 (15:05 -0700)]
Merge remote-tracking branch 'origin/master' into v8.2


7 years agoUpdate handleAddSub to properly handle signed ints
Emily Jacobson [Fri, 7 Feb 2014 17:48:25 +0000 (11:48 -0600)]
Update handleAddSub to properly handle signed ints

7 years agodecodeImmediate: for 64-bit operands, all immediates are sign-extended
Emily Jacobson [Thu, 6 Feb 2014 21:57:50 +0000 (15:57 -0600)]
decodeImmediate: for 64-bit operands, all immediates are sign-extended

7 years agoTailcall fix: a jump to the current function's entry point is not a tail call.
Emily Jacobson [Fri, 31 Jan 2014 16:56:45 +0000 (10:56 -0600)]
Tailcall fix: a jump to the current function's entry point is not a tail call.

7 years agoUpdated RelocBlock::determineSpringboards to filter tailcalls in addition to regular...
Emily Jacobson [Tue, 28 Jan 2014 16:56:42 +0000 (10:56 -0600)]
Updated RelocBlock::determineSpringboards to filter tailcalls in addition to regular calls

7 years agoCleanup unused functions in the SpringboardBuilder class
Emily Jacobson [Mon, 27 Jan 2014 17:55:36 +0000 (11:55 -0600)]
Cleanup unused functions in the SpringboardBuilder class

7 years agoUpdate springboard generation to take function and priority
Emily Jacobson [Mon, 27 Jan 2014 17:41:15 +0000 (11:41 -0600)]
Update springboard generation to take function and priority
information into account when checking for springboard conflicts.

7 years agoWe weren't ensuring that our section's alignment was at least equal to
Emily Jacobson [Wed, 16 Apr 2014 18:53:43 +0000 (13:53 -0500)]
We weren't ensuring that our section's alignment was at least equal to
    its data's alignment. Fixed. (Part 2, from Bill.)

7 years agoMake type checking less aggressive--no type info != void
Paradyn [Wed, 16 Apr 2014 18:11:00 +0000 (13:11 -0500)]
Make type checking less aggressive--no type info != void

7 years agoWindows fixes & debug log cleanup
Paradyn [Thu, 10 Apr 2014 18:19:27 +0000 (13:19 -0500)]
Windows fixes & debug log cleanup

7 years agoNull check symtabreader's symtab before returning it, as we can't use a symtabreader...
Bill Williams [Mon, 7 Apr 2014 19:15:37 +0000 (14:15 -0500)]
Null check symtabreader's symtab before returning it, as we can't use a symtabreader if it failed to open a symtab

7 years agoFix some warning spam
Bill Williams [Wed, 2 Apr 2014 15:48:35 +0000 (10:48 -0500)]
Fix some warning spam

7 years agoIf we won't be able to generate a stack unprotect, fall through to the library inject...
Bill Williams [Mon, 31 Mar 2014 16:12:22 +0000 (11:12 -0500)]
If we won't be able to generate a stack unprotect, fall through to the library injection mechanism that might still work

7 years agoOne more debug statement
Bill Williams [Fri, 28 Mar 2014 21:38:50 +0000 (16:38 -0500)]
One more debug statement

7 years agoMore debugging output changes
Bill Williams [Fri, 28 Mar 2014 21:01:45 +0000 (16:01 -0500)]
More debugging output changes

7 years agoDebug tracing for the loadlibrary infmalloc
Bill Williams [Fri, 28 Mar 2014 20:23:00 +0000 (15:23 -0500)]
Debug tracing for the loadlibrary infmalloc

7 years agoDebug output, don't push this
Bill Williams [Fri, 28 Mar 2014 19:42:02 +0000 (14:42 -0500)]
Debug output, don't push this

7 years agoTest whether boost 1.40 on Ubuntu 10 works cleanly now
Bill Williams [Thu, 20 Mar 2014 18:28:11 +0000 (13:28 -0500)]
Test whether boost 1.40 on Ubuntu 10 works cleanly now

7 years agoWe weren't ensuring that our section's alignment was at least equal to its data's...
Bill Williams [Wed, 19 Mar 2014 21:00:02 +0000 (16:00 -0500)]
We weren't ensuring that our section's alignment was at least equal to its data's alignment. Fixed.

7 years agoTypes changed in the linkMap and ppc32 didn't build cleanly; fixed.
Bill Williams [Wed, 19 Mar 2014 20:59:33 +0000 (15:59 -0500)]
Types changed in the linkMap and ppc32 didn't build cleanly; fixed.

7 years agoFixes for BGQ functionality to kick threads out of locks during emergency shutdowns
Matthew LeGendre [Wed, 9 Apr 2014 23:15:33 +0000 (16:15 -0700)]
Fixes for BGQ functionality to kick threads out of locks during emergency shutdowns

7 years agoFix BGQ compilation errors with new Boost based mutex/condvar system
Matthew LeGendre [Wed, 9 Apr 2014 23:14:14 +0000 (16:14 -0700)]
Fix BGQ compilation errors with new Boost based mutex/condvar system

7 years agoFix problem with storing pretty names for inlined subroutines
Matthew LeGendre [Fri, 4 Apr 2014 22:23:41 +0000 (15:23 -0700)]
Fix problem with storing pretty names for inlined subroutines

7 years agoDefault to Boost_NO_BOOST_CMAKE because of boost bugs
Bill Williams [Mon, 17 Mar 2014 19:42:01 +0000 (14:42 -0500)]
Default to Boost_NO_BOOST_CMAKE because of boost bugs

7 years agoForce boost >= 1.41.0
Bill Williams [Mon, 10 Mar 2014 20:52:11 +0000 (15:52 -0500)]
Force boost >= 1.41.0

7 years agoAdd link dependency on Elf_X since we actually use it
Bill Williams [Mon, 10 Mar 2014 19:26:20 +0000 (14:26 -0500)]
Add link dependency on Elf_X since we actually use it

7 years agoDon't add link directories; trust boost_libraries to get things right
Bill Williams [Fri, 7 Mar 2014 21:12:03 +0000 (15:12 -0600)]
Don't add link directories; trust boost_libraries to get things right

7 years agoRemove last occurence of shared_dynamic_cast, which is deprecated in favor of dynamic...
Bill Williams [Fri, 7 Mar 2014 16:59:14 +0000 (10:59 -0600)]
Remove last occurence of shared_dynamic_cast, which is deprecated in favor of dynamic_pointer_cast

7 years agoAdd boost system dependency, as thread doesn't take care of it automatically
Bill Williams [Fri, 28 Feb 2014 22:34:02 +0000 (16:34 -0600)]
Add boost system dependency, as thread doesn't take care of it automatically

7 years agoThread library doesn't always work, but libraries should now
Bill Williams [Fri, 28 Feb 2014 21:15:48 +0000 (15:15 -0600)]
Thread library doesn't always work, but libraries should now

7 years agoAllow us to link against boost shared libraries
Bill Williams [Thu, 27 Feb 2014 20:58:42 +0000 (14:58 -0600)]
Allow us to link against boost shared libraries

7 years agoMerge branch 'master' of git.dyninst.org:/pub/dyninst
Matthew LeGendre [Mon, 10 Mar 2014 17:29:57 +0000 (10:29 -0700)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst

7 years agoPass any custom lib and include install locations to RT library
Matthew LeGendre [Mon, 10 Mar 2014 17:23:08 +0000 (10:23 -0700)]
Pass any custom lib and include install locations to RT library

7 years agodyninstAPI: Squash library callbacks during exec bootstrap
Josh Stone [Wed, 26 Feb 2014 22:04:02 +0000 (14:04 -0800)]
dyninstAPI: Squash library callbacks during exec bootstrap

When a process execs and the underlying PCProcess changes, there's
nothing that BPatch or the user can reasonably do with library
callbacks on the old process, so squash them.  Once the PCProcess gets
updated in BPatch::registerExecExit, callbacks will resume as normal.

7 years agoMake sure SIGUSR2 is cleared from masked signals before using it in PC.
Matthew LeGendre [Thu, 6 Mar 2014 23:46:46 +0000 (15:46 -0800)]
Make sure SIGUSR2 is cleared from masked signals before using it in PC.

7 years agoBuild fixes for Linux
Bill Williams [Fri, 28 Feb 2014 15:54:29 +0000 (09:54 -0600)]
Build fixes for Linux

7 years agoClean up some missed exports & uninitialized variables.
Paradyn [Tue, 25 Feb 2014 19:40:15 +0000 (13:40 -0600)]
Clean up some missed exports & uninitialized variables.

7 years agoHandle Windows' need to process .reloc and adjust the load address appropriately...
Paradyn [Fri, 21 Feb 2014 20:28:11 +0000 (14:28 -0600)]
Handle Windows' need to process .reloc and adjust the load address appropriately to handle ASLR-enabled binaries.

7 years agoMassive simplifications to RTlib initialization process: run it once and only once...
Paradyn [Fri, 21 Feb 2014 20:27:27 +0000 (14:27 -0600)]
Massive simplifications to RTlib initialization process: run it once and only once via the library's on-load code, and adjust anything we need to by setting variables later.

7 years agoUpdate to use boost mutexes and condition variables
Paradyn [Fri, 21 Feb 2014 20:26:01 +0000 (14:26 -0600)]
Update to use boost mutexes and condition variables

7 years agoBump versions everywhere to 8.2.0
Josh Stone [Fri, 14 Feb 2014 00:48:02 +0000 (16:48 -0800)]
Bump versions everywhere to 8.2.0

This is not to imply that 8.2.0 is finished or frozen yet, but it's still
useful to indicate that development is beyond the 8.1 branch.

Also declare DYNINST_8_1_2 and SW_VERSION_8_1_2 for consistency with the
v8.1.2 tag, which was not directly merged into the master branch.

7 years agocmake: set flags for RELWITHDEBINFO
Josh Stone [Fri, 14 Feb 2014 00:29:27 +0000 (16:29 -0800)]
cmake: set flags for RELWITHDEBINFO

This should match the usual cmake target RelWithDebInfo, sans "UG".

7 years agoMerge branch 'master' of git.dyninst.org:/pub/dyninst
Matthew LeGendre [Thu, 13 Feb 2014 20:03:52 +0000 (12:03 -0800)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst

7 years agoFix Dyninst/ProcControlAPI hang when running iRPCs in multi-process environments.
Matthew LeGendre [Thu, 13 Feb 2014 20:00:35 +0000 (12:00 -0800)]
Fix Dyninst/ProcControlAPI hang when running iRPCs in multi-process environments.

7 years agodyninstAPI: Limit cerr messages to debug mode
Josh Stone [Fri, 7 Feb 2014 02:13:42 +0000 (18:13 -0800)]
dyninstAPI: Limit cerr messages to debug mode

A few places in AddressSpace were writing directly to cerr, when they
ought to save messages for debug-enabled cerr only.

7 years agodyninstAPI: Check for termination after removing tracedSyscalls
Josh Stone [Fri, 7 Feb 2014 02:11:31 +0000 (18:11 -0800)]
dyninstAPI: Check for termination after removing tracedSyscalls

It's possible to get markExited() while handling events for the
tracedSyscalls_->remove* calls, which makes the following pcProc_->detach()
a NULL dereference.  Simply calling isTerminated() protects this case.

7 years agodyninstAPI: Continue after loadLibrary
Josh Stone [Fri, 7 Feb 2014 02:07:27 +0000 (18:07 -0800)]
dyninstAPI: Continue after loadLibrary

If BPatch_process::loadLibrary() had to stop the process at its start,
then it should also continue execution before returning.  This was changed
in commit 3faa4175c8100, a large commit with no explanation for this
particular change, possibly an accident.

7 years agoUse const string& parameters for stats
Josh Stone [Tue, 28 Jan 2014 02:19:50 +0000 (18:19 -0800)]
Use const string& parameters for stats

The stats functions don't need mutable parameters, so a const& suffices
just fine.  Also convert all the fixed string names of counters and
timers from string literals to std::string in dyninstAPI and parseAPI.

Even when stats were disabled, there was a fair amount of time spent
just preparing the string object for stats calls.  The optimization of
this patch shows 5-10% reduction in parse time on large binaries.

7 years agoIncrease Instruction::raw_insn_T.small_insn size
Josh Stone [Tue, 28 Jan 2014 01:59:43 +0000 (17:59 -0800)]
Increase Instruction::raw_insn_T.small_insn size

By making this union .small_insn a uintptr_t, so it's the same size as
.large_insn, we can avoid some memory allocation without taking any more
memory in Instruction itself.  (PPC instructions are always 32-bit, so
there it's left as unsigned int.)

With this optimization on x86_64, the number of large_insn allocations
required is greatly reduced.  Many instructions are more than 4 bytes,
but it's less common to have more than 8 bytes.

7 years agocommon: Skip get_immediate_operand without any imm
Josh Stone [Tue, 28 Jan 2014 01:45:32 +0000 (17:45 -0800)]
common: Skip get_immediate_operand without any imm

For x86 image::findMain, we blindly look for the first call from the
entry address, then grab the immediate operand from the preceding
instruction.  Sometimes that instruction may not even have any immediate
operands, and the heuristic fails with a message on stderr like:

  arch-x86.C[5602]:  invalid immediate size 0 in insn

This now occurs with some ET_DYN binaries that are allowed by commit
44205dbd2d90, when those are really DSOs and not PIE.  However, this
could conceivably also happen for any executable that doesn't fit the
heuristic pattern.

This patch quietly returns 0 from get_immediate_operand when there are
no operands, and image::findMain will treat this as an invalid address.

7 years agoMerge branch 'jistone/coverity'
Josh Stone [Wed, 12 Feb 2014 22:07:45 +0000 (14:07 -0800)]
Merge branch 'jistone/coverity'

7 years agoMerge branch 'jistone/platform'
Josh Stone [Wed, 12 Feb 2014 22:05:55 +0000 (14:05 -0800)]
Merge branch 'jistone/platform'


7 years agoMerge branch 'master' of ssh://follis/p/paradyn/development/bill/head/dyninst
Paradyn [Wed, 5 Feb 2014 17:19:02 +0000 (11:19 -0600)]
Merge branch 'master' of ssh://follis/p/paradyn/development/bill/head/dyninst

7 years agoMerge branch 'ssj_boost_mutex' of ssh://git.dyninst.org/pub/dyninst
Bill Williams [Wed, 5 Feb 2014 17:17:38 +0000 (11:17 -0600)]
Merge branch 'ssj_boost_mutex' of ssh://git.dyninst.org/pub/dyninst


7 years agoMore windows fixes
Paradyn [Tue, 4 Feb 2014 20:10:12 +0000 (14:10 -0600)]
More windows fixes

7 years agoMore windows fixes
Paradyn [Tue, 4 Feb 2014 20:10:12 +0000 (14:10 -0600)]
More windows fixes

7 years agoMerge branch 'master' of git.dyninst.org:/pub/dyninst
Matthew LeGendre [Tue, 4 Feb 2014 18:52:32 +0000 (10:52 -0800)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst

7 years agoRemove prints that were triggering when disassembling libraries under findMain
Matthew LeGendre [Tue, 4 Feb 2014 00:56:12 +0000 (16:56 -0800)]
Remove prints that were triggering when disassembling libraries under findMain

7 years agoAllow Linux to build while implementing memory usage interface
Matthew LeGendre [Mon, 3 Feb 2014 23:15:24 +0000 (15:15 -0800)]
Allow Linux to build while implementing memory usage interface

7 years agoMerge branch 'master' of git.dyninst.org:/pub/dyninst
Matthew LeGendre [Mon, 3 Feb 2014 23:10:30 +0000 (15:10 -0800)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst

7 years agoFix issue with dwarf range offsets being used with incorrect base addresses.
Matthew LeGendre [Mon, 3 Feb 2014 23:09:59 +0000 (15:09 -0800)]
Fix issue with dwarf range offsets being used with incorrect base addresses.

7 years agoMoved r_debug assert to the Linux runDYNINSTBaseInit()
Emily Jacobson [Mon, 3 Feb 2014 21:53:04 +0000 (15:53 -0600)]
Moved r_debug assert to the Linux runDYNINSTBaseInit()

7 years agoInstall public dataflowAPI headers
Emily Jacobson [Thu, 30 Jan 2014 17:54:30 +0000 (11:54 -0600)]
Install public dataflowAPI headers

7 years agoFix accumulate() in alias.isAlias case to record transfer func
Emily Jacobson [Thu, 30 Jan 2014 17:45:40 +0000 (11:45 -0600)]
Fix accumulate() in alias.isAlias case to record transfer func
whose target is the current target (rather than alias.target).

7 years agoHandle cyclic dependencies in fixpoint algorithm in stackanalysis
Emily Jacobson [Thu, 30 Jan 2014 17:43:06 +0000 (11:43 -0600)]
Handle cyclic dependencies in fixpoint algorithm in stackanalysis

7 years agoMerge branch 'master' of git.dyninst.org:/pub/dyninst
Matthew LeGendre [Mon, 27 Jan 2014 18:45:41 +0000 (10:45 -0800)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst


7 years agoUpdated parseAPI documentation PDF (missed in previous commit)
Emily Jacobson [Mon, 27 Jan 2014 16:36:42 +0000 (10:36 -0600)]
Updated parseAPI documentation PDF (missed in previous commit)

7 years agoFixed SymtabAPI documentation example 3 to use current API
Emily Jacobson [Mon, 27 Jan 2014 16:35:26 +0000 (10:35 -0600)]
Fixed SymtabAPI documentation example 3 to use current API

7 years agoExport r_debug from the RTlib on Linux and
Emily Jacobson [Wed, 22 Jan 2014 19:10:39 +0000 (13:10 -0600)]
Export r_debug from the RTlib on Linux and
verify that it's properly present before trying to use.

7 years agodyninstAPI: Fix a debug vsnprintf length
Josh Stone [Tue, 21 Jan 2014 02:17:27 +0000 (18:17 -0800)]
dyninstAPI: Fix a debug vsnprintf length

The vsnprintf call is writing to an offset in the fixed errbuf, so it
needs to subtract that offset from the length told to vsnprintf.

Reported by coverity as OVERRUN.

7 years agodyninstAPI: Pad the fixed x86 instructions
Josh Stone [Tue, 21 Jan 2014 02:15:24 +0000 (18:15 -0800)]
dyninstAPI: Pad the fixed x86 instructions

The arrays used to generate illegal & trap instructions can be static
const, but still the analyzer doesn't see that the instruction decoder
won't actually read past their ends.  It's not a big deal to just pad
both illegalRep[] and trapRep[] to 8 bytes to be sure.

Reported by coverity as OVERRUN.

7 years agosymtabAPI: Initialize locals in read_except_table_gcc2
Josh Stone [Tue, 21 Jan 2014 01:35:10 +0000 (17:35 -0800)]
symtabAPI: Initialize locals in read_except_table_gcc2

These can't actually be unset unless the address size was something other
than 4 or 8, but the static analyzer doesn't know that invariant.

Reported by coverity as UNINIT.

7 years agosymtabAPI: Error out on unknown createRelocationSections
Josh Stone [Tue, 21 Jan 2014 01:33:25 +0000 (17:33 -0800)]
symtabAPI: Error out on unknown createRelocationSections

It shouldn't happen, but to the static analyzer it looks like an odd
relocation combination in createRelocationSections will lead to using
unset local variables.  Add a quick check to make sure we got something.

Reported by coverity as UNINIT.

7 years agostackwalk: Fix result logic in getInitialFrameImpl
Josh Stone [Tue, 21 Jan 2014 01:30:33 +0000 (17:30 -0800)]
stackwalk: Fix result logic in getInitialFrameImpl

The former "result = !result || getRegValue(...)" ends up toggling any
failed states.  A "result = result && ..." instead maintains failure.

Reported by coverity as UNINIT.

7 years agoinstructionAPI: Don't try to delete in Instruction copy ctor
Josh Stone [Tue, 21 Jan 2014 01:26:53 +0000 (17:26 -0800)]
instructionAPI: Don't try to delete in Instruction copy ctor

The Instruction copy constructor was trying to check the previous m_size
and delete previous m_RawInsn before copying, but there isn't any previous
state because this is a new object.

Reported by coverity as UNINIT.

7 years agodyninstAPI: Check the bounds of boundsArray
Josh Stone [Tue, 21 Jan 2014 01:24:52 +0000 (17:24 -0800)]
dyninstAPI: Check the bounds of boundsArray

When merging contiguous ranges of boundsArray, the code failed to make
sure that the array has anything in it yet.

Reported by coverity as UNINIT.

7 years agodyninstAPI: Make sure dominator nullNode always looks initialized
Josh Stone [Tue, 21 Jan 2014 01:21:52 +0000 (17:21 -0800)]
dyninstAPI: Make sure dominator nullNode always looks initialized

There's a mutual dependency between dominatorCFG and dominatorBB in how
nullNode is initialized.  To the analyzer, it looks like the uninitialized
pointer is used in BB, even though CFG straightens it out immediately.
Letting nullNode start NULL clears up the confusion.

Reported by coverity as UNINIT.

7 years agocommon: Initialize SymReader structs to zero
Josh Stone [Tue, 21 Jan 2014 01:18:29 +0000 (17:18 -0800)]
common: Initialize SymReader structs to zero

Reported by coverity as UNINIT at various use sites.

7 years agosymtabAPI: Fix coverity UNINIT_CTOR errors
Josh Stone [Mon, 20 Jan 2014 23:23:43 +0000 (15:23 -0800)]
symtabAPI: Fix coverity UNINIT_CTOR errors

7 years agopatchAPI: Fix coverity UNINIT_CTOR errors
Josh Stone [Mon, 20 Jan 2014 23:23:24 +0000 (15:23 -0800)]
patchAPI: Fix coverity UNINIT_CTOR errors

7 years agodyninstAPI: Fix coverity UNINIT_CTOR errors
Josh Stone [Mon, 20 Jan 2014 23:21:57 +0000 (15:21 -0800)]
dyninstAPI: Fix coverity UNINIT_CTOR errors

7 years agodyninstAPI: Remove mapped_object::getModulePart()
Josh Stone [Fri, 17 Jan 2014 22:11:38 +0000 (14:11 -0800)]
dyninstAPI: Remove mapped_object::getModulePart()

The last in-tree caller was removed in commit f2869360c0f0, over 16
years ago, when it was shared_object.  Since mapped_object is now an
internal class, it should be perfectly safe to remove this.

This function was flagged by cppcheck for mismatched allocation, using
delete on strdup memory.

7 years agoClean up bad merge
Bill Williams [Fri, 17 Jan 2014 22:12:31 +0000 (16:12 -0600)]
Clean up bad merge

7 years agoCMake 2.6 compatibility fixes.
Bill Williams [Wed, 15 Jan 2014 19:51:31 +0000 (13:51 -0600)]
CMake 2.6 compatibility fixes.

More messages during build

7 years agoWarning cleanup
Bill Williams [Wed, 15 Jan 2014 19:51:15 +0000 (13:51 -0600)]
Warning cleanup

7 years agoMerge branch 'findMain'
Josh Stone [Fri, 17 Jan 2014 02:44:54 +0000 (18:44 -0800)]
Merge branch 'findMain'