6 years agoppc fixes
William Williams [Fri, 13 Jun 2014 20:07:59 +0000 (13:07 -0700)]
ppc fixes

6 years agoGet pre-exit events via proccontrol callback.
Bill Williams [Wed, 11 Jun 2014 18:17:17 +0000 (13:17 -0500)]
Get pre-exit events via proccontrol callback.
Always report pre-exit events as normal exit, as we have an exit code and our best chance at a manipulable process then.
Decode exit code with ptrace's event message on pre-exit.

6 years agoDwarf FrameParsers are not uniquely determined by a DwarfHandle; there may be multipl...
Bill Williams [Wed, 11 Jun 2014 18:14:04 +0000 (13:14 -0500)]
Dwarf FrameParsers are not uniquely determined by a DwarfHandle; there may be multiple architectures present. Use the right one.

6 years agoBug fix for 32/64 operand sizes.
Bill Williams [Wed, 28 May 2014 20:19:16 +0000 (15:19 -0500)]
Bug fix for 32/64 operand sizes.

6 years agoFix crash bug: we need to finalize when we ask for num_blocks.
Bill Williams [Wed, 28 May 2014 20:18:51 +0000 (15:18 -0500)]
Fix crash bug: we need to finalize when we ask for num_blocks.

6 years agoPass size through into generateOptimizedAssignment and don't generate a 32-bit move...
Bill Williams [Mon, 19 May 2014 20:20:22 +0000 (15:20 -0500)]
Pass size through into generateOptimizedAssignment and don't generate a 32-bit move for a 64-bit assignment.

6 years agoWhitespace cleanup
Bill Williams [Fri, 9 May 2014 19:03:11 +0000 (14:03 -0500)]
Whitespace cleanup

6 years agoRemove ParseAPI's per-function vector of blocks, replacing it with a range of iterato...
Bill Williams [Fri, 9 May 2014 19:03:03 +0000 (14:03 -0500)]
Remove ParseAPI's per-function vector of blocks, replacing it with a range of iterators over the values of the addr->block map.

6 years agoDwarf parsing fix
Bill Williams [Fri, 9 May 2014 19:01:08 +0000 (14:01 -0500)]
Dwarf parsing fix

6 years agoDynC build fix
Bill Williams [Fri, 9 May 2014 19:00:53 +0000 (14:00 -0500)]
DynC build fix

6 years agoSyscall events cleanup
Bill Williams [Fri, 9 May 2014 19:00:40 +0000 (14:00 -0500)]
Syscall events cleanup

6 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).

6 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.

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

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

6 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

6 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

6 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.

6 years agoChange Symtab::getContainingFunction to use symbols for function lookups rather than...
Matthew LeGendre [Tue, 17 Jun 2014 23:49:43 +0000 (16:49 -0700)]
Change Symtab::getContainingFunction to use symbols for function lookups rather than DWARF ranges, which gives a significant memory/time savings to STAT.

6 years agodyninstAPI_RT: fix export consistency for Windows
Josh Stone [Tue, 3 Jun 2014 22:41:03 +0000 (15:41 -0700)]
dyninstAPI_RT: fix export consistency for Windows

6 years agosymtabAPI: Start dwarf type ids at 1
Josh Stone [Thu, 29 May 2014 01:26:42 +0000 (18:26 -0700)]
symtabAPI: Start dwarf type ids at 1

It turns out test_type_info doesn't like ID 0.

6 years agosymtabAPI: Use dyn_hash_map for type IDs, and split on is_info
Josh Stone [Thu, 29 May 2014 01:02:59 +0000 (18:02 -0700)]
symtabAPI: Use dyn_hash_map for type IDs, and split on is_info

A hash map affords faster lookup, especially for such simple keys.

Splitting into two maps, rather than using pair<offset,bool> as before,
also makes an easier key lookup and more optimized storage.

6 years agosymtabAPI: Protect against GNU alt forms
Josh Stone [Thu, 29 May 2014 00:29:41 +0000 (17:29 -0700)]
symtabAPI: Protect against GNU alt forms

