2 years agoMerge pull request #599 from dyninst/bump_version_number v10.1.0
Xiaozhu Meng [Thu, 16 May 2019 18:40:05 +0000 (13:40 -0500)]
Merge pull request #599 from dyninst/bump_version_number

Update version number to 10.1.0

2 years agoFix broken link in README 599/head
Tim [Wed, 15 May 2019 22:18:16 +0000 (17:18 -0500)]
Fix broken link in README

2 years agoAdd example usage of CMAKE_INSTALL_PREFIX
Tim [Wed, 15 May 2019 22:17:56 +0000 (17:17 -0500)]
Add example usage of CMAKE_INSTALL_PREFIX

2 years agoFix formatting in README
Tim [Wed, 15 May 2019 22:17:41 +0000 (17:17 -0500)]
Fix formatting in README

2 years agoFix doc bugs in LibIberty
Tim [Wed, 15 May 2019 21:45:28 +0000 (16:45 -0500)]
Fix doc bugs in LibIberty

2 years agoFix doc bug in Boost.cmake
Tim [Wed, 15 May 2019 21:23:00 +0000 (16:23 -0500)]
Fix doc bug in Boost.cmake

2 years agoMove advanced build instructions and FAQ to wiki
Tim [Wed, 15 May 2019 21:22:42 +0000 (16:22 -0500)]
Move advanced build instructions and FAQ to wiki

2 years agoUpdate CHANGELOD for 10.1
Xiaozhu Meng [Wed, 15 May 2019 21:29:25 +0000 (16:29 -0500)]
Update CHANGELOD for 10.1

2 years agoUpdate version number to 10.1.0
Xiaozhu Meng [Fri, 10 May 2019 18:58:34 +0000 (13:58 -0500)]
Update version number to 10.1.0

