[gdb] Simplify get_frame_function Use block::containing_function to simplify get_frame_function. While we're at it, modernize using nullptr.
diff --git a/gdb/blockframe.c b/gdb/blockframe.c index ce28d99..8aafa6f 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c
@@ -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 (); }