public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-sergiodj-stap: add symfile methods to handle probe arguments fix up remaining references to "marker"
@ 2011-02-09 19:00 tromey
  0 siblings, 0 replies; only message in thread
From: tromey @ 2011-02-09 19:00 UTC (permalink / raw)
  To: archer-commits

The branch, archer-sergiodj-stap has been updated
       via  9784d19c3df6d8b7871ccdc70e763ae9f51e5462 (commit)
      from  c2d7923ce7d90d98869311ecd522cb1254ebac2f (commit)

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

- Log -----------------------------------------------------------------
commit 9784d19c3df6d8b7871ccdc70e763ae9f51e5462
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed Feb 9 12:00:04 2011 -0700

    add symfile methods to handle probe arguments
    fix up remaining references to "marker"

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

Summary of changes:
 gdb/coffread.c   |    4 +++-
 gdb/dbxread.c    |    4 +++-
 gdb/elfread.c    |    8 ++++++--
 gdb/machoread.c  |    2 +-
 gdb/mipsread.c   |    4 +++-
 gdb/somread.c    |    2 +-
 gdb/stap-probe.c |   15 +++++++++++++--
 gdb/symfile.h    |   21 +++++++++++++++++++++
 gdb/xcoffread.c  |    4 +++-
 9 files changed, 54 insertions(+), 10 deletions(-)

First 500 lines of diff:
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 53ec503..0845fee 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -2199,7 +2199,9 @@ static const struct sym_fns coff_sym_fns =
 
   default_symfile_relocate,	/* sym_relocate: Relocate a debug
 				   section.  */
-  NULL,				/* sym_get_markers */
+  NULL,				/* sym_get_probes */
+  NULL,				/* sym_get_probe_argument_count */
+  NULL,				/* sym_evaluate_probe_argument */
   &psym_functions
 };
 
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 237e2eb..ad5387e 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -3593,7 +3593,9 @@ static const struct sym_fns aout_sym_fns =
   default_symfile_segments,	/* Get segment information from a file.  */
   NULL,
   default_symfile_relocate,	/* Relocate a debug section.  */
-  NULL,				/* sym_get_markers */
+  NULL,				/* sym_get_probes */
+  NULL,				/* sym_get_probe_argument_count */
+  NULL,				/* sym_evaluate_probe_argument */
   &psym_functions
 };
 
diff --git a/gdb/elfread.c b/gdb/elfread.c
index df1f558..a66547c 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -1063,7 +1063,9 @@ static const struct sym_fns elf_sym_fns =
   elf_symfile_segments,		/* Get segment information from a file.  */
   NULL,
   default_symfile_relocate,	/* Relocate a debug section.  */
-  NULL,				/* sym_get_markers */
+  NULL,				/* sym_get_probes */
+  NULL,				/* sym_get_probe_argument_count */
+  NULL,				/* sym_evaluate_probe_argument */
   &psym_functions
 };
 
@@ -1080,7 +1082,9 @@ static const struct sym_fns elf_sym_fns_gdb_index =
   elf_symfile_segments,		/* Get segment information from a file.  */
   NULL,
   default_symfile_relocate,	/* Relocate a debug section.  */
-  NULL,				/* sym_get_markers */
+  NULL,				/* sym_get_probes */
+  NULL,				/* sym_get_probe_argument_count */
+  NULL,				/* sym_evaluate_probe_argument */
   &dwarf2_gdb_index_functions
 };
 
diff --git a/gdb/machoread.c b/gdb/machoread.c
index 6db755e..587f6b5 100644
--- a/gdb/machoread.c
+++ b/gdb/machoread.c
@@ -848,7 +848,7 @@ static const struct sym_fns macho_sym_fns = {
   default_symfile_segments,	/* Get segment information from a file.  */
   NULL,
   macho_symfile_relocate,	/* Relocate a debug section.  */
-  NULL,				/* sym_get_markers */
+  NULL,				/* sym_get_probes */
   &psym_functions
 };
 
diff --git a/gdb/mipsread.c b/gdb/mipsread.c
index 9383cfb..379747d 100644
--- a/gdb/mipsread.c
+++ b/gdb/mipsread.c
@@ -401,7 +401,9 @@ static const struct sym_fns ecoff_sym_fns =
   default_symfile_segments,	/* Get segment information from a file.  */
   NULL,
   default_symfile_relocate,	/* Relocate a debug section.  */
