From: David Daney Date: Fri, 4 Feb 2011 18:34:43 +0000 (+0000) Subject: gdb/ X-Git-Tag: cgen-snapshot-20110301~78 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=385203ed4dec8e3515f691f497c9134d39f70e82;p=external%2Fbinutils.git gdb/ 2011-02-04 David Daney * mips-linux-tdep.c: Include xml-syscall.h. (mips_linux_get_syscall_number): New function. (mips_linux_init_abi): Add calls to mips_linux_get_syscall_number() and set_xml_syscall_file_name(). * data-directory/Makefile.in (SYSCALLS_FILES): Add mips-o32-linux.xml, mips-n32-linux.xml and mips-n64-linux.xml * syscalls/mips-n32-linux.xml: New file. * syscalls/mips-n64-linux.xml: New file. * syscalls/mips-o32-linux.xml: New file. gdb/testsuite/ 2011-02-04 David Daney * gdb.base/catch-syscall.exp: Enable for mips*-linux*. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9622483..f7a433c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2011-02-04 David Daney + + * mips-linux-tdep.c: Include xml-syscall.h. + (mips_linux_get_syscall_number): New function. + (mips_linux_init_abi): Add calls to + mips_linux_get_syscall_number() and set_xml_syscall_file_name(). + * data-directory/Makefile.in (SYSCALLS_FILES): Add + mips-o32-linux.xml, mips-n32-linux.xml and mips-n64-linux.xml + * syscalls/mips-n32-linux.xml: New file. + * syscalls/mips-n64-linux.xml: New file. + * syscalls/mips-o32-linux.xml: New file. + 2011-02-04 Ulrich Weigand * dwarf2read.c (dwarf2_ranges_read): Skip empty range entries. diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in index 565a837..11cf2e6 100644 --- a/gdb/data-directory/Makefile.in +++ b/gdb/data-directory/Makefile.in @@ -46,7 +46,8 @@ SYSCALLS_FILES = \ gdb-syscalls.dtd \ ppc-linux.xml ppc64-linux.xml \ i386-linux.xml amd64-linux.xml \ - sparc-linux.xml sparc64-linux.xml + sparc-linux.xml sparc64-linux.xml \ + mips-o32-linux.xml mips-n32-linux.xml mips-n64-linux.xml PYTHON_DIR = python PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR) diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index be346d7..c78d5d6 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -40,6 +40,7 @@ #include "mips-linux-tdep.h" #include "glibc-tdep.h" #include "linux-tdep.h" +#include "xml-syscall.h" static struct target_so_ops mips_svr4_so_ops; @@ -1207,6 +1208,38 @@ mips_linux_syscall_next_pc (struct frame_info *frame) return pc + 4; } +/* Return the current system call's number present in the + v0 register. When the function fails, it returns -1. */ + +static LONGEST +mips_linux_get_syscall_number (struct gdbarch *gdbarch, + ptid_t ptid) +{ + struct regcache *regcache = get_thread_regcache (ptid); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); + int regsize = register_size (gdbarch, MIPS_V0_REGNUM); + /* The content of a register */ + gdb_byte buf[8]; + /* The result */ + LONGEST ret; + + /* Make sure we're in a known ABI */ + gdb_assert (tdep->mips_abi == MIPS_ABI_O32 + || tdep->mips_abi == MIPS_ABI_N32 + || tdep->mips_abi == MIPS_ABI_N64); + + gdb_assert (regsize <= sizeof (buf)); + + /* Getting the system call number from the register. + syscall number is in v0 or $2. */ + regcache_cooked_read (regcache, MIPS_V0_REGNUM, buf); + + ret = extract_signed_integer (buf, regsize, byte_order); + + return ret; +} + /* Initialize one of the GNU/Linux OS ABIs. */ static void @@ -1219,6 +1252,9 @@ mips_linux_init_abi (struct gdbarch_info info, linux_init_abi (info, gdbarch); + /* Get the syscall number from the arch's register. */ + set_gdbarch_get_syscall_number (gdbarch, mips_linux_get_syscall_number); + switch (abi) { case MIPS_ABI_O32: @@ -1228,6 +1264,7 @@ mips_linux_init_abi (struct gdbarch_info info, (gdbarch, svr4_ilp32_fetch_link_map_offsets); tramp_frame_prepend_unwinder (gdbarch, &mips_linux_o32_sigframe); tramp_frame_prepend_unwinder (gdbarch, &mips_linux_o32_rt_sigframe); + set_xml_syscall_file_name ("syscalls/mips-o32-linux.xml"); break; case MIPS_ABI_N32: set_gdbarch_get_longjmp_target (gdbarch, @@ -1241,6 +1278,7 @@ mips_linux_init_abi (struct gdbarch_info info, does not distinguish between quiet and signalling NaNs). */ set_gdbarch_long_double_format (gdbarch, floatformats_ia64_quad); tramp_frame_prepend_unwinder (gdbarch, &mips_linux_n32_rt_sigframe); + set_xml_syscall_file_name ("syscalls/mips-n32-linux.xml"); break; case MIPS_ABI_N64: set_gdbarch_get_longjmp_target (gdbarch, @@ -1254,6 +1292,7 @@ mips_linux_init_abi (struct gdbarch_info info, does not distinguish between quiet and signalling NaNs). */ set_gdbarch_long_double_format (gdbarch, floatformats_ia64_quad); tramp_frame_prepend_unwinder (gdbarch, &mips_linux_n64_rt_sigframe); + set_xml_syscall_file_name ("syscalls/mips-n64-linux.xml"); break; default: break; diff --git a/gdb/syscalls/mips-n32-linux.xml b/gdb/syscalls/mips-n32-linux.xml new file mode 100644 index 0000000..da4aba2 --- /dev/null +++ b/gdb/syscalls/mips-n32-linux.xml @@ -0,0 +1,319 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdb/syscalls/mips-n64-linux.xml b/gdb/syscalls/mips-n64-linux.xml new file mode 100644 index 0000000..fc951c8 --- /dev/null +++ b/gdb/syscalls/mips-n64-linux.xml @@ -0,0 +1,312 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdb/syscalls/mips-o32-linux.xml b/gdb/syscalls/mips-o32-linux.xml new file mode 100644 index 0000000..939ed4e --- /dev/null +++ b/gdb/syscalls/mips-o32-linux.xml @@ -0,0 +1,347 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a287e4b..e4db48b 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-02-04 David Daney + + * gdb.base/catch-syscall.exp: Enable for mips*-linux*. + 2011-02-03 Andrew Burgess * gdb.base/disasm-end-cu-1.c, gdb.base/disasm-end-cu-2.c, diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp index 2d14e91..d25df17 100644 --- a/gdb/testsuite/gdb.base/catch-syscall.exp +++ b/gdb/testsuite/gdb.base/catch-syscall.exp @@ -54,7 +54,8 @@ if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then { #if { ![istarget "i\[34567\]86-*-linux*"] if { ![istarget "x86_64-*-linux*"] && ![istarget "i\[34567\]86-*-linux*"] && ![istarget "powerpc-*-linux*"] && ![istarget "powerpc64-*-linux*"] - && ![istarget "sparc-*-linux*"] && ![istarget "sparc64-*-linux*"] } { + && ![istarget "sparc-*-linux*"] && ![istarget "sparc64-*-linux*"] + && ![istarget "mips*-linux*"] } { continue }