aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-interp.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2023-09-29 22:59:22 -0400
committerSimon Marchi <simon.marchi@efficios.com>2023-10-19 10:57:51 -0400
commitbb86ab837e3c4eac98dba5618bf01894dd6b502a (patch)
tree1ae7227a5e21b5adc9f67e8ae187360c2818a043 /gdb/mi/mi-interp.c
parentc1d21880e981f3f890a74cd9d133e82b26c32818 (diff)
downloadgdb-bb86ab837e3c4eac98dba5618bf01894dd6b502a.zip
gdb-bb86ab837e3c4eac98dba5618bf01894dd6b502a.tar.gz
gdb-bb86ab837e3c4eac98dba5618bf01894dd6b502a.tar.bz2
gdb: replace some so_list parameters to use references
A subsequent patch changes so_list to be linked using intrusive_list. Iterating an intrusive_list yields some references to the list elements. Convert some functions accepting so_list objects to take references, to make things easier and more natural. Add const where possible and convenient. Change-Id: Id5ab5339c3eb6432e809ad14782952d6a45806f3 Approved-By: Pedro Alves <pedro@palves.net> Reviewed-By: Reviewed-By: Lancelot Six <lancelot.six@amd.com>
Diffstat (limited to 'gdb/mi/mi-interp.c')
-rw-r--r--gdb/mi/mi-interp.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 0d3c823..0fae567 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -724,28 +724,28 @@ mi_interp::on_target_resumed (ptid_t ptid)
/* See mi-interp.h. */
void
-mi_output_solib_attribs (ui_out *uiout, struct so_list *solib)
+mi_output_solib_attribs (ui_out *uiout, const so_list &solib)
{
gdbarch *gdbarch = current_inferior ()->arch ();
- uiout->field_string ("id", solib->so_original_name);
- uiout->field_string ("target-name", solib->so_original_name);
- uiout->field_string ("host-name", solib->so_name);
- uiout->field_signed ("symbols-loaded", solib->symbols_loaded);
+ uiout->field_string ("id", solib.so_original_name);
+ uiout->field_string ("target-name", solib.so_original_name);
+ uiout->field_string ("host-name", solib.so_name);
+ uiout->field_signed ("symbols-loaded", solib.symbols_loaded);
if (!gdbarch_has_global_solist (current_inferior ()->arch ()))
uiout->field_fmt ("thread-group", "i%d", current_inferior ()->num);
ui_out_emit_list list_emitter (uiout, "ranges");
ui_out_emit_tuple tuple_emitter (uiout, NULL);
- if (solib->addr_high != 0)
+ if (solib.addr_high != 0)
{
- uiout->field_core_addr ("from", gdbarch, solib->addr_low);
- uiout->field_core_addr ("to", gdbarch, solib->addr_high);
+ uiout->field_core_addr ("from", gdbarch, solib.addr_low);
+ uiout->field_core_addr ("to", gdbarch, solib.addr_high);
}
}
void
-mi_interp::on_solib_loaded (so_list *solib)
+mi_interp::on_solib_loaded (const so_list &solib)
{
ui_out *uiout = this->interp_ui_out ();
@@ -762,7 +762,7 @@ mi_interp::on_solib_loaded (so_list *solib)
}
void
-mi_interp::on_solib_unloaded (so_list *solib)
+mi_interp::on_solib_unloaded (const so_list &solib)
{
ui_out *uiout = this->interp_ui_out ();
@@ -773,9 +773,9 @@ mi_interp::on_solib_unloaded (so_list *solib)
ui_out_redirect_pop redir (uiout, this->event_channel);
- uiout->field_string ("id", solib->so_original_name);
- uiout->field_string ("target-name", solib->so_original_name);
- uiout->field_string ("host-name", solib->so_name);
+ uiout->field_string ("id", solib.so_original_name);
+ uiout->field_string ("target-name", solib.so_original_name);
+ uiout->field_string ("host-name", solib.so_name);
if (!gdbarch_has_global_solist (current_inferior ()->arch ()))
uiout->field_fmt ("thread-group", "i%d", current_inferior ()->num);