gdb output

S

Sheldon

Hi,

I have program that I am trying to debug.
When I use gdb I get the following:

(gdb) backtrace
#0 0x40297664 in ?? ()
#1 0x403671c0 in ?? ()

I have little experience with gdb and debugging C. Does anyone know
what has happened here?

Any help is appreciated,
Sheldon
 
B

Barry

Sheldon said:
Hi,

I have program that I am trying to debug.
When I use gdb I get the following:

(gdb) backtrace
#0 0x40297664 in ?? ()
#1 0x403671c0 in ?? ()

I have little experience with gdb and debugging C. Does anyone know
what has happened here?

Any help is appreciated,
Sheldon

A user typed in "backtrace" and gdb displayed the stack frames.
 
J

Jens Thoms Toerring

Sheldon said:
Barry skrev:
Yes but do you know what these frames mean?

This is off-topic here since it's not about the C language but
about some tool you're using - you probably better ask in e.g.
gnu.gcc.help after you have read the gdb documentation... So
only a short answer: try compiling with the '-g' option (to
retain debugging info in the final program) and look again
what 'backtrace' then shows you. I guess this will answer your
question;-)
Regards, Jens
 
I

Ico

Sheldon said:
I have program that I am trying to debug.
When I use gdb I get the following:

(gdb) backtrace
#0 0x40297664 in ?? ()
#1 0x403671c0 in ?? ()

I have little experience with gdb and debugging C. Does anyone know
what has happened here?

No way to tell - compile with debugging enabled (-g) and try again
 
S

Sheldon

Ico skrev:
No way to tell - compile with debugging enabled (-g) and try again

I understand. The thing is that I am using (-g) and this is what
baffles me: I acnnot tell what is wrong, even after I read the manual
and some examples from online manuals.
I will check with the gcc site.
Thanks!

/S
 
I

Ico

Sheldon said:
Ico skrev:


I understand. The thing is that I am using (-g) and this is what
baffles me: I acnnot tell what is wrong, even after I read the manual
and some examples from online manuals.

Did you also use -g at the linking stage ?
 
R

Richard Tobin

Sheldon said:
When I use gdb I get the following:

(gdb) backtrace
#0 0x40297664 in ?? ()
#1 0x403671c0 in ?? ()

Quite likely the bug in your program overwrote the stack, so the
debugger is confused. You could try setting breakpoints to narrow
down where the failure happened.

-- Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,161
Latest member
GertrudeMa
Top