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++.
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.
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.
Josh Stone [Tue, 22 Apr 2014 22:05:03 +0000 (15:05 -0700)]
Merge remote-tracking branch 'origin/master' into v8.2
Conflicts:
cmake/optimization.cmake
dyninstAPI/src/BPatch_process.C
Emily Jacobson [Fri, 7 Feb 2014 17:48:25 +0000 (11:48 -0600)]
Update handleAddSub to properly handle signed ints
Emily Jacobson [Thu, 6 Feb 2014 21:57:50 +0000 (15:57 -0600)]
decodeImmediate: for 64-bit operands, all immediates are sign-extended
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.
Emily Jacobson [Tue, 28 Jan 2014 16:56:42 +0000 (10:56 -0600)]
Updated RelocBlock::determineSpringboards to filter tailcalls in addition to regular calls
Emily Jacobson [Mon, 27 Jan 2014 17:55:36 +0000 (11:55 -0600)]
Cleanup unused functions in the SpringboardBuilder class
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.
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.)
Paradyn [Wed, 16 Apr 2014 18:11:00 +0000 (13:11 -0500)]
Make type checking less aggressive--no type info != void
Paradyn [Thu, 10 Apr 2014 18:19:27 +0000 (13:19 -0500)]
Windows fixes & debug log cleanup
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
Bill Williams [Wed, 2 Apr 2014 15:48:35 +0000 (10:48 -0500)]
Fix some warning spam
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
Bill Williams [Fri, 28 Mar 2014 21:38:50 +0000 (16:38 -0500)]
One more debug statement
Bill Williams [Fri, 28 Mar 2014 21:01:45 +0000 (16:01 -0500)]
More debugging output changes
Bill Williams [Fri, 28 Mar 2014 20:23:00 +0000 (15:23 -0500)]
Debug tracing for the loadlibrary infmalloc
Bill Williams [Fri, 28 Mar 2014 19:42:02 +0000 (14:42 -0500)]
Debug output, don't push this
Bill Williams [Thu, 20 Mar 2014 18:28:11 +0000 (13:28 -0500)]
Test whether boost 1.40 on Ubuntu 10 works cleanly now
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.
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.
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
Matthew LeGendre [Wed, 9 Apr 2014 23:14:14 +0000 (16:14 -0700)]
Fix BGQ compilation errors with new Boost based mutex/condvar system
Matthew LeGendre [Fri, 4 Apr 2014 22:23:41 +0000 (15:23 -0700)]
Fix problem with storing pretty names for inlined subroutines
Bill Williams [Mon, 17 Mar 2014 19:42:01 +0000 (14:42 -0500)]
Default to Boost_NO_BOOST_CMAKE because of boost bugs
Bill Williams [Mon, 10 Mar 2014 20:52:11 +0000 (15:52 -0500)]
Force boost >= 1.41.0
Bill Williams [Mon, 10 Mar 2014 19:26:20 +0000 (14:26 -0500)]
Add link dependency on Elf_X since we actually use it
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
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
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
Bill Williams [Fri, 28 Feb 2014 21:15:48 +0000 (15:15 -0600)]
Thread library doesn't always work, but libraries should now
Bill Williams [Thu, 27 Feb 2014 20:58:42 +0000 (14:58 -0600)]
Allow us to link against boost shared libraries
Matthew LeGendre [Mon, 10 Mar 2014 17:29:57 +0000 (10:29 -0700)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst
Matthew LeGendre [Mon, 10 Mar 2014 17:23:08 +0000 (10:23 -0700)]
Pass any custom lib and include install locations to RT library
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.
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.
Bill Williams [Fri, 28 Feb 2014 15:54:29 +0000 (09:54 -0600)]
Build fixes for Linux
Paradyn [Tue, 25 Feb 2014 19:40:15 +0000 (13:40 -0600)]
Clean up some missed exports & uninitialized variables.
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.
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.
Paradyn [Fri, 21 Feb 2014 20:26:01 +0000 (14:26 -0600)]
Update to use boost mutexes and condition variables
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.
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".
Matthew LeGendre [Thu, 13 Feb 2014 20:03:52 +0000 (12:03 -0800)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst
Matthew LeGendre [Thu, 13 Feb 2014 20:00:35 +0000 (12:00 -0800)]
Fix Dyninst/ProcControlAPI hang when running iRPCs in multi-process environments.
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.
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.
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.
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.
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.
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.
Josh Stone [Wed, 12 Feb 2014 22:07:45 +0000 (14:07 -0800)]
Merge branch 'jistone/coverity'
Josh Stone [Wed, 12 Feb 2014 22:05:55 +0000 (14:05 -0800)]
Merge branch 'jistone/platform'
Conflicts:
stackwalk/src/aix-swk.C
symtabAPI/doc/3-Examples.tex
Paradyn [Wed, 5 Feb 2014 17:19:02 +0000 (11:19 -0600)]
Merge branch 'master' of ssh://follis/p/paradyn/development/bill/head/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
Conflicts:
common/src/dthread-unix.C
Paradyn [Tue, 4 Feb 2014 20:10:12 +0000 (14:10 -0600)]
More windows fixes
Paradyn [Tue, 4 Feb 2014 20:10:12 +0000 (14:10 -0600)]
More windows fixes
Matthew LeGendre [Tue, 4 Feb 2014 18:52:32 +0000 (10:52 -0800)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst
Matthew LeGendre [Tue, 4 Feb 2014 00:56:12 +0000 (16:56 -0800)]
Remove prints that were triggering when disassembling libraries under findMain
Matthew LeGendre [Mon, 3 Feb 2014 23:15:24 +0000 (15:15 -0800)]
Allow Linux to build while implementing memory usage interface
Matthew LeGendre [Mon, 3 Feb 2014 23:10:30 +0000 (15:10 -0800)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst
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.
Emily Jacobson [Mon, 3 Feb 2014 21:53:04 +0000 (15:53 -0600)]
Moved r_debug assert to the Linux runDYNINSTBaseInit()
Emily Jacobson [Thu, 30 Jan 2014 17:54:30 +0000 (11:54 -0600)]
Install public dataflowAPI headers
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).
Emily Jacobson [Thu, 30 Jan 2014 17:43:06 +0000 (11:43 -0600)]
Handle cyclic dependencies in fixpoint algorithm in stackanalysis
Matthew LeGendre [Mon, 27 Jan 2014 18:45:41 +0000 (10:45 -0800)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst
Conflicts:
CMakeLists.txt
Emily Jacobson [Mon, 27 Jan 2014 16:36:42 +0000 (10:36 -0600)]
Updated parseAPI documentation PDF (missed in previous commit)
Emily Jacobson [Mon, 27 Jan 2014 16:35:26 +0000 (10:35 -0600)]
Fixed SymtabAPI documentation example 3 to use current API
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Josh Stone [Mon, 20 Jan 2014 23:23:43 +0000 (15:23 -0800)]
symtabAPI: Fix coverity UNINIT_CTOR errors
Josh Stone [Mon, 20 Jan 2014 23:23:24 +0000 (15:23 -0800)]
patchAPI: Fix coverity UNINIT_CTOR errors
Josh Stone [Mon, 20 Jan 2014 23:21:57 +0000 (15:21 -0800)]
dyninstAPI: Fix coverity UNINIT_CTOR errors
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.
Bill Williams [Fri, 17 Jan 2014 22:12:31 +0000 (16:12 -0600)]
Clean up bad merge
Bill Williams [Wed, 15 Jan 2014 19:51:31 +0000 (13:51 -0600)]
CMake 2.6 compatibility fixes.
More messages during build
Bill Williams [Wed, 15 Jan 2014 19:51:15 +0000 (13:51 -0600)]
Warning cleanup
Josh Stone [Fri, 17 Jan 2014 02:44:54 +0000 (18:44 -0800)]
Merge branch 'findMain'
Josh Stone [Thu, 16 Jan 2014 22:15:38 +0000 (14:15 -0800)]
Remove remnant .cvsignore files
Emily Jacobson [Thu, 16 Jan 2014 20:06:12 +0000 (14:06 -0600)]
isTailcall fix: fallthroughs are not tailcalls
Josh Stone [Thu, 16 Jan 2014 20:29:50 +0000 (12:29 -0800)]
Remove HP/UX remnant
Josh Stone [Thu, 16 Jan 2014 20:22:48 +0000 (12:22 -0800)]
Remove remnants of IA64
Josh Stone [Thu, 16 Jan 2014 19:56:05 +0000 (11:56 -0800)]
common: Note FreeBSD in Types.h
Josh Stone [Thu, 16 Jan 2014 19:54:18 +0000 (11:54 -0800)]
Purge AIX support
Josh Stone [Thu, 16 Jan 2014 18:18:40 +0000 (10:18 -0800)]
Remove remnants of Sparc and Solaris
Josh Stone [Thu, 16 Jan 2014 02:39:48 +0000 (18:39 -0800)]
Remove remnants of Alpha and OSF
Josh Stone [Thu, 16 Jan 2014 02:10:45 +0000 (18:10 -0800)]
Remove remnants of MIPS, including IRIX and WinCE
Josh Stone [Wed, 15 Jan 2014 19:20:32 +0000 (11:20 -0800)]
dyninstAPI: Set image::findMain's findings as LOCAL/INTERNAL
When we look for new symbols in image::findMain, it's not really the
intent to make these global/exported symbols. It doesn't matter so much
for live processes, but these shouldn't be exported in rewritten
binaries. This patch sets them as LOCAL and INTERNAL instead.
Note, this is only for Linux and FreeBSD, but Windows may want it too.
Matthew LeGendre [Wed, 15 Jan 2014 00:10:57 +0000 (16:10 -0800)]
Merge branch 'master' of git.dyninst.org:/pub/dyninst
Conflicts:
CMakeLists.txt