public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-sergiodj-stap-patch-split: Fixing PPC register name bug
@ 2011-08-23 18:38 sergiodj
  0 siblings, 0 replies; only message in thread
From: sergiodj @ 2011-08-23 18:38 UTC (permalink / raw)
  To: archer-commits

The branch, archer-sergiodj-stap-patch-split has been updated
       via  9bb56d8572ce86406767a07ac26c11e5a1d3af00 (commit)
      from  13dafbd95444a555a354085a0e7a65b76a185450 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 9bb56d8572ce86406767a07ac26c11e5a1d3af00
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date:   Tue Aug 23 15:38:20 2011 -0300

    Fixing PPC register name bug

-----------------------------------------------------------------------

Summary of changes:
 gdb/stap-probe.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

First 500 lines of diff:
diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c
index a9cfdde..028e99a 100644
--- a/gdb/stap-probe.c
+++ b/gdb/stap-probe.c
@@ -1112,7 +1112,6 @@ stap_fetch_reg_value (struct stap_evaluation_info *eval_info,
   const char *start;
   struct gdbarch *gdbarch = eval_info->gdbarch;
   struct frame_info *frame = eval_info->frame;
-  enum stap_arg_bitness bitness = eval_info->bitness;
   char *regname;
   int len, regnum, indirect_p = 0;
   struct value *ret = NULL;
@@ -1190,8 +1189,19 @@ stap_fetch_reg_value (struct stap_evaluation_info *eval_info,
       eval_info->exp_buf += reg_ind_sufix_len;
     }
 
-  regname = alloca (len + 1);
-  strncpy (regname, start, len);
+  regname = alloca (len + 2);
+
+  /* For PPC we have to insert a leading `r' before the register name,
+     so (unfortunately) we need to do this "hard coded if" here.  */
+  if (gdbarch_bfd_arch_info (gdbarch)->arch == bfd_arch_powerpc)
+    {
+      ++len;
+      regname[0] = 'r';
+      strncpy (regname + 1, start, len);
+    }
+  else
+    strncpy (regname, start, len);
+
   regname[len] = '\0';
 
   regnum = user_reg_map_name_to_regnum (gdbarch, regname, len);
@@ -1270,6 +1280,7 @@ stap_fetch_reg_value (struct stap_evaluation_info *eval_info,
     {
       struct type *t = NULL;
       enum agent_op aop = aop_ref32;
+      enum stap_arg_bitness bitness = eval_info->bitness;
 
       /* If the user has specified that the register must be indirected,
 	 we should know what's the correct type to cast it before making


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-23 18:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-23 18:38 [SCM] archer-sergiodj-stap-patch-split: Fixing PPC register name bug sergiodj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).