This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question about what BFD can access



On Jul 27, 2006, at 10:58 PM, Daniel Jacobowitz wrote:
On Thu, Jul 27, 2006 at 10:23:38PM -0400, Chris Ross wrote:
So, gcc is magically finding the executable on disk? Odd. How? If
I can do the same magic, that might help me as much...

The normal method on Linux is /proc/PID/exe. There's other ways on other platforms.

While linux is my short-term target, I don't want to limit myself to that. Incidentally, I verified what you had said. If I start the app, then delete the program file, then use gdb to attach to the image, it is unable to get symbols for anything other than the stuff in the shared libraries. Nothing from the app itself. :-/

A dynamic executable can have both.  Normally, the dynamic one is not
particularly useful for debugging - it will only contain symbols
referenced by shared libraries.

Right. Okay, that makes sense. Thanks for that clarification.


  So, I'll dig around in gdb a bit to see how it finds the application.
I guess I'm resolved to having to do that.  (In theory, the whole
application is mmap'ed into memory, so it's "there", but without
a way to find it programatically, I guess it's of no use...)

- Chris


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]