Both DW_FORM_GNU_ref_alt and DW_FORM_GNU_strp_alt refer to an alternate
file, specified in .gnu_debugaltlink, which neither libdwarf or symtabAPI
currently understand.  We can at least recognize and skip past them though.

If we encounter a dwarf_diename() with an unhandled form, we now treat that
as if there weren't a name at all.  If we encounter a reference that's not
a normal offset, as with ref_alt, then this is now treated as a quiet
error, noted only in dwarf_printf.

6 years agosymtabAPI: walk partial units too
Josh Stone [Thu, 29 May 2014 00:22:54 +0000 (17:22 -0700)]
symtabAPI: walk partial units too

6 years agosymtabAPI: sanity-check line ranges
Josh Stone [Wed, 28 May 2014 22:20:22 +0000 (15:20 -0700)]
symtabAPI: sanity-check line ranges

Valgrind reported an invalid memory access in getLineInformation, which
turned out to be an index past the end of the srcFiles() vector.  Add a
sanity check to abort bad values.

6 years agosymtabAPI: Return a string from Object::getFileName
Josh Stone [Wed, 28 May 2014 19:34:12 +0000 (12:34 -0700)]
symtabAPI: Return a string from Object::getFileName

In Object-elf.C, getFileName was returning mf->filename().c_str(), which
is a use-after-free since mf->filename() is a temporary string.  Change
it to return the string instead, so it has a proper lifetime.

(Found via valgrind memcheck)

6 years agosymtabAPI: Automate context push/pop in DwarfWalker
Josh Stone [Wed, 28 May 2014 19:28:42 +0000 (12:28 -0700)]
symtabAPI: Automate context push/pop in DwarfWalker

In DwarfWalker::parse_int, there are many exit points between context push
and pop, especially for errors.  If the pop is missed, then the whole stack
may get into a bad state.  This patch adds a ContextGuard which manages the
push and pop via object lifetime, so all exit paths will be covered.

6 years agosymtabAPI: improve sig8 identification
Josh Stone [Wed, 28 May 2014 19:15:49 +0000 (12:15 -0700)]
symtabAPI: improve sig8 identification

- Give type units a module name based on the signature.
- Declare type units in dwarf_printf while walking.

6 years agosymtabAPI: Enable DW_FORM_ref_sig8
Josh Stone [Wed, 28 May 2014 00:57:43 +0000 (17:57 -0700)]
symtabAPI: Enable DW_FORM_ref_sig8

DwarfWalker first scans for DW_TAG_type_unit and allocates a type ID for
each signature, so that later DW_FORM_ref_sig8 can look it up later.
When the actual type die is walked, its offset will map to the same ID.

6 years agosymtabAPI: Walk both .debug_types and .debug_info
Josh Stone [Tue, 27 May 2014 23:06:26 +0000 (16:06 -0700)]
symtabAPI: Walk both .debug_types and .debug_info

6 years agosymtabAPI: Add indirection between dwarf offsets and type IDs
Josh Stone [Tue, 27 May 2014 22:22:36 +0000 (15:22 -0700)]
symtabAPI: Add indirection between dwarf offsets and type IDs

The identity mapping between dwarf offsets and int type IDs is
problematic because offsets are actually 64-bit, so they may overflow an
int on 2GB+ files.  Offsets are also relative to their section, which
can be either .debug_info or .debug_types, so that overlap also needs to
be avoided.

The new DwarfWalker::type_ids_ maps between a pair offset,is_info to
typeId_t values incremented on demand.

6 years agosymtabAPI: Remove unused dwarf enclosureMap
Josh Stone [Tue, 27 May 2014 22:06:56 +0000 (15:06 -0700)]
symtabAPI: Remove unused dwarf enclosureMap

6 years agosymtabAPI: Extend recognized DW_LANG constants
Josh Stone [Fri, 23 May 2014 23:32:07 +0000 (16:32 -0700)]
symtabAPI: Extend recognized DW_LANG constants

DW_LANG_C99 has existed since DWARF3, with support in libdwarf too.
DWARF5 will add constants for C++03, C++11, and C11, and we can prepare
for these now with simple #ifdefs.


6 years agosymtabAPI: Add support for DW_AT_linkage_name
Josh Stone [Fri, 23 May 2014 22:47:00 +0000 (15:47 -0700)]
symtabAPI: Add support for DW_AT_linkage_name

