2002-01-07 Michael Snyder <msnyder@redhat.com>
authorMichael Snyder <msnyder@vmware.com>
Tue, 8 Jan 2002 18:55:26 +0000 (18:55 +0000)
committerMichael Snyder <msnyder@vmware.com>
Tue, 8 Jan 2002 18:55:26 +0000 (18:55 +0000)
* solib.c (info_sharedlibrary_command): Use TARGET_PTR_BIT
instead of bfd_get_arch_size.  Don't bail out just because
there's no exec_bfd.

gdb/ChangeLog
gdb/solib.c

index 8083aeb62a4d2b386e56ef89ee692566eb94b229..5f7936be2b917953768f6d4b921e16396c6650dc 100644 (file)
@@ -4,6 +4,10 @@
 
 2002-01-07  Michael Snyder  <msnyder@redhat.com>
 
+       * solib.c (info_sharedlibrary_command): Use TARGET_PTR_BIT
+       instead of bfd_get_arch_size.  Don't bail out just because
+       there's no exec_bfd.
+       
        * cp-valprint.c (cp_print_value): FIXME comment, alloca size.
        * p-valprint.c (pascal_object_print_value): Ditto.
        * somread.c (som_symtab_read): Ditto.
index ddf317146b752e16428f2022b645d960dca88afb..2aa87e342083255f64864805148f810af8f053d5 100644 (file)
@@ -618,25 +618,13 @@ info_sharedlibrary_command (char *ignore, int from_tty)
   int header_done = 0;
   int addr_width;
   char *addr_fmt;
-  int arch_size;
 
-  if (exec_bfd == NULL)
-    {
-      printf_unfiltered ("No executable file.\n");
-      return;
-    }
-
-  arch_size = bfd_get_arch_size (exec_bfd);
-  if (arch_size == -1)
-    arch_size = bfd_arch_bits_per_address(exec_bfd);
-
-  /* Default to 32-bit in case of failure.  */
-  if (arch_size == 32 || arch_size == -1)
+  if (TARGET_PTR_BIT == 32)
     {
       addr_width = 8 + 4;
       addr_fmt = "08l";
     }
-  else if (arch_size == 64)
+  else if (TARGET_PTR_BIT == 64)
     {
       addr_width = 16 + 4;
       addr_fmt = "016l";
@@ -644,8 +632,8 @@ info_sharedlibrary_command (char *ignore, int from_tty)
   else
     {
       internal_error (__FILE__, __LINE__,
-                     "bfd_get_arch_size() returned unknown size %d",
-                     arch_size);
+                     "TARGET_PTR_BIT returned unknown size %d",
+                     TARGET_PTR_BIT);
     }
 
   update_solib_list (from_tty, 0);