This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
i386-linux-tdep.c cleanup
- To: gdb-patches at sources dot redhat dot com
- Subject: i386-linux-tdep.c cleanup
- From: Mark Kettenis <kettenis at science dot uva dot nl>
- Date: Tue, 13 Mar 2001 13:43:27 +0100 (MET)
FYI, I checked in the attached patch.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* i386-linux-tdep.c: Fix formatting and clarify comments.
(i386_linux_svr4_fetch_link_map_offsets): Use NULL instead of 0
where appropriate.
Index: i386-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-tdep.c,v
retrieving revision 1.4
diff -u -r1.4 i386-linux-tdep.c
--- i386-linux-tdep.c 2001/03/01 01:39:20 1.4
+++ i386-linux-tdep.c 2001/03/13 12:39:44
@@ -28,8 +28,9 @@
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
-#include "solib-svr4.h" /* for struct link_map_offsets */
+#include "solib-svr4.h" /* For struct link_map_offsets. */
+
/* Recognizing signal handler frames. */
@@ -374,32 +375,31 @@
return 0;
}
+
+/* Fetch (and possibly build) an appropriate link_map_offsets
+ structure for native Linux/x86 targets using the struct offsets
+ defined in link.h (but without actual reference to that file).
-/* Fetch (and possibly build) an appropriate link_map_offsets structure
- for native i386 linux targets using the struct offsets defined in
- link.h (but without actual reference to that file).
-
- This makes it possible to access i386-linux shared libraries from
- a gdb that was not built on an i386-linux host (for cross debugging).
- */
+ This makes it possible to access Linux/x86 shared libraries from a
+ GDB that was not built on an Linux/x86 host (for cross debugging). */
struct link_map_offsets *
i386_linux_svr4_fetch_link_map_offsets (void)
{
static struct link_map_offsets lmo;
- static struct link_map_offsets *lmp = 0;
+ static struct link_map_offsets *lmp = NULL;
- if (lmp == 0)
+ if (lmp == NULL)
{
lmp = &lmo;
-
- lmo.r_debug_size = 8; /* 20 not actual size but all we need */
+ lmo.r_debug_size = 8; /* The actual size is 20 bytes, but
+ this is all we need. */
lmo.r_map_offset = 4;
lmo.r_map_size = 4;
- lmo.link_map_size = 20; /* 552 not actual size but all we need */
-
+ lmo.link_map_size = 20; /* The actual size is 552 bytes, but
+ this is all we need. */
lmo.l_addr_offset = 0;
lmo.l_addr_size = 4;
@@ -413,6 +413,5 @@
lmo.l_prev_size = 4;
}
- return lmp;
+ return lmp;
}
-