]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Make 'info sharedlibrary' more readable with CHERI.
authorJohn Baldwin <jhb@FreeBSD.org>
Mon, 6 Mar 2017 21:55:05 +0000 (13:55 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 1 Sep 2022 23:43:06 +0000 (16:43 -0700)
In particular, use the smaller of address or pointer bit count to determine
the size of the address field.

gdb/solib.c

index adeb3a1a411e4658e48d7be789b495b3c9a8ee44..7618cde05b112ae001c64c07e34ee229fec5e01c 100644 (file)
@@ -1036,7 +1036,8 @@ info_sharedlibrary_command (const char *pattern, int from_tty)
     }
 
   /* "0x", a little whitespace, and two hex digits per byte of pointers.  */
-  addr_width = 4 + (gdbarch_ptr_bit (gdbarch) / 4);
+  addr_width = 4 + (std::min (gdbarch_ptr_bit (gdbarch),
+                             gdbarch_addr_bit (gdbarch)) / 4);
 
   update_solib_list (from_tty);