diff options
author | Tom de Vries <tdevries@suse.de> | 2024-10-26 08:40:07 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-10-26 08:40:07 +0200 |
commit | 5a43f7f040d45ca1bc0066019131cf71d7836cb8 (patch) | |
tree | 7472785973203b3aba4bf19690e107fd0adc6a30 /gdb/source.h | |
parent | b3ee98cda498bb256411c5bc23cf7fb9b17f10db (diff) | |
download | gdb-5a43f7f040d45ca1bc0066019131cf71d7836cb8.zip gdb-5a43f7f040d45ca1bc0066019131cf71d7836cb8.tar.gz gdb-5a43f7f040d45ca1bc0066019131cf71d7836cb8.tar.bz2 |
[gdb] Don't create registry keys in destructor
Creating a registry key using emplace calls new:
...
DATA *result = new DATA (std::forward<Args> (args)...);
...
which can throw a bad alloc, which will terminate gdb if called from a
destructor.
Fix this in a few places.
Tested on aarch64-linux.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/source.h')
-rw-r--r-- | gdb/source.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/source.h b/gdb/source.h index 33ccda7..f56e7b5 100644 --- a/gdb/source.h +++ b/gdb/source.h @@ -25,6 +25,7 @@ struct program_space; struct symtab; struct symtab_and_line; +struct objfile; /* See openp function definition for their description. */ @@ -132,6 +133,7 @@ extern symtab_and_line set_current_source_symtab_and_line /* Reset any information stored about a default file and line to print. */ extern void clear_current_source_symtab_and_line (program_space *pspace); +extern void clear_current_source_symtab_and_line (objfile *objfile); /* Add a source path substitution rule. */ extern void add_substitute_path_rule (const char *, const char *); |