This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
PATCH: Add SIZEOF_N_SECTION_OFFSETS macro
- From: Jim Blandy <jimb at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: 25 Nov 2002 15:12:42 -0500
- Subject: PATCH: Add SIZEOF_N_SECTION_OFFSETS macro
2002-11-25 Jim Blandy <jimb@redhat.com>
* symtab.h (SIZEOF_N_SECTION_OFFSETS): New macro.
(SIZEOF_SECTION_OFFSETS): Use SIZEOF_N_SECTION_OFFSETS.
Index: gdb/symtab.h
===================================================================
RCS file: /cvs/src/src/gdb/symtab.h,v
retrieving revision 1.51
diff -c -r1.51 symtab.h
*** gdb/symtab.h 28 Oct 2002 17:05:56 -0000 1.51
--- gdb/symtab.h 25 Nov 2002 20:28:51 -0000
***************
*** 803,813 ****
? (internal_error (__FILE__, __LINE__, "Section index is uninitialized"), -1) \
: secoff->offsets[whichone])
! /* The maximum possible size of a section_offsets table. */
!
! #define SIZEOF_SECTION_OFFSETS \
(sizeof (struct section_offsets) \
! + sizeof (((struct section_offsets *) 0)->offsets) * (SECT_OFF_MAX-1))
/* Each source file or header is represented by a struct symtab.
These objects are chained through the `next' field. */
--- 803,815 ----
? (internal_error (__FILE__, __LINE__, "Section index is uninitialized"), -1) \
: secoff->offsets[whichone])
! /* The size of a section_offsets table for N sections. */
! #define SIZEOF_N_SECTION_OFFSETS(n) \
(sizeof (struct section_offsets) \
! + sizeof (((struct section_offsets *) 0)->offsets) * ((n)-1))
!
! /* The maximum possible size of a section_offsets table. */
! #define SIZEOF_SECTION_OFFSETS (SIZEOF_N_SECTION_OFFSETS (SECT_OFF_MAX))
/* Each source file or header is represented by a struct symtab.
These objects are chained through the `next' field. */