Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Fernando Nasser <fnasser@redhat.com>
To: Matt Schalit <mschalit@pacbell.net>
Cc: gdb@sourceware.cygnus.com
Subject: Re: Need help with a backtrace
Date: Thu, 15 Feb 2001 06:17:00 -0000	[thread overview]
Message-ID: <3A8BE44D.799A6BF4@redhat.com> (raw)
In-Reply-To: <3A888BCA.84305AE1@pacbell.net>

Matt Schalit wrote:
> 
> Ok.  It looks like it only lists an entry when a function
> calls another function, like main() calling printf()?
> But it doesn't seem to list things like loops or if/case tests
> or variable values?
> 

Yes, because all information it has are the stack frames, which are
created when a function is called.

When you want to debug something in between, you set a breakpoint in a
line of source code and tell your program to run (or continue if you had
stopped somewhere else before). Of course, all this only work before you
program crashes.


> I know how to write C programs.  How would I backtrace or
> step my way through hello-world.c if it exits normally, and
> I just want to see how the trace looks?
> 

Insert a breakpoint at that last function (look at the source file and
line number in the bad backtrace).  Run your program.  When it stops at
the breakpoint use the backtrace command.


> I say that as a possibility, because I read a Solairis Gnome
> Install Howto that mentioned those were needed, and I've noticed,
> when doing a truss on some of these programs that I get an extra '/'
> showing up in paths to applications that are being called, as in:
> 
> xstat(2, "./gnome/config-override//Gnome", 0x08047614) Err#2  ENOENT
> xstat(2, "/usr/local/etc/gnome/config//Gnome", 0x08047614) Err#2  ENOENT
> xstat(2, "./gnome/config//Gnome", 0x08047614)   Err#2  ENOENT
> xstat(2, "/home/matthew/.gnome//Gnome", 0x08047674) = 0
> open("/home/matthew/.gnome//Gnome", O_RDONLY, 0666) = 6
> 
> I guess the last two lines do show a file being found
> using the odd path.
> 

Yes, AFAIK the extra "/" won't hurt.


> Is up and down how I see what variables get set to which values
> while moving through a function?
> 

You only see what the values of these variables where when the next
function was called.  It is a "snapshot".


> And finally, where does
> 
> > > #4  0xbfd95397 in create_label
>         ^^^^^^^^^^
> 

This is the instruction pointer (PC).  That is where the CPU was
executing instructions when another function was called or your program
stopped/crashed.


> that value come from, or what man page should I look at
> for the decoding formula?
> 

With the GDB sources, there is a nice user manual.  It is in the sources
under gdb/doc.   It is in a format called "texinfo" which can produce
several different formats like Postcript for instance.  You just have to
use "make" with the appropriate type on that directory.

I am sure that if you do a Web search you'll find a HTML on line
version.


W.r.t. your original problem, maybe if you post it to the Gnome list
people will recognize that as a known problem or something.  It worth a
try.

Cheers,
Fernando


-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


  reply	other threads:[~2001-02-15  6:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-12 11:33 Matt Schalit
2001-02-12 11:53 ` Fernando Nasser
2001-02-15  5:33   ` Matt Schalit
2001-02-15  6:17     ` Fernando Nasser [this message]
2001-02-15 11:04       ` Matt Schalit
2001-02-15 12:56         ` Fernando Nasser
2001-02-12 11:46 Michael Elizabeth Chastain
2001-02-12 17:09 ` Matt Schalit
2001-02-15 12:48 Michael Elizabeth Chastain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3A8BE44D.799A6BF4@redhat.com \
    --to=fnasser@redhat.com \
    --cc=gdb@sourceware.cygnus.com \
    --cc=mschalit@pacbell.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox