diff options
author | Sergio Durigan Junior <sergiodj@redhat.com> | 2014-05-02 17:45:35 -0300 |
---|---|---|
committer | Sergio Durigan Junior <sergiodj@redhat.com> | 2014-05-02 17:45:35 -0300 |
commit | f33da99a5410692ddf1302435e27b1bfc21d0b11 (patch) | |
tree | c90573c1140dbffc7520c52198b6d84e6c8808cf /bfd/coff-tic54x.c | |
parent | 54cb4522e7555fdf766201c3c74bfc8510c83424 (diff) | |
download | gdb-f33da99a5410692ddf1302435e27b1bfc21d0b11.zip gdb-f33da99a5410692ddf1302435e27b1bfc21d0b11.tar.gz gdb-f33da99a5410692ddf1302435e27b1bfc21d0b11.tar.bz2 |
Fix PR breakpoints/16889: gdb segfaults when printing ASM SDT arguments
This commit fixes PR breakpoints/16889, which is about a bug that
triggers when GDB tries to parse probes whose arguments do not contain
the initial (and optional) "N@" part. For reference sake, the de
facto format is described here:
<https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation>
Anyway, this PR actually uncovered two bugs (related) that were
happening while parsing the arguments. The first one was that the
parser *was* catching *some* arguments that were missing the "N@"
part, but it wasn't correctly setting the argument's type. This was
causing a NULL pointer being dereferenced, ouch...
The second bug uncovered was that the parser was not catching all of
the cases for a probe which did not provide the "N@" part. The fix
for that was to simplify the check that the code was making to
identify non-prefixed probes. The code is simpler and easier to read
now.
I am also providing a testcase for this bug, only for x86_64
architectures.
gdb/
2014-05-02 Sergio Durigan Junior <sergiodj@redhat.com>
PR breakpoints/16889
* stap-probe.c (stap_parse_probe_arguments): Simplify
check for non-prefixed probes (i.e., probes whose
arguments do not start with "N@"). Always set the
argument type to a sane value.
gdb/testsuite/
2014-05-02 Sergio Durigan Junior <sergiodj@redhat.com>
PR breakpoints/16889
* gdb.arch/amd64-stap-optional-prefix.S: New file.
* gdb.arch/amd64-stap-optional-prefix.exp: Likewise.
Diffstat (limited to 'bfd/coff-tic54x.c')
0 files changed, 0 insertions, 0 deletions