[gdb] Simplify get_frame_function

Use block::containing_function to simplify get_frame_function.

While we're at it, modernize using nullptr.
This commit is contained in:
Tom de Vries 2026-04-24 14:17:29 +02:00
parent 08610a4004
commit e1557abbb0

View file

@ -116,14 +116,10 @@ struct symbol *
get_frame_function (const frame_info_ptr &frame)
{
const struct block *bl = get_frame_block (frame, 0);
if (bl == nullptr)
return nullptr;
if (bl == NULL)
return NULL;
while (bl->function () == NULL && bl->superblock () != NULL)
bl = bl->superblock ();
return bl->function ();
return bl->containing_function ();
}