This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] info sharedlibrary fix
- From: Michael Snyder <msnyder at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: kevinb at redhat dot com
- Date: Mon, 7 Jan 2002 11:55:48 -0800
- Subject: [RFA] info sharedlibrary fix
There are two changes here, but they're related.
1) Use TARGET_PTR_BIT instead of bfd_get_arch_size to distinguish
32 bit vs. 64 bit inferior. This was introduced primarily to tell the
difference between a 32 bit process and a 64 bit process on Sparc64
Solaris.
2) Since we really don't have to have an exec_bfd, don't bail out
just because there isn't one. This allows the command (info shared)
to work when we attach to an anonymous process.
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.
Index: solib.c
===================================================================
RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.46
diff -p -r1.46 solib.c
*** solib.c 2001/12/04 09:34:56 1.46
--- solib.c 2002/01/07 19:56:17
*************** info_sharedlibrary_command (char *ignore
*** 620,634 ****
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)
--- 620,626 ----
char *addr_fmt;
int arch_size;
! arch_size = TARGET_PTR_BIT;
/* Default to 32-bit in case of failure. */
if (arch_size == 32 || arch_size == -1)