2 years agoTBB spack fixes (#595)
Tim Haines [Wed, 15 May 2019 20:01:03 +0000 (15:01 -0500)]
TBB spack fixes (#595)

* Fix typos and formatting in TBB CMake files
* Set minimum version of TBB to 2018.6
    This is what the Spack package is using.
* Set the source version of TBB to 2019.5
    This is the most recent version.
* In TBB, split the dotted-decimal version to make the download version
* Correctly handle minor version in FindTBB

2 years agoUpdate LibIberty to new build system (#601)
Tim Haines [Wed, 15 May 2019 20:00:32 +0000 (15:00 -0500)]
Update LibIberty to new build system (#601)

* Update LibIberty to new build system
* Include LibIberty from base CMakeLists.txt
* Correctly use USE_GNU_DEMANGLER in cap_arch_def
* Remove USE_GNU_DEMANGER from options.cmake
     This is now handled in cmake/LibIberty.cmake.

2 years agoMerge pull request #596 from dyninst/fix-sw-stepper
Xiaozhu Meng [Tue, 14 May 2019 19:10:02 +0000 (14:10 -0500)]
Merge pull request #596 from dyninst/fix-sw-stepper

Fix DwarfFrameParser, decodeDwarfExpression and DwarfResult

2 years agoMerge pull request #600 from dyninst/boost_1_70_fix
Xiaozhu Meng [Mon, 13 May 2019 21:27:35 +0000 (16:27 -0500)]
Merge pull request #600 from dyninst/boost_1_70_fix

Compilation fix for boost 1.70

2 years agoCompilation fix for boost 1.70 600/head
Xiaozhu Meng [Mon, 13 May 2019 18:14:19 +0000 (13:14 -0500)]
Compilation fix for boost 1.70

2 years agoMerge pull request #564 from dyninst/patch_cfg
Xiaozhu Meng [Sun, 12 May 2019 02:18:47 +0000 (21:18 -0500)]
Merge pull request #564 from dyninst/patch_cfg

Fix bad interactions between patchAPI and parseAPI

2 years agoAugment BPatch_effectiveAddressExpr to accept a second parameter, which 564/head
Xiaozhu Meng [Mon, 11 Mar 2019 00:22:37 +0000 (19:22 -0500)]
Augment BPatch_effectiveAddressExpr to accept a second parameter, which
represents the number of bytes to access if reading/writing with this

API compatibility is maintained by setting the default value of the
seoncd parameter to 8 (bytes)

2 years agoRight now, the BPatch_deref and BPatch_regExpr do not specify the size.
Xiaozhu Meng [Wed, 6 Mar 2019 17:19:04 +0000 (11:19 -0600)]
Right now, the BPatch_deref and BPatch_regExpr do not specify the size.
Currently the default is 32-bit. Change the default to 64-bit

2 years agoWhen splitting a block using CFGModifier::split, we need to record the
Xiaozhu Meng [Tue, 5 Mar 2019 15:24:11 +0000 (09:24 -0600)]
When splitting a block using CFGModifier::split, we need to record the
new block in parse_data

2 years agoMerge pull request #592 from dyninst/pp_springboard
Xiaozhu Meng [Sun, 12 May 2019 00:20:42 +0000 (19:20 -0500)]
Merge pull request #592 from dyninst/pp_springboard

More fixes for parallel parsing, spring boards, and ARM

2 years agoDisable incomplete implementation for RA compensation for stack 592/head
Xiaozhu Meng [Sat, 11 May 2019 23:00:57 +0000 (18:00 -0500)]
Disable incomplete implementation for RA compensation for stack

2 years agoBump minimum CMake version to 3.4.0 (#598)
Tim Haines [Fri, 10 May 2019 23:50:10 +0000 (18:50 -0500)]
Bump minimum CMake version to 3.4.0 (#598)

This is needed for FindBoost and is already in the Spack recipe

2 years agoAdd ARM effective address calculation (#594)
Xiaozhu Meng [Fri, 10 May 2019 23:48:59 +0000 (18:48 -0500)]
Add ARM effective address calculation (#594)

2 years agoBPatch_effectiveAddress truncates mem addresses on Power (#593)
Xiaozhu Meng [Fri, 10 May 2019 23:46:59 +0000 (18:46 -0500)]
BPatch_effectiveAddress truncates mem addresses on Power (#593)

In certain circumstances, BPatch_effectiveAddress would generate code that truncated
memory addresses to the bottom 32bits. The result is that instrimentation would see only
the bottom 32bits of any memory address. Before this patch, the issue occurred when instrumentation was applied to load/store instructions where the address was located in registers r3-r11 (exclusive). Ideally this function should just be straight removed in future releases (only used by emitASLoad).

2 years agoFix jump table analysis for ROSE Registers (#576)
Xiaozhu Meng [Fri, 10 May 2019 23:45:27 +0000 (18:45 -0500)]
Fix jump table analysis for ROSE Registers (#576)

Remove assertions in code from translating Dyninst::MachRegister to ROSE Register. In addition, passing the error code back to jump table analysis.

2 years agoUpdate README to reflect new build system (#597)
Tim Haines [Fri, 10 May 2019 17:10:02 +0000 (12:10 -0500)]
Update README to reflect new build system (#597)

2 years agoAdd initial support for decoding AMD FMA4 and XOP instructions (#575)
Xiaozhu Meng [Fri, 10 May 2019 17:09:26 +0000 (12:09 -0500)]
Add initial support for decoding AMD FMA4 and XOP instructions (#575)

* Add initial support for decoding AMD FMA4 instruction, including:

e_vfmaddsd, e_vfmaddss, e_vfmsubpd, e_vfmsubsd, e_vfnmaddpd,

* Add initial support for decoding XOP instructions:

e_vpcomd, e_vpmacsdd, e_vpcmov, e_vpshad

* Add x86 instruction decoding support for vpperm, movbe, vpperm

2 years agoFix DwarfFrameParser, decodeDwarfExpression and DwarfResult 596/head
Sasha @leela [Thu, 9 May 2019 21:19:44 +0000 (16:19 -0500)]
Fix DwarfFrameParser, decodeDwarfExpression and DwarfResult

After porting Dyninst to use libdw, DwarfFrameParser missed dealing
with important Dwarf operations that would decode rules for findind
registers values. These rules were not properly decoded by Dyninst
decodeDwarfExpression, neither were being dealt by DwarFrameParser.
This fix properly retrieves libdw Dwarf operations and decodes them,
making it possible to DebugStepper work, which wasn't even before the
port, when lidwarf was being used on Dyninst 9.3.

Basically, Dwarf frame info can be a simple dwarf expression, representing
a value or a memory address, a location description, or a location list.
Libdw gives the consumer an array of dwarf operations that describes how
to find the value they're looking for, as opposed to libdwarf who gives
the consumer many out parameters that lead to different ways to find a
value. This important change made DwarfFrameParser work only partially
after the port. And this fix came to implement the cases that were not
being considered.

2 years agoFix compilation of thread_db_process (#571)
Sasha Nícolas [Wed, 8 May 2019 23:03:32 +0000 (18:03 -0500)]
Fix compilation of thread_db_process (#571)

On a machine without libthread_db.so, the placeholder class had missing member functions and the contructors were calling wrong base constructors.

2 years agoSupport parsing cubin in dyninst-10.0 (#556)
Keren Zhou [Tue, 7 May 2019 22:22:40 +0000 (17:22 -0500)]
Support parsing cubin in dyninst-10.0 (#556)

2 years agoOnly demangle names starting with "_Z" according to the Itanium C++ ABI
Xiaozhu Meng [Tue, 7 May 2019 19:45:46 +0000 (14:45 -0500)]
Only demangle names starting with "_Z" according to the Itanium C++ ABI

2 years agoIn ProccontrolAPI, adding reading & writing mutatee's memory with procfs.
Xiaozhu Meng [Tue, 7 May 2019 16:43:49 +0000 (11:43 -0500)]
In ProccontrolAPI, adding reading & writing mutatee's memory with procfs.
We fall back to use ptrace if procfs read & write fail.

This change is for fixing icache coherence issue for ARM dynamic instrumentaiton.
ARM architecture does not guarantee icache-dcache coherence. And writes through
ptrace does not seem to invalidate icache contents and caused SIGILLs

2 years agoFixing TBB dependencies during build. (#570)
Sasha Nícolas [Thu, 2 May 2019 21:18:00 +0000 (16:18 -0500)]
Fixing TBB dependencies during build. (#570)

Explicitly establish dependencies on TBB.

2 years agoElfutils cleanup (#591)
Tim Haines [Thu, 2 May 2019 20:54:12 +0000 (15:54 -0500)]
Elfutils cleanup (#591)

fixes #557
fixes #547
fixes #561

- Consolidate all elfutils options into cmake/ElfUtils.cmake
- Allow user to supply installation hint directories
- Allow user to specify minimum version
- Use user-specified minimum version when building from source instead of 'elfutils-latest.tar.gz'
- Unify system paths when searching for libelf and libdw (fixes #557)
- Correctly install headers/libs when building from source (fixes #547)
- Exports variables for use in Testsuite (fixes #561)
- Clean up formatting

2 years agoTBB Cleanup (#584)
Tim Haines [Thu, 2 May 2019 20:52:11 +0000 (15:52 -0500)]
TBB Cleanup (#584)

- Remove FindTBB submodule
- Consolidate all TBB stuff into cmake/ThreadingBuildingBlocks.cmake
- Explicitly die on non-UNIX platforms when building from source (previously, it did nothing)
- Minimum TBB version is 2018.0 (I'm not sure this is necessary or sufficient)
- Export include/library directories into the CMake cache for consumption by Testsuite
- Libraries and headers are exported to CMAKE_INSTALL_PREFIX when building from source
- Correctly handles broken TBB install (intel/tbb#98)
- Explicitly die on non-UNIX platforms when building from source (previously, it did nothing)
- Minimum TBB version is 2018.0 (I'm not sure this is necessary or sufficient)
- Export include/library directories into the CMake cache for consumption by Testsuite
- Default version to build from source is 2019_U5
- Libraries and headers are exported to CMAKE_INSTALL_PREFIX when building from source
- Correctly handles broken TBB install (intel/tbb#98)

2 years agoBoost cleanup (#578)
Tim Haines [Thu, 2 May 2019 20:49:01 +0000 (15:49 -0500)]
Boost cleanup (#578)

Substantially changes how we handle Boost builds in Dyninst.

Fixes #563

- Tagged build layouts are now fully supported
- Boost is exported to the same install structure as Dyninst (fixes #563)
- All cmake variables that control Boost's build options are now available for the user to change via cache variables (e.g., -DBoost_USE_MULTITHREADED)
- Substantial error handling has been added
- Consolidates all Boost-related activities into cmake/Boost.cmake
- Makes Boost-1.61 the new minimum version (needed for Filesystem)
- Builds Boost-1.69 when building from source

2 years agosimple working hybrid example of patchAPI (#588)
Ian A Mason [Mon, 29 Apr 2019 22:23:15 +0000 (15:23 -0700)]
simple working hybrid example of patchAPI  (#588)

* simple working hybrid example of patchAPI (using dyninstAPI to create the PatchMgr and PatchObject).

* TLC plus some remarks about running the rewritten program.

2 years agoFix PCWdiget implementation on ARMv8
Xiaozhu Meng [Tue, 23 Apr 2019 21:32:03 +0000 (16:32 -0500)]
Fix PCWdiget implementation on ARMv8

2 years agoMove architecture dependent code in PCWidget.C to three separate architecture specifi...
Xiaozhu Meng [Tue, 23 Apr 2019 19:17:23 +0000 (14:17 -0500)]
Move architecture dependent code in PCWidget.C to three separate architecture specific source files.

2 years agoFor jump table analysis, control flow edges can be created in different orders,
Xiaozhu Meng [Tue, 23 Apr 2019 14:02:39 +0000 (09:02 -0500)]
For jump table analysis, control flow edges can be created in different orders,
which lead to non-deterministic slicing and non-determinisitc jump table analysis.

Therefore, we need to sort source edges in slicing based on the edge's source block
address and edge type to ensure deterministic slicing.

2 years ago1. Replace springboards prioriy "OffLimits" and "Required" with "FuncEntry" and ...
Xiaozhu Meng [Thu, 18 Apr 2019 16:16:06 +0000 (11:16 -0500)]
1. Replace springboards prioriy "OffLimits" and "Required" with "FuncEntry" and "IndirBlockEntry".

Only "FuncEntry" springboards are required because control flow enter instrumentation
through function calls (we relocate the whole function even if only a part of the
function is instrumented).

"IndirBlockEntry" springboards are important for re-directing control flow from
jump tables back to instrumentation. But, it is not as important as "FuncEntry".

2. Jumps to code in another secion should be treated as tail calls.

2 years agoIn dynamic instrumentation, springboards are installed immediately after
Xiaozhu Meng [Sun, 14 Apr 2019 22:00:48 +0000 (17:00 -0500)]
In dynamic instrumentation, springboards are installed immediately after
users insert a snippet. The user can continue to insert more snippets to
the same function, which will trigger Dyninst to perform the additional
relocation. So, we need to overwrite existing springboard for newly added

In other words, we need to overwrite existing springboards if the existing
ones were installed in previous relocations.

2 years agoDelete unnecessary asserts
Xiaozhu Meng [Fri, 12 Apr 2019 21:38:44 +0000 (16:38 -0500)]
Delete unnecessary asserts

2 years agoThe _func_cnt member variable in class ParseAPI::Block should be atomic<int>,
Xiaozhu Meng [Fri, 12 Apr 2019 21:13:42 +0000 (16:13 -0500)]
The _func_cnt member variable in class ParseAPI::Block should be atomic<int>,
rather than just int. A block can be shared by multiple functions. So, when
multiple functions add/remove blocks at the same time, there will be race conditions.

2 years agoFix compilation error introduced during applying patches
Xiaozhu Meng [Fri, 12 Apr 2019 20:33:34 +0000 (15:33 -0500)]
Fix compilation error introduced during applying patches

2 years agoCorrectness fixes for springboard generators
Benjamin Welton [Wed, 13 Feb 2019 23:13:39 +0000 (17:13 -0600)]
Correctness fixes for springboard generators

This patch deals with issues where incorrect springboards could be generated.
Specifically addresses three issues:

1. Springboards trampling function data (addresses github issue #551)

2. Required springboards being spilling over block bounds onto
   other required springboards. Prior a if two required springboards were
   located near each other, there was a chance that one of the springboards
   could be partially overwritten resulting in broken behavior.

3. Unsafe reusage of a codegen object where if a trap was needed,
   both a branch and a trap would be written causing bad behavior.

2 years agoFix finding the trap mapping header in .dyninstInst
Xiaozhu Meng [Thu, 4 Apr 2019 17:55:23 +0000 (12:55 -0500)]
Fix finding the trap mapping header in .dyninstInst

DT_DYNINST entry of the .dynamic section points the memory offset of
the trap mapping header. Should use this information to locate
trap mapping table when adjusting trap mapping entries for PIC code

2 years ago1. If ParseAPI identifies a jump as a tail call, but later find that this jump is...
Xiaozhu Meng [Wed, 3 Apr 2019 23:04:14 +0000 (18:04 -0500)]
1. If ParseAPI identifies a jump as a tail call, but later find that this jump is the only incoming edge of the targXXX function, we should not treat this jump as a tail call.

In theory, it is reasonable either way. However, treating such jump
as a tail call can cause troubles for function entry instrumentation.
If the targXXX function may jump back to the original function, and
thus reach the tail jump. This becomes a recursive tail call.

However, Dyninst relocation seems to have problem adjusting the tail jump
to include entry instrumentation.

2. If the determination of a tail call is changed, we should re-compute
function boundaries, including ret blocks, exit blocks, call edges

2 years agoFix warnings on adjusting trap springboards
Xiaozhu Meng [Tue, 2 Apr 2019 20:27:40 +0000 (15:27 -0500)]
Fix warnings on adjusting trap springboards

2 years agoFix springboard traps for PIC code
Xiaozhu Meng [Tue, 2 Apr 2019 19:00:43 +0000 (14:00 -0500)]
Fix springboard traps for PIC code

2 years agoFix the problem where trap springboards are not written to the mutatee.
Xiaozhu Meng [Mon, 1 Apr 2019 23:36:03 +0000 (18:36 -0500)]
Fix the problem where trap springboards are not written to the mutatee.

2 years agoConvert ThreadDB error message to info message (#574)
Tim Haines [Thu, 28 Mar 2019 21:11:58 +0000 (16:11 -0500)]
Convert ThreadDB error message to info message (#574)

By default, the cmake 'message' command generates an error message. This converts it to an informational message.

2 years agoA few fixes for parallel parsing (#572)
Xiaozhu Meng [Thu, 28 Mar 2019 21:04:40 +0000 (16:04 -0500)]
A few fixes for parallel parsing (#572)

1. Fix a scenario where the delayed work of call ft edges may be skipped
2. Augment indirect jump target check, so that if a jump target is decoded
   to be No_Entry, we treat this jump target invalid
3. Should only re-parse jump tables (not indirect tail calls) for fixed point

On ppple, spring boards may need to be long branch (can be more than 5
instructions). Allocate enough space in codegen for long branch spring boards.

2 years agoShould set errno to zero before calling ptrace (#569)
Xiaozhu Meng [Tue, 26 Mar 2019 17:53:54 +0000 (12:53 -0500)]
Should set errno to zero before calling ptrace (#569)

2 years agoImplement ARMv8 IMFC and Load/Store Shared (#562)
L.E.R [Tue, 12 Mar 2019 17:59:45 +0000 (12:59 -0500)]
Implement ARMv8 IMFC and Load/Store Shared (#562)

* Implement AArch64 InterModule Function call
* fix memory access mistakes, now uses offset mode
* removed all the debug printout for imfc
* add rewriter mode check- delete unwanted functions
* fix break on dynamic mode
* aarch64 broken movePCToReg implementation
* movePCToReg still not working
* fix addressing mode for emitLoadRelative
* LoadShared: snip_ref_shlib_var test passes
* add assert details, remove debug code, and format patch
* inst-aarch64: sprintf -> snprintf, debug comments cleanup
* Minor cleanup- Remove commented-out code and debug print statements.

2 years agoFix ARM stack walking (#559)
Xiaozhu Meng [Tue, 12 Mar 2019 18:43:33 +0000 (13:43 -0500)]
Fix ARM stack walking (#559)

2 years agoFix unnecessary multiple calls to buildSysRegMap.
Sasha @leela [Fri, 15 Feb 2019 01:14:29 +0000 (19:14 -0600)]
Fix unnecessary multiple calls to buildSysRegMap.

This function should be called only once, but was being called for every
instruction to be decoded. As a result, dyninst would take a long time
to execute. Now to simply run test1_1 on create mode takes 28 seconds,
as opposed to 58 before this fix, and now closer to 20 seconds for x86_64.

2 years agoAttempts to fix legacy test failures in Dyninst test suite (#549)
Xiaozhu Meng [Thu, 7 Mar 2019 00:08:22 +0000 (18:08 -0600)]
Attempts to fix legacy test failures in Dyninst test suite (#549)

* In binary rewriting, when Dyninst needs to load a library,
    it does not check whether this library has been loaded before or not.
    Dyninst will create multiple binaryEdit objects for one library, which can cause inconsistent states between these objects.

    This fix adds a map to BPatch_binaryEdit to make sure each library is only loaded once.

* Fix pc_tls failures in dyamically linked binaries.
    The root cause is a broken library name matching code.
    Just should boost:filesystem::path to deal with file paths.

Closes #549

2 years agoFix tests in PIC mode (#553)
Xiaozhu Meng [Thu, 7 Mar 2019 00:06:54 +0000 (18:06 -0600)]
Fix tests in PIC mode (#553)

* In dynamic instrumentation for PIE, finding variables's locations needs to add the load base of the PIE.
    Get rid of wrong, special handling of finding the load base of PIE.
* On x86-64, when emulating call with push & jmp, the push needs to push all 64-bit of the callee addresses.
* A few fixes for PIC instrumentation on power
    1. Fix PC-relative load and store of variables
    2. The preamble of PIE uses R12 to set up R2. However,
    when generating intra-module calls, Dyninst does not
    set up R12 and will call the global entry, causing R2 to
    be incorrect. Since there is no need to change R2 for
    intra-module calls, we should call the local entry
* Fix function call replacment on power for PIC.
    Need to call local entry when doing an intra-module call
* Handle relocation type R_X86_64_REX_GOTPCRELX for binary rewriting of statically linked binaries on x86-64
* Fix endianess issues for generating _init and _fini functions on power

2 years agoElfutil version check (#558)
Tim Haines [Thu, 7 Mar 2019 00:04:05 +0000 (18:04 -0600)]
Elfutil version check (#558)

* Add Ubuntu locations
* Search for libelf.so instead of libelf.so.1
    This makes the likelihood of find a symlink more probable.
* Add version checking
    find_package_handle_standard_args doesn't check versions of shared
    libraries, so we need to do it manually.
* Always make the configuration for elfutils noisy

2 years agoAdd --enable-install-elfh when building elfutils from source (#555)
Tim Haines [Thu, 7 Mar 2019 00:03:38 +0000 (18:03 -0600)]
Add --enable-install-elfh when building elfutils from source (#555)

When building elfutils from source on systems that have old elfutils,
Dyninst couldn't find the correct version of elf.h due to it not
being copied from the elfutils build source directory to the include
directory. In the Feb 15 2019 release of elfutils, this flag was
added to fix this.

2 years agoFix separate debuginfo
Sasha Nicolas [Tue, 12 Feb 2019 23:44:30 +0000 (17:44 -0600)]
Fix separate debuginfo
Adding correct FrameFarser to static map
Parsing modules of correct debug file

2 years agoRevert the change from PR530 that will cause crashes in rewriting
Xiaozhu Meng [Fri, 8 Feb 2019 22:19:37 +0000 (16:19 -0600)]
Revert the change from PR530 that will cause crashes in rewriting
statically linked binaries.

2 years agoMerge pull request #548 from dyninst/dynsym_fix
Xiaozhu Meng [Fri, 8 Feb 2019 21:15:11 +0000 (15:15 -0600)]
Merge pull request #548 from dyninst/dynsym_fix

Do not put newly added functions to .dynsym, which may cause the load

2 years agoRemove undefined behavior from bit-shifting code
Tim Haines [Thu, 7 Feb 2019 22:33:13 +0000 (16:33 -0600)]
Remove undefined behavior from bit-shifting code

PR #536

Overflow of signed integer arithmetic (including shifting) is
undefined behavior in C++. Compilers are allowed to exploit
this UB for optimization purposes up to and including not
emitting any opcodes.

These were found using cppcheck.

2 years agoDo not put newly added functions to .dynsym, which may cause the load 548/head
Xiaozhu Meng [Wed, 6 Feb 2019 22:16:16 +0000 (16:16 -0600)]
Do not put newly added functions to .dynsym, which may cause the load
to behave abnormally due to duplicated symbols.

Note that adding symbols to .dynsym can be a legit use case, where
we expose hidden functions in shared libraries. But this use case
needs more development to support.

2 years agoMerge pull request #543 from dyninst/ppcle_rhel8_fix
Xiaozhu Meng [Wed, 6 Feb 2019 22:07:01 +0000 (16:07 -0600)]
Merge pull request #543 from dyninst/ppcle_rhel8_fix

Ppcle rhel8 fix

2 years agoFix several bugs in common/src/pathName.C
Tim Haines [Tue, 5 Feb 2019 19:31:10 +0000 (13:31 -0600)]
Fix several bugs in common/src/pathName.C

1. Tilde expansion is done _before_ the existence check.
Since `stat` does not do shell expansions, resolve_file_path("~")
    always returned an empty string instead of the expanded path.

2. Tilde detection logic was inverted

3. Remove possible buffer overflow when making path relative to CWD

ADDED features:

1. Removes leading and trailing whitespace

2. Add basic support for Windows file system by using Boost::filesystem
Expansion of Windows-specific shell variables, e.g. %HOME%, is _not_

3. Leverage move semantics to reduce copying
This reduces the maximum number of string copies from 5 to 3. When
resolve_file_path is invoked with an r-value, there are only two

2 years agoAdjust Dyninst to support injecting CFGs for CUBINs
Keren Zhou [Mon, 4 Feb 2019 19:17:52 +0000 (13:17 -0600)]
Adjust Dyninst to support injecting CFGs for CUBINs

See PR #530 for details.

2 years agoAdd some explicit casts from boost::tribool to bool for some code in (#541)
Mark W. Krentel [Fri, 1 Feb 2019 19:14:11 +0000 (13:14 -0600)]
Add some explicit casts from boost::tribool to bool for some code in (#541)

Add some explicit casts from boost::tribool to bool for some code in dataflowAPI/rose/util/Message.[Ch].  This was breaking the build when using boost >= 1.69.

2 years agoDo not generate new PLTs for IFUNC when rewriting statically linked 543/head
Xiaozhu Meng [Wed, 30 Jan 2019 20:53:08 +0000 (14:53 -0600)]
Do not generate new PLTs for IFUNC when rewriting statically linked
binaries on x86. IFUNC should be handled by the loader, not the
linker, which is Dyninst when rewriting statically linked binaries.

2 years agoMore fixes on ppcle rewriting of statically linked binaries
Xiaozhu Meng [Wed, 30 Jan 2019 19:46:16 +0000 (19:46 +0000)]
More fixes on ppcle rewriting of statically linked binaries

1. Revert the change made in "760bfda6e409b4b61a6acd093548afa5860b4af1" about undefined symbols.
Section with number 0 is NULL section, not .bss. So, symbols with section number 0 are indeed
undefined symbols.
2. libc.a depends on libgcc.a on fedora 28 ppcle. So, also open libgcc.a to resolve undefined symbols.
3. Fix the handling of relocation entry "R_PPC64_REL24". R_PPC64_REL24 means the caller has set
up R2, so we should call the local entry point. Calling the global entry may lead to wrong r2, because
r12 is not properly set at the call site.
4. IFUNC should not be treated as a need for PLT.

2 years agoFix crash caused by erasing an iterator from a std::map while looping the iterator
Xiaozhu Meng [Tue, 29 Jan 2019 04:07:53 +0000 (04:07 +0000)]
Fix crash caused by erasing an iterator from a std::map while looping the iterator

2 years agoA couple fixes for binary rewriting of statically linked binaries on ppcle
Xiaozhu Meng [Tue, 29 Jan 2019 00:38:39 +0000 (00:38 +0000)]
A couple fixes for binary rewriting of statically linked binaries on ppcle

1. The handling of the libc global constructor and destructor is out-of-date. Follow the handling for x86-64.
2. Replace [] operator with insert() for std::map. [] operator caused weird memory corruptions
3. Symbols defined in .bss sections should not be considered undefined symbosl
4. Add and fix handling for a couple of ppc64 relocation entries

2 years agoThese functions were moved to the Emitter class.
Sasha Nicolas [Thu, 24 Jan 2019 18:09:35 +0000 (12:09 -0600)]
These functions were moved to the Emitter class.

2 years agoMerge pull request #537 from hainest/remove_ci
Tim Haines [Thu, 24 Jan 2019 17:02:57 +0000 (11:02 -0600)]
Merge pull request #537 from hainest/remove_ci

Remove Travis and AppVeyor CI

2 years agoMerge pull request #539 from hainest/gitignore_eclipse
Tim Haines [Thu, 24 Jan 2019 16:59:19 +0000 (10:59 -0600)]
Merge pull request #539 from hainest/gitignore_eclipse

Ignore Eclipse settings files and folders

2 years agoIgnore Eclipse settings files and folders 539/head
Tim Haines [Thu, 24 Jan 2019 15:42:56 +0000 (09:42 -0600)]
Ignore Eclipse settings files and folders

2 years agoRemove Travis and AppVeyor CI 537/head
Tim Haines [Wed, 23 Jan 2019 23:31:16 +0000 (17:31 -0600)]
Remove Travis and AppVeyor CI

This will be replaced with the Gitlab CI

2 years agofix missing installation of libdw when installing elfutils
rafzi [Tue, 22 Jan 2019 14:23:41 +0000 (15:23 +0100)]
fix missing installation of libdw when installing elfutils

2 years agoMerge branch 'fix_elf_h'
Sasha @leela [Tue, 15 Jan 2019 23:42:59 +0000 (17:42 -0600)]
Merge branch 'fix_elf_h'

2 years agoMerge pull request #516 from jmellorcrummey/fix-linemap
Xiaozhu Meng [Tue, 15 Jan 2019 21:11:57 +0000 (15:11 -0600)]
Merge pull request #516 from jmellorcrummey/fix-linemap

Fix linemaps for CUBINs

2 years agoMerge pull request #528 from dyninst/ppc_pc_fix
Xiaozhu Meng [Tue, 15 Jan 2019 20:29:09 +0000 (14:29 -0600)]
Merge pull request #528 from dyninst/ppc_pc_fix

Ppc pc fix

2 years agoMerge pull request #518 from stanfordcox/scox/includes
Xiaozhu Meng [Tue, 15 Jan 2019 19:13:42 +0000 (13:13 -0600)]
Merge pull request #518 from stanfordcox/scox/includes

Don't use system header <> syntax for dyninst includes

2 years agoRemove asserts that cause test failures 528/head
Xiaozhu Meng [Tue, 15 Jan 2019 16:43:26 +0000 (10:43 -0600)]
Remove asserts that cause test failures

2 years agoFix a non-deterministic hang in test_thread_5
Xiaozhu Meng [Sat, 12 Jan 2019 20:05:12 +0000 (14:05 -0600)]
Fix a non-deterministic hang in test_thread_5

When the mutator stops the mutatee, the mutator will wait for
all the threads in the mutatee to stop by counting the number
of STOP events. If one of the thread exited, there will be no
STOP comeing back.

When a pre-exit event is handled, if the thread has pending stop
to be waited, we should no longer wait for this thread.

2 years agoMoving funtion emitElfUtils::updateRelocation to specific platform
Sasha @leela [Fri, 11 Jan 2019 00:54:16 +0000 (18:54 -0600)]
Moving funtion emitElfUtils::updateRelocation to specific platform
files, since this function uses machine specific macros from elf.h

2 years agoMerge branch 'master' into ARMv8
Sasha @leela [Thu, 10 Jan 2019 22:21:31 +0000 (16:21 -0600)]
Merge branch 'master' into ARMv8

2 years agoMerge branch 'ARMv8' of https://github.com/dyninst/dyninst into ARMv8
Sasha @leela [Thu, 10 Jan 2019 22:19:47 +0000 (16:19 -0600)]
Merge branch 'ARMv8' of https://github.com/dyninst/dyninst into ARMv8

2 years agoRealized effective address calculation, but still need debugging as the result is...
Yuhan Xie [Thu, 10 Jan 2019 13:58:38 +0000 (07:58 -0600)]
Realized effective address calculation, but still need debugging as the result is not always correct.

2 years agoCleaned up power_opcode_table.C, revised several duplications.
Yuhan Xie [Thu, 10 Jan 2019 12:38:11 +0000 (06:38 -0600)]
Cleaned up power_opcode_table.C, revised several duplications.
Some old instructions was not deleted in the previous release, which would cause the new instructions with the same opcode futile.
All duplications has been revised but two special duos (mfocrf & mfcr, fcfids & fcfid)

2 years agoFix on x86-64 the mov instruction for register of 16-bit size.
Sasha Nicolas [Fri, 4 Jan 2019 00:22:50 +0000 (18:22 -0600)]
Fix on x86-64 the mov instruction for register of 16-bit size.
The opcode 89h is for both 32-bit and 16-bit but to use
the 16-bit version it's necessary to add an operand-size prefix
byte of value 66h.
Test snip_ref_shlib_var now passing on x86-64 linux.

2 years agoMerge branch 'ARMv8' of https://github.com/dyninst/dyninst into ARMv8
Sasha @leela [Fri, 28 Dec 2018 20:15:35 +0000 (14:15 -0600)]
Merge branch 'ARMv8' of https://github.com/dyninst/dyninst into ARMv8

2 years agoMerge branch 'master' into ARMv8
Sasha @leela [Fri, 28 Dec 2018 20:15:28 +0000 (14:15 -0600)]
Merge branch 'master' into ARMv8

2 years agofmt mixed-indented line changes to space-indented
LER0ever [Thu, 27 Dec 2018 06:49:50 +0000 (00:49 -0600)]
fmt mixed-indented line changes to space-indented

2 years agoimplement params ref for more than 8 args for AArch64
LER0ever [Thu, 27 Dec 2018 06:45:48 +0000 (00:45 -0600)]
implement params ref for more than 8 args for AArch64
test1_36 now passes on ARMv8

2 years agoGenerating Load and Store of 1, 2, 4 or 8 bytes
Sasha @leela [Sat, 22 Dec 2018 01:35:40 +0000 (19:35 -0600)]
Generating Load and Store of 1, 2, 4 or 8 bytes
for general purpose registers.
The function generateMemAccess32or64 has been renamed
to generateMemAccess, and the boolean parameter changed
to integer to hold the size of bytes to be loaded or
test_snip_ref_shlib_var passes.

2 years agoDeal with relocation type R_PPC64_IRELATIVE
Xiaozhu Meng [Thu, 20 Dec 2018 21:48:39 +0000 (15:48 -0600)]
Deal with relocation type R_PPC64_IRELATIVE

2 years agoMerge pull request #519 from dyninst/power_abi_v2_fixes
Xiaozhu Meng [Wed, 19 Dec 2018 19:33:34 +0000 (13:33 -0600)]
Merge pull request #519 from dyninst/power_abi_v2_fixes

Power abi v2 fixes

2 years agoFix code gen for PLT call/jump in dynamic instrumentation on Power 519/head
Xiaozhu Meng [Wed, 19 Dec 2018 17:15:28 +0000 (11:15 -0600)]
Fix code gen for PLT call/jump in dynamic instrumentation on Power

2 years agoThe red zone in Power ABI v2 contains 288 bytes for user code and
Xiaozhu Meng [Wed, 19 Dec 2018 15:43:30 +0000 (09:43 -0600)]
The red zone in Power ABI v2 contains 288 bytes for user code and
224 more bytes for system code. To be safe, we move down stack pointer
512 bytes to avoid overwriting any useful data.