aboutsummaryrefslogtreecommitdiff
path: root/gdb/solist.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-10-02 15:17:04 -0400
committerSimon Marchi <simon.marchi@efficios.com>2023-10-19 10:57:51 -0400
commit94d5c64878a75c573c98502497cd2118720e8bbe (patch)
treee3163ca07e984d59fe7922a54185dcd2ef997e89 /gdb/solist.h
parent539223dec932d76596d56ef23b4724b4f4438cc4 (diff)
downloadgdb-94d5c64878a75c573c98502497cd2118720e8bbe.zip
gdb-94d5c64878a75c573c98502497cd2118720e8bbe.tar.gz
gdb-94d5c64878a75c573c98502497cd2118720e8bbe.tar.bz2
gdb: allocate so_list with new, deallocate with delete
Initialize all fields in the class declaration, change allocations to use "new", change deallocations to use "delete". This is needed by a subsequent patches that use C++ stuff in so_list. Change-Id: I4b140d9f1ec9ff809554a056f76e3eb2b9e23222 Approved-By: Pedro Alves <pedro@palves.net> Reviewed-By: Reviewed-By: Lancelot Six <lancelot.six@amd.com>
Diffstat (limited to 'gdb/solist.h')
-rw-r--r--gdb/solist.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/gdb/solist.h b/gdb/solist.h
index 5d64890..8b80ed4 100644
--- a/gdb/solist.h
+++ b/gdb/solist.h
@@ -37,23 +37,23 @@ struct so_list
dynamic linker's tables in the inferior, and are initialized by
current_sos. */
- struct so_list *next; /* next structure in linked list */
+ struct so_list *next = nullptr; /* next structure in linked list */
/* A pointer to target specific link map information. Often this
will be a copy of struct link_map from the user process, but
it need not be; it can be any collection of data needed to
traverse the dynamic linker's data structures. */
- lm_info_base *lm_info;
+ lm_info_base *lm_info = nullptr;
/* Shared object file name, exactly as it appears in the
inferior's link map. This may be a relative path, or something
which needs to be looked up in LD_LIBRARY_PATH, etc. We use it
to tell which entries in the inferior's dynamic linker's link
map we've already loaded. */
- char so_original_name[SO_NAME_MAX_PATH_SIZE];
+ char so_original_name[SO_NAME_MAX_PATH_SIZE] {};
/* Shared object file name, expanded to something GDB can open. */
- char so_name[SO_NAME_MAX_PATH_SIZE];
+ char so_name[SO_NAME_MAX_PATH_SIZE] {};
/* The following fields of the structure are built from
information gathered from the shared object file itself, and
@@ -61,15 +61,15 @@ struct so_list
current_sos must initialize these fields to 0. */
- bfd *abfd;
- char symbols_loaded; /* flag: symbols read in yet? */
+ bfd *abfd = nullptr;
+ char symbols_loaded = 0; /* flag: symbols read in yet? */
/* objfile with symbols for a loaded library. Target memory is read from
ABFD. OBJFILE may be NULL either before symbols have been loaded, if
the file cannot be found or after the command "nosharedlibrary". */
- struct objfile *objfile;
+ struct objfile *objfile = nullptr;
- target_section_table *sections;
+ target_section_table *sections = nullptr;
/* Record the range of addresses belonging to this shared library.
There may not be just one (e.g. if two segments are relocated
@@ -77,7 +77,7 @@ struct so_list
the MI command "-file-list-shared-libraries". The latter has a format
that supports outputting multiple segments once the related code
supports them. */
- CORE_ADDR addr_low, addr_high;
+ CORE_ADDR addr_low = 0, addr_high = 0;
};
struct target_so_ops