* exec.c (exec_file_attach): Fix comment.
[binutils-gdb.git] / gdb / xstormy16-tdep.c
index eac5efdccecc8cc38b106f12be2671742aabbb3e..b35ff11fefda5ab7c29666955bea0879652c7480 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for the Sanyo Xstormy16a (LC590000) processor.
 
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -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];