From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18815 invoked by alias); 29 Nov 2019 11:24:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 18657 invoked by uid 89); 29 Nov 2019 11:24:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= 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; Fri, 29 Nov 2019 11:24:25 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 89A5D203C1; Fri, 29 Nov 2019 06:24:15 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 42C5320555; Fri, 29 Nov 2019 06:24:08 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 1784520AF6; Fri, 29 Nov 2019 06:24:08 -0500 (EST) X-Gerrit-PatchSet: 2 Date: Fri, 29 Nov 2019 11:24:00 -0000 From: "Sourceware to Gerrit sync (Code Review)" To: Tankut Baris Aktemur , Andrew Burgess , gdb-patches@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [pushed] gdb: improve debug output of function overload resolution X-Gerrit-Change-Id: I771017e7afbbaf4809e2238a9b23274f55c61f55 X-Gerrit-Change-Number: 735 X-Gerrit-ChangeURL: X-Gerrit-Commit: a992a3b010983dc370c462dc467893724afbbde9 In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, tankut.baris.aktemur@intel.com, andrew.burgess@embecosm.com, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Content-Type: text/plain; charset=UTF-8 Message-Id: <20191129112408.1784520AF6@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-11/txt/msg01129.txt.bz2 The original change was created by Tankut Baris Aktemur. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/735 ...................................................................... gdb: improve debug output of function overload resolution Function overload resolution prints debug output if turned on via the 'set debug overload' command. The output includes the badness vector (BV). For each function, this vector contains a badness value of the length of parameters as its first element. So, BV[0] does not correspond to a parameter. The badness values of parameters start with BV[1]. A badness value is a pair; it contains a rank and a subrank. Printing both fields provides useful information. Improve printing the badness vector along these lines. gdb/ChangeLog: 2019-11-29 Tankut Baris Aktemur * valops.c (find_oload_champ): Improve debug output. Change-Id: I771017e7afbbaf4809e2238a9b23274f55c61f55 --- M gdb/ChangeLog M gdb/valops.c 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a3c0670..4b7e506 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2019-11-29 Tankut Baris Aktemur + * valops.c (find_oload_champ): Improve debug output. + +2019-11-29 Tankut Baris Aktemur + * valops.c (find_oload_champ): Print part of debug messages before the badness vector is std::move'd. diff --git a/gdb/valops.c b/gdb/valops.c index 8af53de..e3fc2dc 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -3039,10 +3039,15 @@ "%s # of parms %d\n", functions[ix]->demangled_name (), (int) parm_types.size ()); - for (jj = 0; jj < args.size () - static_offset; jj++) + + fprintf_filtered (gdb_stderr, + "...Badness of length : {%d, %d}\n", + bv[0].rank, bv[0].subrank); + + for (jj = 1; jj < bv.size (); jj++) fprintf_filtered (gdb_stderr, - "...Badness @ %d : %d\n", - jj, bv[jj].rank); + "...Badness of arg %d : {%d, %d}\n", + jj, bv[jj].rank, bv[jj].subrank); } if (oload_champ_bv->empty ()) -- Gerrit-Project: binutils-gdb Gerrit-Branch: master Gerrit-Change-Id: I771017e7afbbaf4809e2238a9b23274f55c61f55 Gerrit-Change-Number: 735 Gerrit-PatchSet: 2 Gerrit-Owner: Tankut Baris Aktemur Gerrit-Reviewer: Andrew Burgess Gerrit-MessageType: newpatchset