diff options
author | Sergio Durigan Junior <sergiodj@redhat.com> | 2013-06-30 00:35:39 +0000 |
---|---|---|
committer | Sergio Durigan Junior <sergiodj@redhat.com> | 2013-06-30 00:35:39 +0000 |
commit | e82839d425857fb5c30ec01faab12263baddfd99 (patch) | |
tree | fd0c52a3161470bcf3820db6e387b1d6b2f64945 | |
parent | 297ad641370a57108fdbb64f8db4c9f1b38b83c3 (diff) | |
download | gdb-e82839d425857fb5c30ec01faab12263baddfd99.zip gdb-e82839d425857fb5c30ec01faab12263baddfd99.tar.gz gdb-e82839d425857fb5c30ec01faab12263baddfd99.tar.bz2 |
This patch implements the support for SystemTap SDT probes on IA-64.
Joel Brobecker reported a bug which was happening because of the
"Improved linker-debugger interface", by Gary Benson, when tested on
IA-64 with rhES5. The message is:
<http://sourceware.org/ml/gdb-patches/2013-06/msg00745.html>
The failure happened because GDB was trying to parse the probes'
operands using only the generic parser (implemented on stap-probe.c),
because the arch-specific parser was not implemented. Thus, I am
committing the following changes which solve the bug.
2013-06-29 Sergio Durigan Junior <sergiodj@redhat.com>
* ia64-linux-tdep.c: Include <ctype.h>.
(ia64_linux_stap_is_single_operand): New function.
(ia64_linux_init_abi): Initialize SystemTap related attributes.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/ia64-linux-tdep.c | 21 |
2 files changed, 27 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index adcaf5d..fa1da5a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2013-06-29 Sergio Durigan Junior <sergiodj@redhat.com> + + * ia64-linux-tdep.c: Include <ctype.h>. + (ia64_linux_stap_is_single_operand): New function. + (ia64_linux_init_abi): Initialize SystemTap related attributes. + 2013-06-28 Tom Tromey <tromey@redhat.com> * Makefile.in (version.c): Use version.in, not diff --git a/gdb/ia64-linux-tdep.c b/gdb/ia64-linux-tdep.c index 35ee4e2..d1eb529 100644 --- a/gdb/ia64-linux-tdep.c +++ b/gdb/ia64-linux-tdep.c @@ -27,6 +27,8 @@ #include "symtab.h" #include "linux-tdep.h" +#include <ctype.h> + /* The sigtramp code is in a non-readable (executable-only) region of memory called the ``gate page''. The addresses in question were determined by examining the system headers. They are @@ -118,6 +120,17 @@ ia64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc) regcache_cooked_write_unsigned (regcache, IA64_GR10_REGNUM, 0); } +/* Implementation of `gdbarch_stap_is_single_operand', as defined in + gdbarch.h. */ + +static int +ia64_linux_stap_is_single_operand (struct gdbarch *gdbarch, const char *s) +{ + return ((isdigit (*s) && s[1] == '[' && s[2] == 'r') /* Displacement. */ + || *s == 'r' /* Register value. */ + || isdigit (*s)); /* Literal number. */ +} + static void ia64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -142,6 +155,14 @@ ia64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Enable TLS support. */ set_gdbarch_fetch_tls_load_module_address (gdbarch, svr4_fetch_objfile_link_map); + + /* SystemTap related. */ + set_gdbarch_stap_register_prefix (gdbarch, "r"); + set_gdbarch_stap_register_indirection_prefix (gdbarch, "["); + set_gdbarch_stap_register_indirection_suffix (gdbarch, "]"); + set_gdbarch_stap_gdb_register_prefix (gdbarch, "r"); + set_gdbarch_stap_is_single_operand (gdbarch, + ia64_linux_stap_is_single_operand); } /* Provide a prototype to silence -Wmissing-prototypes. */ |