diff options
author | Tom Tromey <tromey@adacore.com> | 2023-07-25 10:48:13 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-08-01 12:59:02 -0600 |
commit | af93035b2755fef31c67016f68ab9fcdc2074c42 (patch) | |
tree | 633cd3d4a912d74ad75272e1a7d21e4091406774 /gdb/python | |
parent | 21db866dc69c481cd79b4d739c2170a7ef9b98fd (diff) | |
download | gdb-af93035b2755fef31c67016f68ab9fcdc2074c42.zip gdb-af93035b2755fef31c67016f68ab9fcdc2074c42.tar.gz gdb-af93035b2755fef31c67016f68ab9fcdc2074c42.tar.bz2 |
Add DAP support for C++ exceptions
This adds DAP support for the various C++ exception-catching
operations.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30682
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/lib/gdb/dap/breakpoint.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/gdb/python/lib/gdb/dap/breakpoint.py b/gdb/python/lib/gdb/dap/breakpoint.py index e612c51..c33b4ae 100644 --- a/gdb/python/lib/gdb/dap/breakpoint.py +++ b/gdb/python/lib/gdb/dap/breakpoint.py @@ -353,10 +353,8 @@ def set_insn_breakpoints( @in_gdb_thread def _catch_exception(filterId, **args): - if filterId == "assert": - cmd = "-catch-assert" - elif filterId == "exception": - cmd = "-catch-exception" + if filterId in ("assert", "exception", "throw", "rethrow", "catch"): + cmd = "-catch-" + filterId else: raise Exception(f"Invalid exception filterID: {filterId}") result = gdb.execute_mi(cmd) @@ -404,6 +402,21 @@ def _rewrite_exception_breakpoint( "label": "Ada exceptions", "supportsCondition": True, }, + { + "filter": "throw", + "label": "C++ exceptions, when thrown", + "supportsCondition": True, + }, + { + "filter": "rethrow", + "label": "C++ exceptions, when re-thrown", + "supportsCondition": True, + }, + { + "filter": "catch", + "label": "C++ exceptions, when caught", + "supportsCondition": True, + }, ), ) def set_exception_breakpoints( |