[patch] Assert when 'break' with no arguments

Aleksandar Ristovski aristovski@qnx.com
Tue Feb 14 18:03:00 GMT 2012


Hello,

An issue exists where if 'break' command is issued while on a line that 
underwent inlining by the compiler gdb asserts with

Assertion `sal.pspace != NULL'

I narrowed down the issue to frame.c:find_frame_sal, combined with 
stack.c:set_last_displayed_sal and in the view of print_frame_info.

The fix proposed here would be to properly initialize 'sal' in 
find_frmae_sal. Additional check is performed in set_last_displayed_sal 
to make sure we do not set last_displayed_* vars and validate them if 
pspace is NULL as, clearly, the rest of the code expects it to be 
properly set.

I identified the same issue in 7.2, 7.3.1, 7.4 and HEAD. I have not 
checked earlier versions.

Test suite did not show regressions, and new test passes where it would 
fail without the patch.


ChangeLog:
2012-02-14  Aleksandar Ristovski  <aristovski@qnx.com>

        * frame.c (find_frame_sal): Initialise sal->pspace field from 
frame data.
        * stack.c (set_last_displayed_sal): Perform sanity check of the data
        passed in, in particular, validate that PSPACE is not NULL if 
requesting
        valid last_displayed_* data.


Test suite ChangeLOg:
2012-02-14  Aleksandar Ristovski  <aristovski@qnx.com>

     * gdb.base/break-inline.exp: New test.
     * gdb.base/break-inline.c: New test.


Attached are patch for the fix and tests.



Thank you,

Aleksandar Ristovski
QNX Software Systems
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pspace-assert-201202141250.patch
Type: text/x-patch
Size: 1281 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20120214/287d18f8/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: break-inline.exp
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20120214/287d18f8/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: break-inline.c
Type: text/x-csrc
Size: 908 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20120214/287d18f8/attachment-0001.bin>


More information about the Gdb-patches mailing list