public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM] archer-sergiodj-stap: Implementing register displacement.
@ 2011-03-14 16:36 sergiodj
0 siblings, 0 replies; only message in thread
From: sergiodj @ 2011-03-14 16:36 UTC (permalink / raw)
To: archer-commits
The branch, archer-sergiodj-stap has been updated
via db8741de52747811e3d80857aa9470458c4d626b (commit)
from fe14f2b3be3b8360e7aa4a566f764c84747021b4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit db8741de52747811e3d80857aa9470458c4d626b
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Mon Mar 14 13:35:53 2011 -0300
Implementing register displacement.
This commit also does some cleanups.
-----------------------------------------------------------------------
Summary of changes:
gdb/stap-probe.c | 29 ++++++++++++++++++++++-------
1 files changed, 22 insertions(+), 7 deletions(-)
First 500 lines of diff:
diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c
index 2e54d79..12316a7 100644
--- a/gdb/stap-probe.c
+++ b/gdb/stap-probe.c
@@ -973,8 +973,8 @@ stap_fetch_reg_value (char **p, struct gdbarch *gdbarch,
break;
}
-// if (displacement)
-// ret = value_
+ if (displacement)
+ ret = value_ptradd (ret, value_as_long (displacement));
ret = value_cast (t, ret);
ret = value_ind (ret);
}
@@ -1035,6 +1035,7 @@ stap_parse_single_operand (char **p, struct gdbarch *gdbarch,
res = value_from_longest (builtin_type (gdbarch)->builtin_int,
number);
+ ep_skip_leading_whitespace (&s);
if (*s && *s == '(' && s[1] == '%')
res = stap_fetch_reg_value (&s, gdbarch, bitness,
frame, res);
@@ -1092,14 +1093,11 @@ stap_evaluate_probe_argument_2 (char **expr,
}
}
- while (1)
+ while (s && *s && *s != ')')
{
enum exp_opcode opcode;
int cur_prec;
- if (!*s || *s == ')')
- break;
-
if (!stap_is_operator (s))
; /*ERROR*/
@@ -1164,11 +1162,28 @@ stap_evaluate_probe_argument_1 (struct objfile *objfile,
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
char *s = (char *) probe->parsed_args->arg[n].arg_str;
- struct value *res;
+ struct value *res, *vs[4];
+#if 0 /*TESTING*/
+ const char *args[4] = { "2",
+ "2 + 3",
+ "(2 + 3)",
+ "((2) * 3) / (1 + 1)" };
+ int i;
+#endif
res = stap_evaluate_probe_argument_2 (&s, gdbarch, frame,
probe->parsed_args->arg[n].bitness,
/*lhs=*/NULL, /*prec=*/0);
+#if 0 /* TESTING */
+ for (i = 0; i < 4; i++)
+ {
+ vs[i] = stap_evaluate_probe_argument_2 ((char **) &(args[i]), gdbarch, frame,
+ probe->parsed_args->arg[n].bitness,
+ /*lhs=*/NULL, /*prec=*/0);
+
+ fprintf_unfiltered (gdb_stdout, "%ld\n", value_as_long (vs[i]));
+ }
+#endif
if (!res)
;/* ERROR */
hooks/post-receive
--
Repository for Project Archer.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-03-14 16:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-14 16:36 [SCM] archer-sergiodj-stap: Implementing register displacement 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).