Re: [DynInst_API:] [SymtabAPI] Question regarding object files


Date: Tue, 30 Jun 2015 11:14:45 -0500
From: Bill Williams <bill@xxxxxxxxxxx>
Subject: Re: [DynInst_API:] [SymtabAPI] Question regarding object files
On 06/30/2015 10:50 AM, Tony Zhang wrote:
Hello,

I’m writing a toy program to test the symtabAPI. I have a question
regarding the API description below :

static bool openFile(Symtab *&obj, string filename) Creates a new Symtab
object for an object file on disk. This object serves as a handle to the
parsed object file. filename represents the name of the Object file to
be parsed. The Symtab object is returned in obj if the parsing succeeds.
Returns true if the file is parsed without an error, else returns false.
getLastSymtabError() and printError() should be called to get more error
details.

static bool openFile(Symtab *&obj, char *mem_image, size_t size,
std::string name) This factory method creates a new Symtab object for an
object file in memory. This object serves as a handle to the parsed
object file. mem_image represents the pointer to the Object file in
memory 13 to be parsed. size indicates the size of the image. name
specifies the name we will give to the parsed object. The Symtab object
is returned in obj if the parsing succeeds. Returns true if the file is
parsed without an error, else returns false. getLastSymtabError() and
printError() should be called to get more error details.

What is the difference between “object file on disk” and “object file in
memory"? Do these refer to an object file vs a currently running process?

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.

Thank you,
Tony





_______________________________________________
Dyninst-api mailing list
Dyninst-api@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api



--
--bw

Bill Williams
Paradyn Project
bill@xxxxxxxxxxx
[← Prev in Thread] Current Thread [Next in Thread→]