gdb: fix segfault in overload resolution debug output
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:18:21 +0000 (12:18 +0100)
commite9194a1a0e49f0646d5ac415836cc5d133f14bbe
treec4a6ebe2cea13ab40b0c0c15f21de41d7a61cb72
parent13364701d8c1b5b184ac6db4b835a3bb680766a0
gdb: fix segfault in overload resolution debug output

A segfault occurs if overload resolution debug mode is turned on via
the 'set debug overload' command.  E.g.:

~~~
$ gdb ./a.out
...
(gdb) start
...
(gdb) set debug overload 1
(gdb) print foo(5)
-- Arg is int [8], parm is double [9]
Overloaded function instance (null) # of parms 1
Segmentation fault
$
~~~

The problem is, GDB tries to print the badness vector after it has
been std::move'd.  Fix the problem by printing the vector before it is
moved.

gdb/ChangeLog:
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.

Change-Id: Ia623f9637e82ec332bfeac23eb6b0f2ffdcdde27
gdb/ChangeLog
gdb/valops.c
This page took 0.027119 seconds and 4 git commands to generate.