<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Cannot print type or set gdb breakpoint after 159a9f7e76"
href="https://bugs.llvm.org/show_bug.cgi?id=46052">46052</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Cannot print type or set gdb breakpoint after 159a9f7e76
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>douglas_yung@playstation.sony.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>We run the GDB test suite internally, and we noticed a failure with one of the
tests that I bisected back to this change. The test attempts to print the type
of a function as well as set a breakpoint at the function in GDB. Prior to
commit 159a9f7e76307734bcdcae3357640e42e0733194 this worked correctly.
The test is cpexprs.cc in the GDB test suite, and here is a reduced version of
the test that shows the problem:
/* cpexprs.cc */
template <class T>
struct operation_1
{
static void function (void) { } // operation_1<T>::function
};
template <class T, class Policy = operation_1<T> >
class policyd : public Policy
{
public:
policyd (T obj) : obj_ (obj) { } // policyd<T, Policy>::policyd
~policyd (void) { } // policyd<T, Policy>::~policyd
private:
T obj_;
};
typedef policyd<int> policyd1;
int
main (int argc, char* argv[])
{
policyd1 pd1 (5);
return 0;
}
/* cpexprs.cc */
The source file above is then compiled with "clang++ -g -o cpexprs cpexprs.cc"
and then the resulting binary is run using GDB with the following commands to
the debugger:
1. Set a breakpoint at main (break main)
2. Run to main (run)
3. Print information on policyd1::~policyd (print policyd1::~policyd)
4. Set a breakpoint at policyd1::~policyd (break policyd1::~policyd)
Using GDB 9.1 on my machine with a compiler built from 63249125 (the previous
commit), it produces the following output:
(gdb) b main
Breakpoint 1 at 0x400526: file cpexprs.cc, line 24.
(gdb) r
Starting program: /home/dyung/sandbox/cpexprs/cpexprs.old.elf
Breakpoint 1, main (argc=1, argv=0x7fffffffe448) at cpexprs.cc:24
24 policyd1 pd1 (5);
(gdb) print policyd1::~policyd
$1 = {void (policyd<int, operation_1<int> > * const)} 0x400570 <policyd<int,
operation_1<int> >::~policyd()>
(gdb) b policyd1::~policyd
Breakpoint 2 at 0x400578: file cpexprs.cc, line 13.
But if I repeat the same sequence of commands with a binary built from the
compiler built from 159a9f7e76, I get the following output:
(gdb) b main
Breakpoint 1 at 0x400526: file cpexprs.cc, line 24.
(gdb) r
Starting program: /home/dyung/sandbox/cpexprs/cpexprs.new.elf
Breakpoint 1, main (argc=1, argv=0x7fffffffe448) at cpexprs.cc:24
24 policyd1 pd1 (5);
(gdb) print policyd1::~policyd
There is no field named ~policyd
(gdb) b policyd1::~policyd
Function "policyd1::~policyd" not defined.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>