Bug 30713 - do not catch 'const gdb_exception &'
Summary: do not catch 'const gdb_exception &'
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on: 30714
Blocks:
  Show dependency treegraph
 
Reported: 2023-08-01 22:39 UTC by Tom Tromey
Modified: 2023-08-01 22:43 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:
Project(s) to access:
ssh public key:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2023-08-01 22:39:00 UTC
Right now a fair amount of code looks like:

try
...
catch (const gdb_exception &)
... stuff

However,this can end up swallowing a QUIT if one is not careful.

I think it would be better to catch 'const gdb_exception_error &'
in nearly every spot.

One question is what to do with this:

struct gdb_quit_bad_alloc
  : public gdb_exception_quit,
    public std::bad_alloc


I don't know why it derives from the _quit form and not
_error.  Perhaps that's fine, though, since it would just
end up returning to the top level.