This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] crasher in solib-legacy.c
- From: Michael Snyder <msnyder at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 7 Jan 2002 11:39:19 -0800
- Subject: [PATCH] crasher in solib-legacy.c
If you attach to a PID without specifying a symbol/exec file,
this code will be executed with exec_bfd == NULL.
2002-01-07 Michael Snyder <msnyder@redhat.com>
* solib-legacy.c (legacy_svr4_fetch_link_map_offsets):
Don't use exec_bfd if it's NULL.
Index: solib-legacy.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-legacy.c,v
retrieving revision 1.3
diff -p -r1.3 solib-legacy.c
*** solib-legacy.c 2001/03/20 02:57:42 1.3
--- solib-legacy.c 2002/01/07 19:41:42
*************** legacy_svr4_fetch_link_map_offsets (void
*** 130,136 ****
#endif /* defined (HAVE_STRUCT_LINK_MAP32) */
#if defined (HAVE_STRUCT_LINK_MAP32)
! if (bfd_get_arch_size (exec_bfd) == 32)
return lmp32;
else
#endif
--- 130,141 ----
#endif /* defined (HAVE_STRUCT_LINK_MAP32) */
#if defined (HAVE_STRUCT_LINK_MAP32)
! if (exec_bfd != NULL)
! {
! if (bfd_get_arch_size (exec_bfd) == 32)
! return lmp32;
! }
! else if (TARGET_PTR_BIT == 32)
return lmp32;
else
#endif