aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2019-11-29 12:17:36 +0100
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2019-11-29 12:20:10 +0100
commita992a3b010983dc370c462dc467893724afbbde9 (patch)
tree85ad698021715c6c5765d8dfc0ec70cc6a141289 /gdb
parente9194a1a0e49f0646d5ac415836cc5d133f14bbe (diff)
downloadgdb-a992a3b010983dc370c462dc467893724afbbde9.zip
gdb-a992a3b010983dc370c462dc467893724afbbde9.tar.gz
gdb-a992a3b010983dc370c462dc467893724afbbde9.tar.bz2
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
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/valops.c11
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 @@ 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 ())