OSDN Git Service

* arm-tdep.c (arm_pc_is_thumb): Use obj_section_addr.
authorpalves <palves>
Thu, 21 Aug 2008 13:19:17 +0000 (13:19 +0000)
committerpalves <palves>
Thu, 21 Aug 2008 13:19:17 +0000 (13:19 +0000)
* 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
gdb/arm-tdep.c
gdb/hppa-hpux-tdep.c
gdb/hppa-linux-tdep.c
gdb/hppa-tdep.c
gdb/hppabsd-tdep.c
gdb/ia64-tdep.c
gdb/solib-frv.c
gdb/xstormy16-tdep.c

index e76a369..b462641 100644 (file)
@@ -1,3 +1,18 @@
+2008-08-21  Pedro Alves  <pedro@codesourcery.com>
+
+       * 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  <hilfinger@adacore.com>
 
        * NEWS: Amplify last entry on boolean types in Ada.
index 66add04..ba18f9a 100644 (file)
@@ -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);
index 93d237c..1e5d1fb 100644 (file)
@@ -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
index ef6b65f..a5dc536 100644 (file)
@@ -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;
index ace04a3..11ef093 100644 (file)
@@ -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;
        }
     }
index c1d175b..d4b0e57 100644 (file)
@@ -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;
index 991cb06..186833a 100644 (file)
@@ -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;
index 3c844be..463722a 100644 (file)
@@ -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.  */
index eac5efd..5fcceb7 100644 (file)
@@ -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];