aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-04-26 13:17:20 +0000
committerTom Tromey <tromey@redhat.com>2011-04-26 13:17:20 +0000
commitc6a9fc58fd5fb5bb8fa6f568214333e8c3972492 (patch)
tree4937a2d808c30a99385105d34bd9117b36499059 /binutils
parent70616151ac0740159e28d61fa0f07515c18e8098 (diff)
downloadgdb-c6a9fc58fd5fb5bb8fa6f568214333e8c3972492.zip
gdb-c6a9fc58fd5fb5bb8fa6f568214333e8c3972492.tar.gz
gdb-c6a9fc58fd5fb5bb8fa6f568214333e8c3972492.tar.bz2
* readelf.c (print_stapsdt_note): New function.
(process_note): Use it.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/readelf.c39
2 files changed, 44 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index e925742..82acf3a 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,10 @@
2011-04-21 Tom Tromey <tromey@redhat.com>
+ * readelf.c (print_stapsdt_note): New function.
+ (process_note): Use it.
+
+2011-04-21 Tom Tromey <tromey@redhat.com>
+
* readelf.c (get_stapsdt_note_type): New function.
(process_note): Recognize "stapsdt" notes.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 339ef2e..c4df8d9 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -12368,6 +12368,43 @@ get_stapsdt_note_type (unsigned e_type)
return buff;
}
+static int
+print_stapsdt_note (Elf_Internal_Note *pnote)
+{
+ int addr_size = is_32bit_elf ? 4 : 8;
+ char *data = pnote->descdata;
+ char *data_end = pnote->descdata + pnote->descsz;
+ bfd_vma pc, base_addr, semaphore;
+ char *provider, *probe, *arg_fmt;
+
+ pc = byte_get ((unsigned char *) data, addr_size);
+ data += addr_size;
+ base_addr = byte_get ((unsigned char *) data, addr_size);
+ data += addr_size;
+ semaphore = byte_get ((unsigned char *) data, addr_size);
+ data += addr_size;
+
+ provider = data;
+ data += strlen (data) + 1;
+ probe = data;
+ data += strlen (data) + 1;
+ arg_fmt = data;
+ data += strlen (data) + 1;
+
+ printf (_(" Provider: %s\n"), provider);
+ printf (_(" Name: %s\n"), probe);
+ printf (_(" Location: "));
+ print_vma (pc, FULL_HEX);
+ printf (_(", Base: "));
+ print_vma (base_addr, FULL_HEX);
+ printf (_(", Semaphore: "));
+ print_vma (semaphore, FULL_HEX);
+ printf (_("\n"));
+ printf (_(" Arguments: %s\n"), arg_fmt);
+
+ return data == data_end;
+}
+
static const char *
get_ia64_vms_note_type (unsigned e_type)
{
@@ -12528,6 +12565,8 @@ process_note (Elf_Internal_Note * pnote)
return print_ia64_vms_note (pnote);
else if (const_strneq (pnote->namedata, "GNU"))
return print_gnu_note (pnote);
+ else if (const_strneq (pnote->namedata, "stapsdt"))
+ return print_stapsdt_note (pnote);
else
return 1;
}