This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] "clear" command behavior - ending-run.exp


There seems to be something bizarre happening with the "clear" command.
Looking at the ending-run.exp test in gdb.base:

     1       /* Test program for <next-at-end> and
     2        * <leaves-core-file-on-quit> bugs.
     3        */
     4       #include <stdio.h>
     5       #include <stdlib.h>
     6
     7       #ifdef PROTOTYPES
     8       int callee (int x)
     9       #else
     10      int callee( x )
     11      int x;
     12      #endif
     13      {
     14          int y = x * x;
     15          return (y - 2);
     16      }

Putting a breakpoint on line 1 and then on line 13 (which point to the
same instruction address), and then trying to clear all breakpoints at
line 13:

     (gdb) b ending-run.c:1
     Breakpoint 4 at 0x80485e8: file ./gdb.base/ending-run.c, line 1.
     (gdb) b ending-run.c:13
     Note: breakpoint 4 also set at pc 0x80485e8.
     Breakpoint 5 at 0x80485e8: file ./gdb.base/ending-run.c, line 13.
     (gdb) cle ending-run.c:13
     Deleted breakpoint 5 

Only one breakpoint is deleted, although both bp 4 and 5 are inserted
at the same location. Looking at the documentation for the "clear"
command ("Delete any breakpoints set at or within the code of the
specified line."), this seems like a bug, no? I would have expected
breakpoint 4 to also be deleted. Am I correct?

(the motivation behind this is to ask for approval for Jim Ingham's
patch to skip function prologues. At some point, the discussion was a
bit stalled, so I wanted to send the patch for approval in order to have
a more final decision. Anyway, Jim's patch causes 5 tiny regressions
in ending-run.exp, and one of them is that the clear command deleted
both bp 4 and 5, instead of just bp 5...)

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]