diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2017-10-14 09:09:21 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2017-10-14 09:09:22 -0400 |
commit | c9cb8905b489d094c6c42e103d4bc6e231e00cf0 (patch) | |
tree | b8bfecc29cc70d3e58901eff2a358ec824202437 /gdb/gdbserver/dll.h | |
parent | 2098b39391a5ade9ed308d76f2dfc7ceedd2d9a3 (diff) | |
download | gdb-c9cb8905b489d094c6c42e103d4bc6e231e00cf0.zip gdb-c9cb8905b489d094c6c42e103d4bc6e231e00cf0.tar.gz gdb-c9cb8905b489d094c6c42e103d4bc6e231e00cf0.tar.bz2 |
gdbserver: Use std::list for all_dlls
As a small step towards removing inferior_list/inferior_list_entry, this
patch replaces the usage of inferior_list for the list of dlls by an
std::list. The dll_info type now uses an std::string for name and has a
simple constructor.
I am able to build gdbserver with mingw on Linux, but I am not able to
test this on a Windows machine (the only platform that uses this code).
gdb/gdbserver/ChangeLog:
* dll.h: Include <list>.
(struct dll_info): Add constructor.
<entry>: Remove field.
(all_dlls): Change type to std::list<dll_info>.
* dll.c: Include <algorithm>.
(get_dll): Remove macro.
(all_dlls): Change type to std::list<dll_info *>.
(free_one_dll): Remove.
(match_dll): Likewise.
(loaded_dll): Adjust.
(unloaded_dll): Adjust to all_dlls type change, use
std::find_if. Inline code from match_dll.
(clear_dlls): Adjust to all_dlls type change.
* server.c (emit_dll_description): Remove.
(handle_qxfer_libraries): Adjust to all_dlls type change,
integrate emit_dll_description's functionality.
Diffstat (limited to 'gdb/gdbserver/dll.h')
-rw-r--r-- | gdb/gdbserver/dll.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gdb/gdbserver/dll.h b/gdb/gdbserver/dll.h index 39e5eb0..4956efb 100644 --- a/gdb/gdbserver/dll.h +++ b/gdb/gdbserver/dll.h @@ -18,17 +18,19 @@ #ifndef DLL_H #define DLL_H +#include <list> + struct dll_info { - /* This must appear first. See inferiors.h. - The list iterator functions assume it. */ - struct inferior_list_entry entry; + dll_info (const std::string &name_, CORE_ADDR base_addr_) + : name (name_), base_addr (base_addr_) + {} - char *name; + std::string name; CORE_ADDR base_addr; }; -extern struct inferior_list all_dlls; +extern std::list<dll_info> all_dlls; extern int dlls_changed; extern void clear_dlls (void); |