From: Andrew Burgess Date: Tue, 10 Mar 2026 16:20:46 +0000 (+0000) Subject: gdb: remove 'num' argument from gdbarch_read_core_file_mappings callback X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e0330b0d12e28f022976e807925be644f816af7;p=thirdparty%2Fbinutils-gdb.git gdb: remove 'num' argument from gdbarch_read_core_file_mappings callback The gdbarch_read_core_file_mappings method takes two callback functions. The second of these, the loop_cb takes a 'num' parameter that is never used. It's not entirely clear what this 'num' represents, and in later commits I'm going to be tweaking what gets sent through this callback, and it's not clear to me how 'num' should be changed. So let's just remove the 'num' argument, this will make the later commits easier. Reviewed-By: Keith Seitz --- diff --git a/gdb/corelow.c b/gdb/corelow.c index d2e352fd5c1..e8e3e85e0c9 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -2176,7 +2176,7 @@ gdb_read_core_file_mappings (struct gdbarch *gdbarch, struct bfd *cbfd) /* read_core_file_mappings will invoke this lambda for each mapping that it finds. */ - [&] (int num, ULONGEST start, ULONGEST end, ULONGEST file_ofs, + [&] (ULONGEST start, ULONGEST end, ULONGEST file_ofs, const char *filename, const bfd_build_id *build_id) { /* Architecture-specific read_core_mapping methods are expected to diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index b0b17afc6af..f5ee3074c38 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -128,8 +128,7 @@ using read_core_file_mappings_pre_loop_ftype = gdb::function_view; using read_core_file_mappings_loop_ftype = - gdb::function_viewtable_header (0, ui_left, "objfile", "File"); current_uiout->table_body (); }, - [=] (int num, ULONGEST start, ULONGEST end, ULONGEST file_ofs, + [=] (ULONGEST start, ULONGEST end, ULONGEST file_ofs, const char *filename, const bfd_build_id *build_id) { ui_out_emit_tuple tuple_emitter (current_uiout, nullptr);