gdb: improve debug output of function overload resolution
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Fri, 29 Nov 2019 11:17:36 +0000 (12:17 +0100)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Fri, 29 Nov 2019 11:20:10 +0000 (12:20 +0100)
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

gdb/ChangeLog
gdb/valops.c

index a3c06705d970bab80ff31a5588a2dc2119c92477..4b7e5066970431629ad1f8ff51dea380f3348d5c 100644 (file)
@@ -1,3 +1,7 @@
+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
index 8af53deaa6f8c36c59b9e1af591fe070c2156279..e3fc2dc42e159eb0041279a7c52aef19d15c8296 100644 (file)
@@ -3039,10 +3039,15 @@ find_oload_champ (gdb::array_view<value *> args,
                              "%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 ())
This page took 0.030816 seconds and 4 git commands to generate.