gdb/tui: return std::string from tui_get_function_from_frame
Update tui_get_function_from_frame to return a std::string rather than
a pointer into a static buffer.
The value returned from tui_get_function_from_frame is passed to
tui_location_tracker::set_location, which already stores the data in a
std::string; this just moves the string creation earlier.
I don't think there was anything particularly wrong with the old code,
but I'm not a huge fan of returning data in static buffers unless
there's a really good reason, and it doesn't feel like there's a
really good reason in this case.
The current approach in tui_get_function_from_frame is to call
print_address_symbolic, and then to pull the function name from the
result. There is an argument that this approach could be improved,
but I've not done that in this commit, nor do I plan to do that any
time soon. As such the new code should do exactly what the old code
did.
There should be no user visible changes after this commit.
Approved-By: Tom Tromey <tom@tromey.com>
3 files changed