Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* debugging stripped binary/library & coredump without binary
@ 2007-06-12 10:52 Sudhakar G
  2007-06-12 11:11 ` Tavis Ormandy
  2007-06-12 11:23 ` Daniel Jacobowitz
  0 siblings, 2 replies; 6+ messages in thread
From: Sudhakar G @ 2007-06-12 10:52 UTC (permalink / raw)
  To: gdb

Hi,

For certain reasons I want strip the symbols in my modules. But I want
to know how to debug the program in such case. I used to debug running
program at object/assembly level but only with the help of symbols
which help me in setting breakpoints. But with symbols stripped, I am
at loss as to how to debug. I know there is a command called
"symbol-file" in gdb which will help in loading the symbol file. Not
sure if it is of help. But I could not figure out how to generate
symbol file for a program or library though I spent some time with gcc
and ld man pages.

I also want to know if there is anyway in opening the coredump and
debugging it if the actual program is not available.

If anyone knows the answers then please let me know. It will be of
immense help for me.

Thanks a lot in advance.

Regards
Sudhakar


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

* Re: debugging stripped binary/library & coredump without binary
  2007-06-12 10:52 debugging stripped binary/library & coredump without binary Sudhakar G
@ 2007-06-12 11:11 ` Tavis Ormandy
  2007-06-12 11:23 ` Daniel Jacobowitz
  1 sibling, 0 replies; 6+ messages in thread
From: Tavis Ormandy @ 2007-06-12 11:11 UTC (permalink / raw)
  To: Sudhakar G; +Cc: gdb

On Tue, Jun 12, 2007 at 04:22:43PM +0530, Sudhakar G wrote:
> I know there is a command called
> "symbol-file" in gdb which will help in loading the symbol file. Not
> sure if it is of help. But I could not figure out how to generate
> symbol file for a program or library though I spent some time with gcc
> and ld man pages.
> 

It is, use objcopy with `--only-keep-debug` to make use of it.

Thanks, Tavis.

-- 
-------------------------------------
taviso@sdf.lonestar.org | finger me for my pgp key.
-------------------------------------------------------


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

* Re: debugging stripped binary/library & coredump without binary
  2007-06-12 10:52 debugging stripped binary/library & coredump without binary Sudhakar G
  2007-06-12 11:11 ` Tavis Ormandy
@ 2007-06-12 11:23 ` Daniel Jacobowitz
  2007-06-13  9:06   ` Sudhakar G
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2007-06-12 11:23 UTC (permalink / raw)
  To: Sudhakar G; +Cc: gdb

On Tue, Jun 12, 2007 at 04:22:43PM +0530, Sudhakar G wrote:
> For certain reasons I want strip the symbols in my modules. But I want
> to know how to debug the program in such case. I used to debug running
> program at object/assembly level but only with the help of symbols
> which help me in setting breakpoints. But with symbols stripped, I am
> at loss as to how to debug. I know there is a command called
> "symbol-file" in gdb which will help in loading the symbol file. Not
> sure if it is of help. But I could not figure out how to generate
> symbol file for a program or library though I spent some time with gcc
> and ld man pages.

You can use separate debug files, or you can just save the unstripped
file and use that for GDB instead.

> I also want to know if there is anyway in opening the coredump and
> debugging it if the actual program is not available.

gdb -c, but it does not work as well as if you give it a program.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: debugging stripped binary/library & coredump without binary
  2007-06-12 11:23 ` Daniel Jacobowitz
@ 2007-06-13  9:06   ` Sudhakar G
  2007-06-13  9:26     ` Andreas Schwab
  2007-06-13 11:19     ` Daniel Jacobowitz
  0 siblings, 2 replies; 6+ messages in thread
From: Sudhakar G @ 2007-06-13  9:06 UTC (permalink / raw)
  To: Sudhakar G, gdb

Thanks Daniel. But I want to know how to debug once core file is
opened without access to program file but with access only to source
code. Are there any tips?

Thanks
Sudhakar

On 6/12/07, Daniel Jacobowitz <drow@false.org> wrote:
> On Tue, Jun 12, 2007 at 04:22:43PM +0530, Sudhakar G wrote:
> > For certain reasons I want strip the symbols in my modules. But I want
> > to know how to debug the program in such case. I used to debug running
> > program at object/assembly level but only with the help of symbols
> > which help me in setting breakpoints. But with symbols stripped, I am
> > at loss as to how to debug. I know there is a command called
> > "symbol-file" in gdb which will help in loading the symbol file. Not
> > sure if it is of help. But I could not figure out how to generate
> > symbol file for a program or library though I spent some time with gcc
> > and ld man pages.
>
> You can use separate debug files, or you can just save the unstripped
> file and use that for GDB instead.
>
> > I also want to know if there is anyway in opening the coredump and
> > debugging it if the actual program is not available.
>
> gdb -c, but it does not work as well as if you give it a program.
>
> --
> Daniel Jacobowitz
> CodeSourcery
>


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

* Re: debugging stripped binary/library & coredump without binary
  2007-06-13  9:06   ` Sudhakar G
@ 2007-06-13  9:26     ` Andreas Schwab
  2007-06-13 11:19     ` Daniel Jacobowitz
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2007-06-13  9:26 UTC (permalink / raw)
  To: Sudhakar G; +Cc: gdb

"Sudhakar G" <list.sudhakar@gmail.com> writes:

> Thanks Daniel. But I want to know how to debug once core file is
> opened without access to program file but with access only to source
> code. Are there any tips?

You need at least the debugging symbols in order to do source level
debugging.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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

* Re: debugging stripped binary/library & coredump without binary
  2007-06-13  9:06   ` Sudhakar G
  2007-06-13  9:26     ` Andreas Schwab
@ 2007-06-13 11:19     ` Daniel Jacobowitz
  1 sibling, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2007-06-13 11:19 UTC (permalink / raw)
  To: Sudhakar G; +Cc: gdb

On Wed, Jun 13, 2007 at 02:36:40PM +0530, Sudhakar G wrote:
> Thanks Daniel. But I want to know how to debug once core file is
> opened without access to program file but with access only to source
> code. Are there any tips?

As Andreas said, this is impossible.

-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2007-06-13 11:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-12 10:52 debugging stripped binary/library & coredump without binary Sudhakar G
2007-06-12 11:11 ` Tavis Ormandy
2007-06-12 11:23 ` Daniel Jacobowitz
2007-06-13  9:06   ` Sudhakar G
2007-06-13  9:26     ` Andreas Schwab
2007-06-13 11:19     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox