drsyms
DynamoRIO Extension provides symbol information. Currently it is only available for Windows PDB symbols but Linux and Cygwin support is in the works.
drsyms
with your client simply include this line in your client's CMakeLists.txt
file:
use_DynamoRIO_extension(clientname drsyms)
That will automatically set up the include path and library dependence.
The drsyms
library on Windows relies on the dbghlp.dll
library from Microsoft. You will need to download the Debugging Tools for Windows package from http://www.microsoft.com/whdc/devtools/debugging/default.mspx and place the dbghelp.dll
in the same directory as either drsyms.dll
or as your client library.
Prior to use, drsyms
must be initialized by a call to drsym_init(). The drsyms
API will eventually support both sideline and online use, and the parameter to drsym_init() will specify the symbol server to use for sideline use. Today only online use is supported and NULL
should be passed.
Symbol lookup is supported in both directions: from an address to a symbol via drsym_lookup_address(), and from a symbol to an address via drsym_lookup_address().
For an example of usage see the instrcalls
sample client distributed with DynamoRIO.
When finished with the library, call drsym_exit().