This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RFC: fix hard-coded section index in hppa-tdep.c
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 23 Jan 2013 13:42:30 -0700
- Subject: RFC: fix hard-coded section index in hppa-tdep.c
hppa-tdep.c passes 0 as the section index argument to ANOFFSET. This
works ok since this is often the index of the text section. However,
there's not really any requirement that this be true (it is true for SOM
due to how somread.c is currently written, but I doubt it is guaranteed
for other formats on HPPA).
This patch fixes the problem in the obvious way.
I built and tested this on HPUX as part of a much larger patch series.
However, I thought it was an obvious fix on its own.
In the absence of comments I plan to check it in after a few days.
Tom
* hppa-tdep.c (read_unwind_info): Use SECT_OFF_TEXT, not "0".
---
gdb/hppa-tdep.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index c82ea55..837b10c 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -327,7 +327,7 @@ read_unwind_info (struct objfile *objfile)
struct hppa_unwind_info *ui;
struct hppa_objfile_private *obj_private;
- text_offset = ANOFFSET (objfile->section_offsets, 0);
+ text_offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
ui = (struct hppa_unwind_info *) obstack_alloc (&objfile->objfile_obstack,
sizeof (struct hppa_unwind_info));
--
1.7.7.6