https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86687

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
Reproduced with trunk gcc/gdb:
...
$ cat bla.C
#include <string>
#include <iostream>

using std::string;

class foo {
public:
  foo (std::string dir_hint) {
    std::cout << dir_hint << "\n";
  }
};

int
main (void)
{
  std::string s = "This is just a string";

  foo bar(s);

  return 0;
}

$ ./install/bin/g++ bla.C -g

$ ./install/bin/gdb ./a.out -batch \
  -ex "b foo::foo" \
  -ex "r" \
  -ex "info addr dir_hint" \
  -ex "p dir_hint.c_str ()" \
  -ex c
Breakpoint 1 at 0x4012ee: file bla.C, line 9.

Breakpoint 1, foo::foo (this=0x7fffffffdb3f, dir_hint=...) at bla.C:9
9           std::cout << dir_hint << "\n";
Symbol "dir_hint" is a complex DWARF expression:
     0: DW_OP_fbreg -32
.
$1 = 0x7fffffffdb70 "\220nA"
This is just a string
[Inferior 1 (process 6132) exited normally]
...

Reply via email to