[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Strange gdb behavior with optimized code
From: |
Ludo' |
Subject: |
Strange gdb behavior with optimized code |
Date: |
Mon, 8 Apr 2002 18:31:56 +0200 |
User-agent: |
Mutt/1.2.5i |
Hi,
I noticed a strange behaviour of gdb when debugging code that had been
compiled with `-O2 -mpentium': when stepping, gdb sometimes seems to get lost
in the code (goes back to the same line several times for instance). I'm not
sure this is really a bug since this is probably not recommended to debug a
program that had been optimized.
Example of what gdb does:
Breakpoint 1, netfs_get_dirents (cred=0x804b958, dir=0x804b4e8, entry=0,
nentries=-1, data=0x11fbcec, datacnt=0x11fbcf0, bufsize=0, amt=0x11fbcf8)
at netfs.c:139
139 curr_datap = *data;
(gdb) n
142 backend.set_curr_dir (dir);
(gdb)
138 curr_amt = 0;
(gdb)
142 backend.set_curr_dir (dir);
(gdb)
139 curr_datap = *data;
(gdb)
142 backend.set_curr_dir (dir);
(gdb)
143 no_more = backend.skip_entries (entry);
(gdb) n
145 for (curr_entry = entry;
Notice that line 142 appears several times.
Thanks,
Ludovic.
- Strange gdb behavior with optimized code,
Ludo' <=