gdb: rename svr4_same_1 -> svr4_same_name

This makes it a bit clearer that it compares shared libraries by name.

While at it, change the return type to bool.

Change-Id: Ib11a931a0cd2e00bf6ae35c5b6e0d620298d46cb
Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
This commit is contained in:
Simon Marchi
2025-07-28 15:34:53 -04:00
committed by Simon Marchi
parent 3a1af46138
commit 77c87c12b3

View File

@@ -122,11 +122,11 @@ get_lm_info_svr4 (const solib &solib)
return gdb::checked_static_cast<lm_info_svr4 &> (*solib.lm_info); return gdb::checked_static_cast<lm_info_svr4 &> (*solib.lm_info);
} }
/* Return non-zero if GDB_SO_NAME and INFERIOR_SO_NAME represent /* Return true if GDB_SO_NAME and INFERIOR_SO_NAME represent the same shared
the same shared library. */ library. */
static int static bool
svr4_same_1 (const char *gdb_so_name, const char *inferior_so_name) svr4_same_name (const char *gdb_so_name, const char *inferior_so_name)
{ {
if (strcmp (gdb_so_name, inferior_so_name) == 0) if (strcmp (gdb_so_name, inferior_so_name) == 0)
return 1; return 1;
@@ -159,7 +159,7 @@ svr4_same (const char *gdb_name, const char *inferior_name,
const lm_info_svr4 &gdb_lm_info, const lm_info_svr4 &gdb_lm_info,
const lm_info_svr4 &inferior_lm_info) const lm_info_svr4 &inferior_lm_info)
{ {
if (!svr4_same_1 (gdb_name, inferior_name)) if (!svr4_same_name (gdb_name, inferior_name))
return false; return false;
/* There may be different instances of the same library, in different /* There may be different instances of the same library, in different
@@ -2586,7 +2586,7 @@ svr4_solib_ops::enable_break (svr4_info *info, int from_tty) const
address from the shared library table. */ address from the shared library table. */
for (const solib &so : current_program_space->solibs ()) for (const solib &so : current_program_space->solibs ())
{ {
if (svr4_same_1 (interp_name, so.original_name.c_str ())) if (svr4_same_name (interp_name, so.original_name.c_str ()))
{ {
load_addr_found = 1; load_addr_found = 1;
loader_found_in_list = 1; loader_found_in_list = 1;