This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug symtab/14441] Need to support DW_TAG_rvalue_reference_type


https://sourceware.org/bugzilla/show_bug.cgi?id=14441

--- Comment #6 from Jonathan Wakely <jwakely.gcc at gmail dot com> ---
I can live with printing rvalue refs as <unknown type in /dev/shm/a.out, CU
0x0, DIE 0x4b> but the fact you're unable to do anything with them is a much
bigger problem:

struct A { int i; };

int f(A&& a)
{
  return a.i;
}

int main()
{
  return f( A() );
}

Reading symbols from ./a.out...done.
(gdb) start
Temporary breakpoint 1 at 0x4005de: file rv.cc, line 10.
Starting program: /tmp/a.out

Temporary breakpoint 1, main () at rv.cc:10
(gdb) step
f(A&&) (a=<unknown type in /tmp/a.out, CU 0x0, DIE 0x7f>) at rv.cc:5
(gdb) p a.i
Attempt to extract a component of a value that is not a structure.

This makes it almost impossible to debug functions taking rvalues, such as move
constructors and move assignment operators.

And sometimes move constructors are really hard to get right and need to be
debugged (e.g. std::stringstream is giving me major headaches)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]