]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix crash when calling Frame.static_link
authorHannes Domani <ssbssa@yahoo.de>
Sun, 11 Feb 2024 16:40:59 +0000 (17:40 +0100)
committerHannes Domani <ssbssa@yahoo.de>
Sun, 11 Feb 2024 16:42:46 +0000 (17:42 +0100)
commit1d197b254519d68245d460cad1dd835874f6629b
treece02848f9d375461a00ec014b392bdec739f393f
parent8c3e96141ea8acbf5e0246105d8220eb9f33bfdc
Fix crash when calling Frame.static_link

If you try to call Frame.static_link for a frame without debug info,
gdb crashes:
```
Temporary breakpoint 1, 0x000000013f821650 in main ()
(gdb) py print(gdb.selected_frame().static_link())

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
```

The problem was a missing check if get_frame_block returns nullptr
inside frame_follow_static_link.

With this, it works:
```
Temporary breakpoint 1, 0x000000013f941650 in main ()
(gdb) py print(gdb.selected_frame().static_link())
None
```

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31366
Approved-By: Tom Tromey <tom@tromey.com>
gdb/frame.c
gdb/testsuite/gdb.python/py-frame.exp