From: Tom de Vries Date: Fri, 24 Apr 2026 12:17:29 +0000 (+0200) Subject: [gdb] Simplify get_frame_function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1557abbb01c35adbcdcc65f2a8b188908a006eb;p=thirdparty%2Fbinutils-gdb.git [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 ce28d99c7e4..8aafa6ffe57 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 (); }