Mail Archives: djgpp/2001/04/11/00:46:45
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 -