The common DW_AT_MIPS_linkage_name extension was added to DWARF4 as
DW_AT_linkage_name, with the exact same meaning.

6 years agosymtabAPI: Switch to .debug_types-aware libdwarf interfaces
Josh Stone [Fri, 23 May 2014 22:28:17 +0000 (15:28 -0700)]
symtabAPI: Switch to .debug_types-aware libdwarf interfaces

There's an is_info parameter in dwarf_offdie_b, dwarf_siblingof_b, and
dwarf_next_cu_header_c which let's callers specify if the context is
.debug_info or .debug_types.  While symtabAPI only bothers with info at
the moment, changing to these functions will prepare for types later.

These interfaces have been in libdwarf since 20111030, and header_c was
already used in a couple places, so the requirements haven't changed.

6 years agosymtabAPI: Don't hardcode the CU header size
Josh Stone [Fri, 23 May 2014 21:41:19 +0000 (14:41 -0700)]
symtabAPI: Don't hardcode the CU header size

DwarfWalker::compile_offset was being set as 11 bytes before the first
die in a cu, but this isn't always correct. (see DWARF sec 7.4 & 7.5.1)
However, we already have the next_cu_header to tells us the offset of
each following cu in the loop.

6 years agodyninstAPI: Find RT in existing libraries by fileDescriptor
Josh Stone [Thu, 22 May 2014 18:21:03 +0000 (11:21 -0700)]
dyninstAPI: Find RT in existing libraries by fileDescriptor

When PCEventHandler::handleLibrary and PCProcess::setupForkedProcess try
to match the RT library, they do so using fileDescriptors.  However, in
PCProcess::createInitialMappedObjects it compared getAbsoluteName, which
won't match if $DYNINSTAPI_RT_LIB was a symlink to the real binary.

Now createInitialMappedObjects uses a fileDescriptor comparison too.

Reported-by: Francis Deslauriers <fdeslaur@gmail.com>
Signed-off-by: Josh Stone <jistone@redhat.com>
6 years agodyninstAPI_RT: export dyn_sigaction and dyn_signal too
Josh Stone [Wed, 21 May 2014 23:29:50 +0000 (16:29 -0700)]
dyninstAPI_RT: export dyn_sigaction and dyn_signal too

6 years agodyninstAPI_RT: export more symbols to be found by dyninstAPI
Josh Stone [Wed, 21 May 2014 19:02:59 +0000 (12:02 -0700)]
dyninstAPI_RT: export more symbols to be found by dyninstAPI

With -fvisibility=hidden and rpm stripping, some of the symbols in
dyninstAPI_RT can't be found.  This patch adds DLLEXPORT to every name
in the unstripped symbol table which is referenced by string "name" in
libdyninstAPI.so, hopefully allowing all necessary dynamic lookups.

6 years agoExport operator<< for Dyninst::StackAnalysis::Height
Josh Stone [Mon, 19 May 2014 23:47:22 +0000 (16:47 -0700)]
Export operator<< for Dyninst::StackAnalysis::Height

6 years agoproccontrol: Avoid a destructor race on Counter::locks
Josh Stone [Fri, 16 May 2014 22:57:00 +0000 (15:57 -0700)]
proccontrol: Avoid a destructor race on Counter::locks

Previously, if process.C ran its destructors before generator.C, then
Counter::locks would be destroyed before int_cleanup.  The latter is
responsible for ending the handler thread, which may still be trying to
adjust locks.  Boost's mutex throws an exception if you try to acquire a
destroyed lock, which kills the whole process uncleanly.

Now the locks are created as a new[] pointer, and are simply leaked when
the process ends, no real harm done.

6 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.

6 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.

6 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.

6 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.

6 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++.

6 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.

6 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.

6 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


6 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

6 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

6 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.

6 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

6 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

6 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.

6 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.)

6 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

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

6 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

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

6 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

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

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

6 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

6 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

6 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

6 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.

6 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.

6 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

6 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

6 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

6 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

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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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.

6 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.

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

6 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.

6 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.

6 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.

6 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

6 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.

6 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".

6 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

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

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

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