While "disable 1 2 3 4" works as expected, if one passes location numbers instead of breakpoint numbers, then only the first location is updated. Vis: (gdb) info breakpoints No breakpoints or watchpoints. (gdb) b main Breakpoint 2 at 0x4004cf: file main.c, line 5. (gdb) b main Note: breakpoint 2 also set at pc 0x4004cf. Breakpoint 3 at 0x4004cf: file main.c, line 5. (gdb) info breakpoints Num Type Disp Enb Address What 2 breakpoint keep y 0x00000000004004cf in main at main.c:5 3 breakpoint keep y 0x00000000004004cf in main at main.c:5 (gdb) disable 2 3 (gdb) info breakpoints Num Type Disp Enb Address What 2 breakpoint keep n 0x00000000004004cf in main at main.c:5 3 breakpoint keep n 0x00000000004004cf in main at main.c:5 (gdb) enable 2 3 (gdb) info breakpoints Num Type Disp Enb Address What 2 breakpoint keep y 0x00000000004004cf in main at main.c:5 3 breakpoint keep y 0x00000000004004cf in main at main.c:5 (gdb) disable 2.1 3.1 (gdb) info breakpoints Num Type Disp Enb Address What 2 breakpoint keep y <MULTIPLE> 2.1 n 0x00000000004004cf in main at main.c:5 3 breakpoint keep y 0x00000000004004cf in main at main.c:5 (gdb) enable 2.1 3.1 (gdb) info breakpoints Num Type Disp Enb Address What 2 breakpoint keep y 0x00000000004004cf in main at main.c:5 3 breakpoint keep y 0x00000000004004cf in main at main.c:5 In fact, everything after the first location is ignored: (gdb) disable 2.1 foofoobar (gdb) info breakpoints Num Type Disp Enb Address What 2 breakpoint keep y <MULTIPLE> 2.1 n 0x00000000004004cf in main at main.c:5 3 breakpoint keep y 0x00000000004004cf in main at main.c:5 (gdb) That should warn, just like: (gdb) disable 2 foofoobar warning: bad breakpoint number at or near 'foofoobar'
[PATCH] fix PR-15501 From: Muhammad Waqas <mwaqas at codesourcery dot com> http://sourceware.org/ml/gdb-patches/2013-08/msg00339.html Message-ID: <520A0453.4070309@codesourcery.com>
CVSROOT: /cvs/src Module name: src Changes by: mwaqas@sourceware.org 2013-08-23 06:22:10 Modified files: gdb : breakpoint.c ChangeLog gdb/testsuite : ChangeLog gdb/testsuite/gdb.base: ena-dis-br.exp Log message: 2013-08-12 Muhammad Waqas <mwaqas@codesourcery.com> PR gdb/15501 * breakpoint.c (enable_command, disable_command): Iterate over all specified breakpoint locations. 2013-07-12 Muhammad Waqas <mwaqas@codesourccery.com> PR gdb/15501 * gdb.base/ena-dis-br.exp: Add test to verify enable/disable commands work correctly with multiple arguments that include multiple locations. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/breakpoint.c.diff?cvsroot=src&r1=1.775&r2=1.776 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15921&r2=1.15922 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3781&r2=1.3782 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/ena-dis-br.exp.diff?cvsroot=src&r1=1.22&r2=1.23
fixed.