public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/16889] New: gdb segfaults when printing ASM SDT arguments
@ 2014-04-30 22:13 jistone at redhat dot com
  2014-04-30 22:19 ` [Bug breakpoints/16889] " sergiodj at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jistone at redhat dot com @ 2014-04-30 22:13 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16889

            Bug ID: 16889
           Summary: gdb segfaults when printing ASM SDT arguments
           Product: gdb
           Version: 7.6
            Status: NEW
          Severity: normal
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: jistone at redhat dot com
                CC: sergiodj at redhat dot com

Created attachment 7571
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7571&action=edit
example x86_64 asm source with sdt probes

With a program compiled from the attached asm source, gdb is unable to print
the arguments, and actually segfaults on the second probe.

$ gcc -Wall probe.S -o probe
$ eu-readelf -n probe
[...]
Note section [28] '.note.stapsdt' of 128 bytes at offset 0x1058:
  Owner          Data size  Type
  stapsdt               41  Version: 3
    PC: 0x4004f5, Base: 0x400590, Semaphore: 0
    Provider: probe, Name: foo, Args: '(%rsp)'
  stapsdt               43  Version: 3
    PC: 0x4004f6, Base: 0x400590, Semaphore: 0
    Provider: probe, Name: bar, Args: '-8(%rbp)'
$ gdb ./probe
[...]
(gdb) b -p foo
Breakpoint 1 at 0x4004f5
(gdb) b -p bar
Breakpoint 2 at 0x4004f6
(gdb) r
Starting program: /home/jistone/test/probe 

Breakpoint 1, 0x00000000004004f5 in main ()
(gdb) p $_probe_arg0
Invalid probe argument 0 -- probe has 0 arguments available
(gdb) c
Continuing.

Breakpoint 2, 0x00000000004004f6 in main ()
(gdb) p $_probe_arg0
Segmentation fault


So probe 'foo' can't find the (%rsp) argument, but probe 'bar' just crashes.

If I add the optional N@ size, so they are "8@(%rsp)" and "8@-8(%rbp)", then
they are both fine.


I'm using gdb-7.6.50.20130731-19.fc20.x86_64

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-02 20:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-30 22:13 [Bug breakpoints/16889] New: gdb segfaults when printing ASM SDT arguments jistone at redhat dot com
2014-04-30 22:19 ` [Bug breakpoints/16889] " sergiodj at redhat dot com
2014-05-01 21:54 ` sergiodj at redhat dot com
2014-05-02 20:53 ` cvs-commit at gcc dot gnu.org
2014-05-02 20:55 ` sergiodj at redhat dot com

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