delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/04/11/00:46:45

Message-ID: <3AD3DFCD.9CE625B6@jps.net>
From: Dennis Yelle <dennis51 AT jps DOT net>
X-Mailer: Mozilla 4.75 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: gdb still doesn't work for me
References: <3AD0B992 DOT 44D0D3C3 AT jps DOT net> <4634-Sun08Apr2001234906+0300-eliz AT is DOT elta DOT co DOT il> <3AD10B71 DOT 9019CC9 AT jps DOT net> <3AD1E414 DOT 8D811D08 AT jps DOT net> <9auqog$6ah$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <3AD3339E DOT 2C1F2F32 AT jps DOT net> <9avce7$lab$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
Lines: 93
Date: Tue, 10 Apr 2001 21:38:37 -0700
NNTP-Posting-Host: 216.119.15.216
X-Complaints-To: abuse AT onemain DOT com
X-Trace: nntp1.onemain.com 986963665 216.119.15.216 (Wed, 11 Apr 2001 00:34:25 EDT)
NNTP-Posting-Date: Wed, 11 Apr 2001 00:34:25 EDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hans-Bernhard Broeker wrote:
> 
> Dennis Yelle <dennis51 AT jps DOT net> wrote:
> 
> [...]
> > Thanks for the suggestion, -gstabs definitely changes
> > the behavior of gdb.  It still does not work the
> > way I want it to, or the way I expect it to.
> 
> How *does* it work, then? Please try to be a bit less mysterious. What
> is the change in behaviour, and what's still not like you want or
> expect it?

The program is very simple, only 23 lines long,
here is the whole thing:
------------------------------------
int count;
int i, k;

class Paths {
public:
  static void car7()
  {
    for( i=0; i<10; i++) {
      for( k=0; k<1000000; k++) {
        if ( (i | k) == 127)
          ++count;
      }
    }
  }
};

int main()
{
  count = 0;
  Paths::car7();
  count += 2;
  return count;
}
-----------------------------------
I compile it with 
  gxx -gstabs -Os -Wall test.cpp -o test.exe
Then I run it from the command line like this
  test
It completes in less than 0.5 seconds.
Now I do exactly this:

  gdb test.exe
  break main
  run
  n

I expect it to 'step over' the call to car7, but instead, it
now, with -gstabs, steps into the car7 function (or method, 
whatever you want to call it) and shows this line:
   8           for( i=0; i<10; i++) {

Before, with '-g' it just gave no response of any kind for
more than 20 seconds.

> > My understanding is that the command 'n' is 'step over'.  That is,
> > if the next line to be executed is line 20, and line 20 calls a
> > function, or method, then the 'n' command would be equivalent to
> > setting a breakpoint on line 21 and running the program until line
> > 21 is reached.
> 
> Right.
> 
> The problem I currently suspect to be hitting you is that due to bugs
> in other parts of the setup (at least one upload of gcc-2.95.3
> binaries, in particular), the debugging informations found in the
> executable might be so confusing for GDB that it takes much longer
> than it usually would to locate where a "breakpoint on line 21"
> actually has to be put.

I got it last Sunday.
How can I tell if I got a bad one?

> Another possibility: you could have a .gdb_init file sitting around
> from earlier work, containing a software watchpoint or whatever.
> "info break" should tell you about that.

I tried "info break" and it says:
  No breakpoints or watchpoints.

Thanks for your help.
Do you have any other ideas?

Dennis Yelle
-- 
I am a computer programmer and I am looking for a job.
There is a link to my resume here:  
http://table.jps.net/~vert/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019