🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #46573

Re: @@$##&%^$! gdb!!!! ARGGGGHHH!!!!!

#46573
From: Paul Smith
Date: Wed, 09 Nov 1994 15:36
78 lines
3879 bytes
%% Regarding @@$##&%^$! gdb!!!!  ARGGGGHHH!!!!!;
%% jstern@eclectic.ss.uci.edu (Jeff Stern) writes:

    js> Where do I go for help on gdb?  I've been through the crappy
    js> info pages a cadgillion times, and I can't get the simplest
    js> answer:

    js> Program received signal 8, Floating Point Exception.
    js> 0x112cd in _IO_dtoa ()
    js> (gdb)

    js> Okay?  So what does this mean?  And where the heck would I *FIND
    js> OUT* what the heck it means?  And how do I get this crazy thing
    js> to just simply tell me what function it's stopping in?

It did tell you.  It stopped in function _IO_dtoa(), obviously.

Since that function begins with an underscore and has some strange name
you probably didn't write, you can infer that some function you wrote
called a system function or something, and eventually ended up here.

The question you really want to ask is, what was the last function
called that *I wrote* when this bug happened (we're assuming here that
the bug isn't in the system libraries but rather your code--certainly
not always the case, but a good first bet :).

Well, I looked at the GDB Info menu, and quickly spotted this
likely-looking candidate:

    * Stack::                       Examining the stack

Huh!  Examining the stack.  Sounds like exactly what I want to do.
Choosing that menu option revealed:

    Examining the Stack
    *******************

       When your program has stopped, the first thing you need to know is
    where it stopped and how it got there.

Wow, looks promising!  Looking at the menu for that we see:

    * Backtrace::                   Backtraces

And selecting that we find:

    Backtraces
    ==========

       A backtrace is a summary of how your program got where it is.  It
    shows one line per frame, for many frames, starting with the currently
    executing frame (frame zero), followed by its caller (frame one), and
    on up the stack.

    `backtrace'
    `bt'
         Print a backtrace of the entire stack: one line per frame for all
         frames in the stack.

Plus much other good info.  Even without knowing what a "backtrace" is,
there're just a couple of other menu items under "Examining the Stack"
and this is the second one, so it shouldn't take long to get there just
by linear progression.

All there, and not very difficult to find IMHO.  Are you sure you're
reading the right manual?  If not, I'd work on that first.  If so,
perhaps you just need to try a bit harder before cursing GDB or its
documentation for info it clearly provides in a straightforward manner,
and you just can't find.

                                                                paul
 _____________________________________________________________________________
/                                                                             \
 Paul D. Smith                   | "I'm not Gallagher, I'm the Dream Weaver."
 <psmith@wellfleet.com>          | 
 Bay Networks, Inc.              |                        -- _Robotman_
 Network Management Development  | 
\_____________________________________________________________________________/
Technical Details
Message-ID: <9411091533.AA27960@lemming.wellfleet>
Path: arc1-ca.pugleaf.net!nntp.gmd.de!newsserver.jvnc.net!netnews.upenn.edu!rutgers!cis.ohio-state.edu!lemming.wellfleet.com!psmith
References: <39pqo5$4dg@news.service.uci.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,554e5234231de3e
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1994-11-09 07:36:19 PST
Path: arc1-ca.pugleaf.net!nntp.gmd.de!newsserver.jvnc.net!netnews.upenn.edu!rutgers!cis.ohio-state.edu!lemming.wellfleet.com!psmith
From: psmith@lemming.wellfleet.com (Paul Smith)
Newsgroups: gnu.gcc.help
Subject: Re: @@$##&%^$! gdb!!!!  ARGGGGHHH!!!!!
Date: 9 Nov 1994 10:36:19 -0500
Organization: GNUs Not Usenet
Lines: 78
Sender: daemon@cis.ohio-state.edu
Distribution: gnu
Message-ID: <9411091533.AA27960@lemming.wellfleet>
References: <39pqo5$4dg@news.service.uci.edu>
Reply-To: psmith@wellfleet.com