From patchwork Sun Nov 10 21:02:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 35780 Received: (qmail 81632 invoked by alias); 10 Nov 2019 21:02:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 81624 invoked by uid 89); 10 Nov 2019 21:02:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=sk:Iaaa9eb, sk:iaaa9eb, stackc, UD:stack.c X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 10 Nov 2019 21:02:13 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 16CC2203A6; Sun, 10 Nov 2019 16:02:12 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id 1FD2920339; Sun, 10 Nov 2019 16:02:07 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id EE74D20AF6; Sun, 10 Nov 2019 16:02:06 -0500 (EST) X-Gerrit-PatchSet: 2 Date: Sun, 10 Nov 2019 16:02:06 -0500 From: "Sourceware to Gerrit sync (Code Review)" To: Andrew Burgess , Simon Marchi , gdb-patches@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [pushed] gdb: Convert frame_show_address to return a bool X-Gerrit-Change-Id: Iaaa9ebd4ff6534db19c5329f1c604932c747bd7f X-Gerrit-Change-Number: 541 X-Gerrit-ChangeURL: X-Gerrit-Commit: 621377757c83ccc8573cc2e979e1d4ba55335c13 In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, simon.marchi@polymtl.ca, andrew.burgess@embecosm.com, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-76-gf8b6da0ab5 Message-Id: <20191110210206.EE74D20AF6@gnutoolchain-gerrit.osci.io> The original change was created by Andrew Burgess. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/541 ...................................................................... gdb: Convert frame_show_address to return a bool Just a clean up, should be no user visible changes after this commit. gdb/ChangeLog: * stack.c (frame_show_address): Convert return type to bool. * stack.h (frame_show_address): Likewise, and update header comment. Change-Id: Iaaa9ebd4ff6534db19c5329f1c604932c747bd7f --- M gdb/ChangeLog M gdb/stack.c M gdb/stack.h 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b9d5f21..158af82 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2019-11-10 Andrew Burgess + * stack.c (frame_show_address): Convert return type to bool. + * stack.h (frame_show_address): Likewise, and update header + comment. + +2019-11-10 Andrew Burgess + * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add new file to the list. * unittests/vec-utils-selftests.c: New file. * gdbsupport/gdb_vecs.h (unordered_remove): Avoid self move assign. diff --git a/gdb/stack.c b/gdb/stack.c index fa057db..5af00c7 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -252,7 +252,7 @@ /* See stack.h. */ -int +bool frame_show_address (struct frame_info *frame, struct symtab_and_line sal) { @@ -267,7 +267,7 @@ gdb_assert (inline_skipped_frames (inferior_thread ()) > 0); else gdb_assert (get_frame_type (get_next_frame (frame)) == INLINE_FRAME); - return 0; + return false; } return get_frame_pc (frame) != sal.pc; diff --git a/gdb/stack.h b/gdb/stack.h index dda4fc9..28d2273 100644 --- a/gdb/stack.h +++ b/gdb/stack.h @@ -49,10 +49,10 @@ void get_user_print_what_frame_info (gdb::optional *what); -/* Return 1 if we should display the address in addition to the location, +/* Return true if we should display the address in addition to the location, because we are in the middle of a statement. */ -int frame_show_address (struct frame_info *frame, struct symtab_and_line sal); +bool frame_show_address (struct frame_info *frame, struct symtab_and_line sal); /* Get or set the last displayed symtab and line, which is, e.g. where we set a * breakpoint when `break' is supplied with no arguments. */