Function wrapping implementation and Symtab extensions for undefined symbols
authorAndrew Bernat <bernat@cumin.cs.wisc.edu>
Wed, 10 Aug 2011 17:47:41 +0000 (12:47 -0500)
committerAndrew Bernat <bernat@cumin.cs.wisc.edu>
Thu, 18 Aug 2011 16:53:27 +0000 (11:53 -0500)
commitee95eb18be9f7cf64b15f5176de98574cf28663e
tree80b263c685124a133351087e0a739f5edf60b18f
parent982613b7982db09abfc0b2326e466d4ca09a9951
Function wrapping implementation and Symtab extensions for undefined symbols

1) I've implemented function wrapping for the binary rewriter. The interface is:

BPatch_addressSpace::wrapFunction(BPatch_function *original, BPatch_function *wrapper, SymtabAPI::Symbol *clone)

where original is replaced by wrapper, and we create a clone matching the symbol provided in clone. We use a symbol
instead of a string to ensure that we get the name correct (including handling mangling).

This is implemented by performing function replacement original->wrapper, and creating a copy of original named with
the information from the clone symbol. It relies on the new instrumenter.

I've also added the appropriate PatchAPI calls to handle function wrapping.

2) Symtab didn't have a clean interface for accessing undefined symbols, which are necessary for the new function
wrapping code. I've added another parameter to findSymbol to include undefined symbols in a name lookup.
32 files changed:
dyninstAPI/h/BPatch_addressSpace.h
dyninstAPI/h/BPatch_function.h
dyninstAPI/src/BPatch_addressSpace.C
dyninstAPI/src/BPatch_function.C
dyninstAPI/src/Patching.h [new file with mode: 0644]
dyninstAPI/src/Relocation/CodeMover.C
dyninstAPI/src/Relocation/Transformers/Modification.C
dyninstAPI/src/Relocation/Transformers/Modification.h
dyninstAPI/src/Relocation/Widgets/CallbackWidget.C
dyninstAPI/src/addressSpace.C
dyninstAPI/src/addressSpace.h
dyninstAPI/src/binaryEdit.C
dyninstAPI/src/binaryEdit.h
dyninstAPI/src/function.C
dyninstAPI/src/function.h
patchAPI/h/Instrumenter.h
patchAPI/h/PatchCFG.h
patchAPI/h/PatchCallback.h
patchAPI/h/common.h
patchAPI/src/Instrumenter.C
patchAPI/src/PatchBlock.C
symtabAPI/h/Symtab.h
symtabAPI/src/Symbol.C
symtabAPI/src/Symtab-edit.C
symtabAPI/src/Symtab-lookup.C
symtabAPI/src/Symtab.C
symtabAPI/src/emitElf-64.C
valueAdded/wrapper/amd64/Makefile [new file with mode: 0644]
valueAdded/wrapper/amd64/specfile [new file with mode: 0644]
valueAdded/wrapper/src/lib_wrapper.c [new file with mode: 0644]
valueAdded/wrapper/src/test.c [new file with mode: 0644]
valueAdded/wrapper/src/wrapper.C [new file with mode: 0644]