mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
[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>
This commit is contained in:
@@ -1447,7 +1447,7 @@ ada_task_list_changed (struct inferior *inf)
|
||||
static void
|
||||
ada_tasks_invalidate_pspace_data (struct program_space *pspace)
|
||||
{
|
||||
get_ada_tasks_pspace_data (pspace)->initialized_p = 0;
|
||||
ada_tasks_pspace_data_handle.clear (pspace);
|
||||
}
|
||||
|
||||
/* Invalidate the per-inferior data. */
|
||||
@@ -1455,10 +1455,7 @@ ada_tasks_invalidate_pspace_data (struct program_space *pspace)
|
||||
static void
|
||||
ada_tasks_invalidate_inferior_data (struct inferior *inf)
|
||||
{
|
||||
struct ada_tasks_inferior_data *data = get_ada_tasks_inferior_data (inf);
|
||||
|
||||
data->known_tasks_kind = ADA_TASKS_UNKNOWN;
|
||||
data->task_list_valid_p = false;
|
||||
ada_tasks_inferior_data_handle.clear (inf);
|
||||
}
|
||||
|
||||
/* The 'normal_stop' observer notification callback. */
|
||||
|
||||
Reference in New Issue
Block a user