From aded6f54f0cb9d9b44d72d06af7b940cdeb1876b Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 21 Aug 2008 13:19:18 +0000 Subject: [PATCH] * arm-tdep.c (arm_pc_is_thumb): Use obj_section_addr. * hppa-hpux-tdep.c (hppa_hpux_find_dummy_bpaddr): Likewise. * hppa-linux-tdep.c (hppa_linux_find_global_pointer): Use obj_section_addr and obj_section_endaddr. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Likewise. * hppabsd-tdep.c (hppabsd_find_global_pointer): Likewise. * ia64-tdep.c (ia64_find_global_pointer): Likewise. (find_extant_func_descr): Likewise. * solib-frv.c (frv_relocate_main_executable): Use obj_section_addr. * xstormy16-tdep.c (xstormy16_find_jmp_table_entry): Use obj_section_addr and obj_section_endaddr. --- gdb/ChangeLog | 15 +++++++++++++++ gdb/arm-tdep.c | 3 ++- gdb/hppa-hpux-tdep.c | 4 ++-- gdb/hppa-linux-tdep.c | 8 +++++--- gdb/hppa-tdep.c | 10 ++++++---- gdb/hppabsd-tdep.c | 5 +++-- gdb/ia64-tdep.c | 16 ++++++++++------ gdb/solib-frv.c | 2 +- gdb/xstormy16-tdep.c | 9 ++++++--- 9 files changed, 50 insertions(+), 22 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e76a3698471..b4626418a04 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,18 @@ +2008-08-21 Pedro Alves + + * arm-tdep.c (arm_pc_is_thumb): Use obj_section_addr. + * hppa-hpux-tdep.c (hppa_hpux_find_dummy_bpaddr): Likewise. + * hppa-linux-tdep.c (hppa_linux_find_global_pointer): Use + obj_section_addr and obj_section_endaddr. + * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Likewise. + * hppabsd-tdep.c (hppabsd_find_global_pointer): Likewise. + * ia64-tdep.c (ia64_find_global_pointer): Likewise. + (find_extant_func_descr): Likewise. + * solib-frv.c (frv_relocate_main_executable): Use + obj_section_addr. + * xstormy16-tdep.c (xstormy16_find_jmp_table_entry): Use + obj_section_addr and obj_section_endaddr. + 2008-08-21 Paul N. Hilfinger * NEWS: Amplify last entry on boolean types in Ada. diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 66add047d4b..ba18f9a9bf2 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -303,7 +303,8 @@ arm_pc_is_thumb (CORE_ADDR memaddr) { struct arm_per_objfile *data; VEC(arm_mapping_symbol_s) *map; - struct arm_mapping_symbol map_key = { memaddr - sec->addr, 0 }; + struct arm_mapping_symbol map_key = { memaddr - obj_section_addr (sec), + 0 }; unsigned int idx; data = objfile_data (sec->objfile, arm_objfile_data_key); diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c index 93d237cd724..1e5d1fbeb31 100644 --- a/gdb/hppa-hpux-tdep.c +++ b/gdb/hppa-hpux-tdep.c @@ -1068,9 +1068,9 @@ hppa_hpux_find_dummy_bpaddr (CORE_ADDR addr) { /* First try the lowest address in the section; we can use it as long as it is "regular" code (i.e. not a stub) */ - u = find_unwind_entry (sec->addr); + u = find_unwind_entry (obj_section_addr (sec)); if (!u || u->stub_unwind.stub_type == 0) - return sec->addr; + return obj_section_addr (sec); /* Otherwise, we need to find a symbol for a regular function. We do this by walking the list of msymbols in the objfile. The symbol diff --git a/gdb/hppa-linux-tdep.c b/gdb/hppa-linux-tdep.c index ef6b65fa174..a5dc536ec69 100644 --- a/gdb/hppa-linux-tdep.c +++ b/gdb/hppa-linux-tdep.c @@ -365,10 +365,12 @@ hppa_linux_find_global_pointer (struct gdbarch *gdbarch, struct value *function) if (osect < faddr_sect->objfile->sections_end) { - CORE_ADDR addr; + CORE_ADDR addr, endaddr; - addr = osect->addr; - while (addr < osect->endaddr) + addr = obj_section_addr (osect); + endaddr = obj_section_endaddr (osect); + + while (addr < endaddr) { int status; LONGEST tag; diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index ace04a3d93d..11ef0934d79 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -912,15 +912,17 @@ hppa64_convert_code_addr_to_fptr (CORE_ADDR code) ALL_OBJFILE_OSECTIONS (sec->objfile, opd) { if (strcmp (opd->the_bfd_section->name, ".opd") == 0) - break; + break; } if (opd < sec->objfile->sections_end) { CORE_ADDR addr; - for (addr = opd->addr; addr < opd->endaddr; addr += 2 * 8) - { + for (addr = obj_section_addr (opd); + addr < obj_section_endaddr (opd); + addr += 2 * 8) + { ULONGEST opdaddr; char tmp[8]; @@ -928,7 +930,7 @@ hppa64_convert_code_addr_to_fptr (CORE_ADDR code) break; opdaddr = extract_unsigned_integer (tmp, sizeof (tmp)); - if (opdaddr == code) + if (opdaddr == code) return addr - 16; } } diff --git a/gdb/hppabsd-tdep.c b/gdb/hppabsd-tdep.c index c1d175b5848..d4b0e5752ac 100644 --- a/gdb/hppabsd-tdep.c +++ b/gdb/hppabsd-tdep.c @@ -61,9 +61,10 @@ hppabsd_find_global_pointer (struct gdbarch *gdbarch, struct value *function) if (sec < faddr_sec->objfile->sections_end) { - CORE_ADDR addr = sec->addr; + CORE_ADDR addr = obj_section_addr (sec); + CORE_ADDR endaddr = obj_section_endaddr (sec); - while (addr < sec->endaddr) + while (addr < endaddr) { gdb_byte buf[4]; LONGEST tag; diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 991cb06eb2b..186833ad6b3 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -3095,10 +3095,12 @@ ia64_find_global_pointer (CORE_ADDR faddr) if (osect < faddr_sect->objfile->sections_end) { - CORE_ADDR addr; + CORE_ADDR addr, endaddr; - addr = osect->addr; - while (addr < osect->endaddr) + addr = obj_section_addr (osect); + endaddr = obj_section_endaddr (osect); + + while (addr < endaddr) { int status; LONGEST tag; @@ -3156,10 +3158,12 @@ find_extant_func_descr (CORE_ADDR faddr) if (osect < faddr_sect->objfile->sections_end) { - CORE_ADDR addr; + CORE_ADDR addr, endaddr; + + addr = obj_section_addr (osect); + endaddr = obj_section_endaddr (osect); - addr = osect->addr; - while (addr < osect->endaddr) + while (addr < endaddr) { int status; LONGEST faddr2; diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c index 3c844befe1f..463722ab18b 100644 --- a/gdb/solib-frv.c +++ b/gdb/solib-frv.c @@ -908,7 +908,7 @@ frv_relocate_main_executable (void) osect_idx = osect->the_bfd_section->index; /* Current address of section. */ - addr = osect->addr; + addr = obj_section_addr (osect); /* Offset from where this section started. */ offset = ANOFFSET (symfile_objfile->section_offsets, osect_idx); /* Original address prior to any past relocations. */ diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index eac5efdccec..5fcceb723ed 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -550,9 +550,12 @@ xstormy16_find_jmp_table_entry (CORE_ADDR faddr) if (osect < faddr_sect->objfile->sections_end) { - CORE_ADDR addr; - for (addr = osect->addr; - addr < osect->endaddr; addr += 2 * xstormy16_inst_size) + CORE_ADDR addr, endaddr; + + addr = obj_section_addr (osect); + endaddr = obj_section_endaddr (osect); + + for (; addr < endaddr; addr += 2 * xstormy16_inst_size) { LONGEST inst, inst2, faddr2; char buf[2 * xstormy16_inst_size]; -- 2.30.2