From 59d25b31eb54130f1115aae20da4ac9ccaa15a53 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 24 May 2024 10:51:02 -0600 Subject: Don't let exception terminate 'rbreak' 'rbreak' searches symbols and then sets a number of breakpoints. If setting one of the breakpoints fails, then 'rbreak' will terminate before examining the remaining symbols. However, it seems to me that it is better for 'rbreak' to keep going in this situation. That is what this patch implements. This problem can be seen by writing an Ada program that uses "pragma import" to reference a symbol that does not have debug info. In this case, the program will link but setting a breakpoint on the imported name will not work. I don't think it's possible to write a reliable test for this, as it depends on the order in which symtabs are examined. New in v2: rbreak now shows how many breakpoints it made and also how many errors it encountered. Regression tested on x86-64 Fedora 40. Approved-By: Andrew Burgess --- gdb/breakpoint.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gdb/breakpoint.h') diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index be127a9..696dd9e 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -1970,6 +1970,14 @@ public: scoped_rbreak_breakpoints (); ~scoped_rbreak_breakpoints (); + /* Return the number of first breakpoint made while this object is + in scope. */ + int first_breakpoint () const; + + /* Return the number of the most recent breakpoint made while this + object is in scope, or -1 if no breakpoints were made. */ + int last_breakpoint () const; + DISABLE_COPY_AND_ASSIGN (scoped_rbreak_breakpoints); }; -- cgit v1.1