public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [review] gdb: improve debug output of function overload resolution
@ 2019-11-29 10:25 Tankut Baris Aktemur (Code Review)
  2019-11-29 11:11 ` Andrew Burgess (Code Review)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tankut Baris Aktemur (Code Review) @ 2019-11-29 10:25 UTC (permalink / raw)
  To: gdb-patches

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  <tankut.baris.aktemur@intel.com>

	* valops.c (find_oload_champ): Improve debug output.

Change-Id: I771017e7afbbaf4809e2238a9b23274f55c61f55
---
M gdb/valops.c
1 file changed, 8 insertions(+), 3 deletions(-)



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: 1
Gerrit-Owner: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Gerrit-MessageType: newchange

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [review] gdb: improve debug output of function overload resolution
  2019-11-29 10:25 [review] gdb: improve debug output of function overload resolution Tankut Baris Aktemur (Code Review)
@ 2019-11-29 11:11 ` Andrew Burgess (Code Review)
  2019-11-29 11:24 ` [pushed] " Sourceware to Gerrit sync (Code Review)
  2019-11-29 11:24 ` Sourceware to Gerrit sync (Code Review)
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Burgess (Code Review) @ 2019-11-29 11:11 UTC (permalink / raw)
  To: Tankut Baris Aktemur, gdb-patches

Andrew Burgess has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/735
......................................................................


Patch Set 1: Code-Review+2

LGTM.


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I771017e7afbbaf4809e2238a9b23274f55c61f55
Gerrit-Change-Number: 735
Gerrit-PatchSet: 1
Gerrit-Owner: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Gerrit-Reviewer: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-Comment-Date: Fri, 29 Nov 2019 11:10:59 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pushed] gdb: improve debug output of function overload resolution
  2019-11-29 10:25 [review] gdb: improve debug output of function overload resolution Tankut Baris Aktemur (Code Review)
  2019-11-29 11:11 ` Andrew Burgess (Code Review)
  2019-11-29 11:24 ` [pushed] " Sourceware to Gerrit sync (Code Review)
@ 2019-11-29 11:24 ` Sourceware to Gerrit sync (Code Review)
  2 siblings, 0 replies; 4+ messages in thread
From: Sourceware to Gerrit sync (Code Review) @ 2019-11-29 11:24 UTC (permalink / raw)
  To: Tankut Baris Aktemur, gdb-patches; +Cc: Andrew Burgess

Sourceware to Gerrit sync has submitted this change.

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  <tankut.baris.aktemur@intel.com>

	* 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  <tankut.baris.aktemur@intel.com>
 
+	* valops.c (find_oload_champ): Improve debug output.
+
+2019-11-29  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
 	* 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 <tankut.baris.aktemur@intel.com>
Gerrit-Reviewer: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-MessageType: merged

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pushed] gdb: improve debug output of function overload resolution
  2019-11-29 10:25 [review] gdb: improve debug output of function overload resolution Tankut Baris Aktemur (Code Review)
  2019-11-29 11:11 ` Andrew Burgess (Code Review)
@ 2019-11-29 11:24 ` Sourceware to Gerrit sync (Code Review)
  2019-11-29 11:24 ` Sourceware to Gerrit sync (Code Review)
  2 siblings, 0 replies; 4+ messages in thread
From: Sourceware to Gerrit sync (Code Review) @ 2019-11-29 11:24 UTC (permalink / raw)
  To: Tankut Baris Aktemur, Andrew Burgess, gdb-patches

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  <tankut.baris.aktemur@intel.com>

	* 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  <tankut.baris.aktemur@intel.com>
 
+	* valops.c (find_oload_champ): Improve debug output.
+
+2019-11-29  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
 	* 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 <tankut.baris.aktemur@intel.com>
Gerrit-Reviewer: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-MessageType: newpatchset

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-29 11:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-29 10:25 [review] gdb: improve debug output of function overload resolution Tankut Baris Aktemur (Code Review)
2019-11-29 11:11 ` Andrew Burgess (Code Review)
2019-11-29 11:24 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-11-29 11:24 ` Sourceware to Gerrit sync (Code Review)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).