]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: modernize get_frame_pc_if_available
authorGuinevere Larsen <guinevere@redhat.com>
Wed, 13 Aug 2025 13:01:52 +0000 (10:01 -0300)
committerGuinevere Larsen <guinevere@redhat.com>
Thu, 14 Aug 2025 16:40:19 +0000 (13:40 -0300)
commita1be365e22fd18c0bf3e063fc6e5a66db35cce34
treed4e4eb5c0fdcb818c0a021b4e4e6c456c314b2a1
parent5ed142657c5dd9dfd5e0897ab45f2f269a8b97d2
gdb: modernize get_frame_pc_if_available

The convenience function get_frame_pc_if_available would take a pointer
to a variable that should be set if available, and would return a
boolean indicating whether that action was successful or not.

Now that GDB supports C++17 features, this indirection of a pointer and
returning boolean is unnecessary, since the function can return an
optional, and code that calls it can check if the optional contains a
value.

This commit makes that modernization. It should have no visible
effects.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/frame.c
gdb/frame.h
gdb/macroscope.c
gdb/printcmd.c
gdb/python/py-finishbreakpoint.c
gdb/stack.c
gdb/tracepoint.c
gdb/tui/tui-status.c
gdb/tui/tui-winsource.c