forked from Imagelibrary/binutils-gdb
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 <aburgess@redhat.com>
This commit is contained in:
@@ -869,6 +869,24 @@ scoped_rbreak_breakpoints::~scoped_rbreak_breakpoints ()
|
||||
prev_breakpoint_count = rbreak_start_breakpoint_count;
|
||||
}
|
||||
|
||||
/* See breakpoint.h. */
|
||||
|
||||
int
|
||||
scoped_rbreak_breakpoints::first_breakpoint () const
|
||||
{
|
||||
return rbreak_start_breakpoint_count + 1;
|
||||
}
|
||||
|
||||
/* See breakpoint.h. */
|
||||
|
||||
int
|
||||
scoped_rbreak_breakpoints::last_breakpoint () const
|
||||
{
|
||||
return (rbreak_start_breakpoint_count == breakpoint_count
|
||||
? -1
|
||||
: breakpoint_count);
|
||||
}
|
||||
|
||||
/* Used in run_command to zero the hit count when a new run starts. */
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user