On 06/22/2011 11:38 PM, Pedro Alves wrote: > Why not do "info breakpoints", and parse the output, checking if > the breakpoint is really disabled? If it is not, no point issuing > the continue. Oh, yes. New patch is revised in this way. > The breakpoint was set by line number, and we're reloading > the session the same both times. Why does breakpoint 1.2 become > enabled (and I'm guessing that breakpoint 1.1 becomes disabled)? > No, in my case, both 1.1 and 1.2 becomes enabled. info break^M Num Type Disp Enb Address What^M 1 breakpoint keep y ^M breakpoint already hit 3 times^M 1.1 y 0xe78c90a8 in foo(int) at gdb/testsuite/gdb.cp/mb-inline.h:26^M 1.2 y 0xe78c91a8 in foo(int) at gdb/testsuite/gdb.cp/mb-inline.h:26^M During breakpoint updates (when inferior is re-created), GDB will iterate list of breakpoint locations, to look for breakpoint locations for a certain address in new inferior, and assign found breakpoint locations to that breakpoint. The state of breakpoint location (enabled/disabled) is kept, and this test will pass. If gdb is unable to find any breakpoint location for a given address, gdb will create new breakpoint locations, and remove old breakpoint location. Then, the state of breakpoint location of previous inferior is lost, and new created breakpoint location is enabled in default. OK for mainline? -- Yao (齐尧)