[DynInst_API:] symtabAPI usage


Date: Mon, 20 Aug 2012 15:28:41 -0400
From: Gabriel Marin <mgabi99@xxxxxxxxx>
Subject: [DynInst_API:] symtabAPI usage

Hi everyone,

I want to read the Dwarf information associated with global and local variables as well as function formal parameters in an executable or a library. I am primarily interested in name, location and size. Can symtabAPI provide such information for the Dwarf-2/3/4 formats?

I just downloaded and compiled the library and I looked over the manual.
Being a new user of the library, I am trying to find the best way to get up to speed.

I tried compiling test_type.C, one of the test programs that come with symtabAPI, but it looks like they have been written for a previous version of the API.

$ g++ -o ttype test_types.C -I../.. -I../../dynutil/h/
test_types.C: In function ?int mutatorTest(Dyninst::SymtabAPI::Symtab*)?:
test_types.C:50:10: error: ?class Dyninst::SymtabAPI::Symtab? has no member named ?findModule?
test_types.C:57:2: error: ?typeScalar? was not declared in this scope
test_types.C:57:14: error: ?styp? was not declared in this scope
test_types.C:57:25: error: invalid use of incomplete type ?struct Dyninst::SymtabAPI::Type?
../../symtabAPI/h/Symbol.h:64:7: error: forward declaration of ?struct Dyninst::SymtabAPI::Type?
test_types.C:68:29: error: invalid use of incomplete type ?struct Dyninst::SymtabAPI::localVar?
../../symtabAPI/h/Module.h:46:7: error: forward declaration of ?struct Dyninst::SymtabAPI::localVar?

Sorry about the formatting. The single quotes have been replace by ? during the copy/paste process. 
I think that findModule has been replaced by findModuleByName, but I see that findModule is used in the samples shown in the manual as well.

I think that a working example that enumerates the global variables, or the local variables in a function would provide a great start for what I need. Does anybody have a symtabAPI example that goes over the local or global variables in a binary?

Thanks,
Gabriel

[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] symtabAPI usage, Gabriel Marin <=