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/17811] New: Stabs special "$t" support for this.


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

            Bug ID: 17811
           Summary: Stabs special "$t" support for this.
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: muller at sourceware dot org

Created attachment 8054
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8054&action=edit
Test sourc in C++ language

Current parsing of "$t" local parameter for
hidden this variable in C++ or pascal is partially broken.

  The problem is that the special handling in current GDB
misses too set the language for this special symbol.
  This results in the fact that the hidden parameter is
not display correctly in stack trace.

  fpc -gs -Mobjfpc test-class-pascal.pas

$ gdb ./test-class-pascal.exe
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from e:\pas\test\test-class-pascal.exe...done.
(gdb) b TA__CHECK
Breakpoint 1 at 0x40154c: file test-class-pascal.pas, line 23.
(gdb) r
Starting program: e:\pas\test/./test-class-pascal.exe
[New Thread 7108.0x1b80]

Breakpoint 1, TA__CHECK (B=0x1523870, this=<error reading variable>)
    at test-class-pascal.pas:23
23        check:=(x < b.x);
(gdb)

  This problem can be reproduced in C++,
but only after some post-handling of generated assembler.
The reason is that recent GCC generate "this:p" stab entries
for "this" hidden variable.

gcc -gstabs+ --save-temps -o testclass test-class.cc

# Using sed to convert this into $t to show the pproblem:
$ sed -i "s:this:\$t:" test-class.s

# Compiling modified assembler
$ gcc -o test-class-mod test-class.s

$ gdb ./test-class-mod
GNU gdb (GDB) 7.6.1
# Same with recent Git trunk 
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from e:\pas\test\test-class-mod.exe...done.
(gdb) b A::check(A)
Breakpoint 1 at 0x4016c5: file test-class.cc, line 16.
(gdb) r
Starting program: e:\pas\test/./test-class-mod.exe
[New Thread 6028.0x1b68]

Breakpoint 1, A::check (this=<error reading variable>, b=...)
    at test-class.cc:16
16        return x < y;
(gdb)

-- 
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]