linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How did KDbg find out the source corresponding to my executable?
@ 2007-04-27 15:06 Shriramana Sharma
  2007-05-04 13:34 ` Glynn Clements
  0 siblings, 1 reply; 2+ messages in thread
From: Shriramana Sharma @ 2007-04-27 15:06 UTC (permalink / raw)
  To: linux-c-programming

Has someone here used KDbg?

Just a few minutes ago, I tried KDbg, the KDE front-end to gdb. (The 
change in position of g between the two names amuses me for some reason.)

When I selected an executable which was located at a location different 
from its source, KDbg automatically found out the location of the 
source-file and opened it for setting breakpoints etc.

Is the path to the source embedded in every executable? Upon examining 
the executable by nm for symbols I did not find the source path, but 
maybe that is not a symbol. Okay: readelf has an entry corresponding to 
the source filename but not the source path. Does KDbg search the home 
directory for the source filename?

If not, how could KDbg correctly open the source file?

Shriramana Sharma.

P.S: I realize this is slightly OT since it asks a question about a KDE 
application albeit most related to programming. I'm taking the chance 
that someone here has used KDbg.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How did KDbg find out the source corresponding to my executable?
  2007-04-27 15:06 How did KDbg find out the source corresponding to my executable? Shriramana Sharma
@ 2007-05-04 13:34 ` Glynn Clements
  0 siblings, 0 replies; 2+ messages in thread
From: Glynn Clements @ 2007-05-04 13:34 UTC (permalink / raw)
  To: Shriramana Sharma; +Cc: linux-c-programming


Shriramana Sharma wrote:

> Just a few minutes ago, I tried KDbg, the KDE front-end to gdb. (The 
> change in position of g between the two names amuses me for some reason.)
> 
> When I selected an executable which was located at a location different 
> from its source, KDbg automatically found out the location of the 
> source-file and opened it for setting breakpoints etc.
> 
> Is the path to the source embedded in every executable?

It's part of the debug info, so it will be present in an executable
which was built with debug info and hasn't subsequently been stripped.

> Upon examining 
> the executable by nm for symbols I did not find the source path, but 
> maybe that is not a symbol.

It's not a symbol.

Run "strings -a ..." on the file.

-- 
Glynn Clements <glynn@gclements.plus.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-04 13:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-27 15:06 How did KDbg find out the source corresponding to my executable? Shriramana Sharma
2007-05-04 13:34 ` Glynn Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).