This is the mail archive of the gdb-prs@sourceware.org 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]

[Bug breakpoints/11285] New: breakpoint commands: continue after finish has now effect


Hi,

I noticed that a 'continue' after a 'finish' has no effect when specified with
the 'commands' command:

$ cat cont.c
#include <stdio.h>

void foo()
{
  puts("a");
}

int main()
{
  int i = 0;
  for (i = 0; i < 3; ++i)
    foo();
  return 0;
}

(gdb) b foo
Breakpoint 1 at 0x400528: file cont.c, line 5.
(gdb) commands 1
Type commands for when breakpoint 1 is hit, one per line.
End with a line saying just "end".
>finish
>continue
>end
(gdb) r
Starting program: /home/foo/temp/gdb/cont 

Breakpoint 1, foo () at cont.c:5
5         puts("a");
a
main () at cont.c:11
11        for (i = 0; i < 3; ++i)
(gdb)

Expected behaviour: Breakpoint should be hit 3 times and each time the
'continue' command should be executed.

Not using 'finish' works as expected:

(gdb) commands 1
Type commands for when breakpoint 1 is hit, one per line.
End with a line saying just "end".
>continue
>end
(gdb) r
Starting program: /mnt/gms/temp/gdb/cont 

Breakpoint 1, foo () at cont.c:5
5         puts("a");
a

Breakpoint 1, foo () at cont.c:5
5         puts("a");
a

Breakpoint 1, foo () at cont.c:5
5         puts("a");
a

Program exited normally.
(gdb)

Typing manually 'continue' at the prompt after a 'finish' works as expected,
too.

$ cat /etc/issue
Ubuntu 9.10
$ gdb --version
GNU gdb (GDB) 7.0-ubuntu

-- 
           Summary: breakpoint commands: continue after finish has now
                    effect
           Product: gdb
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: breakpoints
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: g_sauthoff at web dot de
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=11285

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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