[PATCH] Fix use of a dangling pointer for Python breakpoint objects

Pierre-Marie de Rodat derodat@adacore.com
Mon Jun 27 09:11:00 GMT 2016


Hi Pedro,

On 06/24/2016 06:41 PM, Pedro Alves wrote:
> I think this comment should be adjusted.

Done.

> But I think this would be even better:
>
> # ... and when it did, as a result, the following breakpoint creation
> # (not initiated by the Python API) would dereference the
> # already-freed Python breakpoint wrapper, resulting in undefined
> # behavior, sometimes observed as a gdb crash, and other times causing
> # the next stop to invoke the Python wrapper "stop" method for the
> # object that is not supposed to exist.

Yours is definitely better: done!

> Three things here:
>
> - Please make pass/fail messages here the same.
>
> - With gdb_test_multiple, you also need to match $gdb_prompt,
>   otherwise you confuse the next test.
>
> - No need for leading ".*" in regexes, it's implicit.

Done.

> While at it, how about renaming the new files to avoid
> the meaningless "2"?
>
> Maybe py-breakpoint-create-fail.[py|exp|c] ?

Done as well.

Thank you for your help! I’m not familiar with the testsuite so I had a 
hard time analyzing how other testcases do and investigating why my 
testcase did not work… Anyway, thank you for the rationale! Updated 
patch is attached.

-- 
Pierre-Marie de Rodat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-use-of-a-dangling-pointer-for-Python-breakpoint-.patch
Type: text/x-diff
Size: 6850 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20160627/955302a2/attachment.bin>


More information about the Gdb-patches mailing list