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

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

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

- Log -----------------------------------------------------------------
commit 13dafbd95444a555a354085a0e7a65b76a185450
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date:   Tue Aug 23 12:19:09 2011 -0300

    Fixing displacement bug

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

Summary of changes:
 gdb/stap-probe.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

First 500 lines of diff:
diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c
index c18d884..a9cfdde 100644
--- a/gdb/stap-probe.c
+++ b/gdb/stap-probe.c
@@ -1336,19 +1336,20 @@ stap_fetch_reg_value (struct stap_evaluation_info *eval_info,
 	  break;
 	}
 
-      ret = value_cast (t, ret);
-
       if (displacement)
 	{
-	  CORE_ADDR displ = value_as_long (displacement);
-
 	  if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
 	    {
-	      ax_const_l (eval_info->aexpr, displ);
+	      ax_const_l (eval_info->aexpr, value_as_long (displacement));
 	      ax_simple (eval_info->aexpr, aop_add);
 	    }
 	  else
-	    ret = value_ptradd (ret, displ / 4);
+	    {
+	      /* Casting it to `void *' before applying the displacement.  */
+	      ret = value_cast (builtin_type (gdbarch)->builtin_data_ptr,
+				ret);
+	      ret = value_ptradd (ret, value_as_long (displacement));
+	    }
 	}
 
       if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
@@ -1361,7 +1362,10 @@ stap_fetch_reg_value (struct stap_evaluation_info *eval_info,
 	  ax_simple (eval_info->aexpr, aop);
 	}
       else
-	ret = value_ind (ret);
+	{
+	  ret = value_cast (t, ret);
+	  ret = value_ind (ret);
+	}
     }
 
   return ret;
@@ -1448,7 +1452,7 @@ stap_evaluate_single_operand (struct stap_evaluation_info *eval_info)
 	  if (number)
 	    res
 	      = value_from_longest (builtin_type (gdbarch)->builtin_int,
-				    number);
+				    number * -1);
 
 	  eval_info->exp_buf = tmp;
 


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 15:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-23 15:19 [SCM] archer-sergiodj-stap-patch-split: Fixing displacement 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).