Hi Bill,
Thanks for the prompt response.
We have a few follow up questions, if you could please help answer them :
1. Why the two different APIs for this? Is there a significant performance benefit to opening the object file from memory vs disk?
2. We’re not quite sure what you meant by “mapped region in a currently running process” - is this something that’s part of the ELF format? If you could give us a brief explanation or some resources we could use to understand this, that would be great.
3. In the file open API signature : static bool openFile(Symtab *&obj, char *mem_image, size_t size, std::string name) - we’re not quite sure what “mem_image” is supposed to be. The doc says that “mem_image represents the pointer to the Object file in memory to be parsed.” - where does this information come from? The first version of the API has “string filename” to be loaded from disk, but we’re not quite sure where mem_image is obtained from.
4. Could you point us to a few example programs that use symtabAPI (similar to the rich set of dyninstAPI examples)?
Thank you again, Tony and Srihari.
Somewhat more precisely, on disk = object file; in memory = already mmapped for whatever reason. This could be a mapped region in a currently running process, or because your tool already mapped in the object file for other reasons, or because you're pointing Symtab at dynamically generated ELF-formatted stuff before it hits disk.
|