-  NULL,				/* sym_get_markers */
+  NULL,				/* sym_get_probes */
+  NULL,				/* sym_get_probe_argument_count */
+  NULL,				/* sym_evaluate_probe_argument */
   &psym_functions
 };
 
diff --git a/gdb/somread.c b/gdb/somread.c
index 62ac405..c9a1797 100644
--- a/gdb/somread.c
+++ b/gdb/somread.c
@@ -438,7 +438,7 @@ static const struct sym_fns som_sym_fns =
   default_symfile_segments,	/* Get segment information from a file.  */
   NULL,
   default_symfile_relocate,	/* Relocate a debug section.  */
-  NULL,				/* sym_get_markers */
+  NULL,				/* sym_get_probes */
   &psym_functions
 };
 
diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c
index f0411c6..b400215 100644
--- a/gdb/stap-probe.c
+++ b/gdb/stap-probe.c
@@ -382,6 +382,7 @@ compute_marker_arg (struct gdbarch *arch, struct internalvar *ivar,
   int sel = (int) (uintptr_t) data;
   struct objfile *objfile;
   const struct stap_probe *pc_probe = NULL;
+  int n_probes;
 
   /* Note that SEL is biased by 1; SEL==0 means "_marker_argc".  */
   gdb_assert (sel >= 0 && sel <= 10);
@@ -410,8 +411,18 @@ compute_marker_arg (struct gdbarch *arch, struct internalvar *ivar,
   if (pc_probe == NULL)
     error (_("No SystemTap probe at PC %s"), core_addr_to_string (pc));
 
-  /* FIXME: now the hard work... */
-  error (_("Unimplemented"));
+  n_probes = objfile->sf->sym_get_probe_argument_count (objfile, pc_probe);
+  if (sel == 0)
+    return value_from_longest (builtin_type (arch)->builtin_int, n_probes);
+
+  --sel;
+  gdb_assert (sel >= 0);
+  if (sel >= n_probes)
+    error (_("Invalid probe argument %d -- probe has %d arguments available"),
+	   sel, n_probes);
+
+  return objfile->sf->sym_evaluate_probe_argument (objfile, pc_probe,
+						   frame, sel);
 }
 
 static void
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 7c3e6dd..ae8bf4a 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -32,6 +32,8 @@ struct obj_section;
 struct obstack;
 struct block;
 struct stap_probe;
+struct value;
+struct frame_info;
 
 /* Comparison function for symbol look ups.  */
 
@@ -365,6 +367,25 @@ struct sym_fns
   const struct stap_probe *(*sym_get_probes) (struct objfile *,
 					      int *num_probes);
 
+  /* Return the number of arguments available to PROBE.  PROBE will
+     have come from a call to this objfile's sym_get_probes method.
+     If you provide an implementation of sym_get_probes, you must
+     implement this method as well.  */
+  int (*sym_get_probe_argument_count) (struct objfile *objfile,
+				       const struct stap_probe *probe);
+
+  /* Evaluate the Nth argument available to PROBE.  PROBE will have
+     come from a call to this objfile's sym_get_probes method.  N will
+     be between 0 and the number of arguments available to this probe.
+     FRAME is the frame in which the evaluation is done; the frame's
+     PC will match the address of the probe.  If you provide an
+     implementation of sym_get_probes, you must implement this method
+     as well.  */
+  struct value *(*sym_evaluate_probe_argument) (struct objfile *objfile,
+						const struct stap_probe *probe,
+						struct frame_info *frame,
+						int n);
+
   /* The "quick" (aka partial) symbol functions for this symbol
      reader.  */
   const struct quick_symbol_functions *qf;
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 0db2f09..61c80bd 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -3086,7 +3086,9 @@ static const struct sym_fns xcoff_sym_fns =
   default_symfile_segments,	/* Get segment information from a file.  */
   aix_process_linenos,
   default_symfile_relocate,	/* Relocate a debug section.  */
-  NULL,				/* sym_get_markers */
+  NULL,				/* sym_get_probes */
+  NULL,				/* sym_get_probe_argument_count */
+  NULL,				/* sym_evaluate_probe_argument */
   &psym_functions
 };
 


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


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

only message in thread, other threads:[~2011-02-09 19:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-09 19:00 [SCM] archer-sergiodj-stap: add symfile methods to handle probe arguments fix up remaining references to "marker" tromey

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).