summaryrefslogtreecommitdiff
path: root/gdb/stap-probe.c
diff options
context:
space:
mode:
authorJose E. Marchesi <jose.marchesi@oracle.com>2015-02-17 15:49:12 +0100
committerJose E. Marchesi <jose.marchesi@oracle.com>2015-02-17 15:49:12 +0100
commit6f9b84910f8cabf565598f499258bbea51cc06d4 (patch)
treebdced44fc258a352769675f974d1ff31ffb2e71e /gdb/stap-probe.c
parent2ec55de302e4a6c49a06c673c8262a119fa6226f (diff)
downloadbinutils-gdb-6f9b84910f8cabf565598f499258bbea51cc06d4.tar.gz
Adapt `info probes' to support printing probes of different types.
A "probe type" (backend for the probe abstraction implemented in probe.[ch]) can extend the information printed by `info probes' by defining additional columns. This means that when `info probes' is used to print all the probes regardless of their types, some of the columns will be "not applicable" to some of the probes (like, say, the Semaphore column only makes sense for SystemTap probes). This patch makes `info probes' fill these slots with "n/a" marks (currently it breaks the table) and not include headers for which no actual probe has been found in the list of defined probes. This patch also adds support for a new generic column "Type", that displays the type of each probe. SystemTap probes identify themselves as "stap" probes. gdb/ChangeLog: 2015-02-17 Jose E. Marchesi <jose.marchesi@oracle.com> * probe.c (print_ui_out_not_applicables): New function. (exists_probe_with_pops): Likewise. (info_probes_for_ops): Do not include column headers for probe types for which no probe has been actually found on any object. Also invoke `print_ui_out_not_applicables' in order to match the column rows with the header when probes of several types are listed. Print the "Type" column. * probe.h (probe_ops): Added a new probe operation `type_name'. * stap-probe.c (stap_probe_ops): Add `stap_type_name'. (stap_type_name): New function.
Diffstat (limited to 'gdb/stap-probe.c')
-rw-r--r--gdb/stap-probe.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c
index ffe4dd16be9..50ad533516e 100644
--- a/gdb/stap-probe.c
+++ b/gdb/stap-probe.c
@@ -1703,6 +1703,15 @@ stap_get_probes (VEC (probe_p) **probesp, struct objfile *objfile)
}
}
+/* Implementation of the type_name method. */
+
+static const char *
+stap_type_name (struct probe *probe)
+{
+ gdb_assert (probe->pops == &stap_probe_ops);
+ return "stap";
+}
+
static int
stap_probe_is_linespec (const char **linespecp)
{
@@ -1754,6 +1763,7 @@ const struct probe_ops stap_probe_ops =
stap_set_semaphore,
stap_clear_semaphore,
stap_probe_destroy,
+ stap_type_name,
stap_gen_info_probes_table_header,
stap_gen_info_probes_table_values,
};