public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/17811] New: Stabs special "$t" support for this.
@ 2015-01-07 23:04 muller at sourceware dot org
  2015-01-07 23:11 ` [Bug symtab/17811] " muller at sourceware dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: muller at sourceware dot org @ 2015-01-07 23:04 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug symtab/17811] Stabs special "$t" support for this.
  2015-01-07 23:04 [Bug symtab/17811] New: Stabs special "$t" support for this muller at sourceware dot org
@ 2015-01-07 23:11 ` muller at sourceware dot org
  2015-01-07 23:15 ` muller at sourceware dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: muller at sourceware dot org @ 2015-01-07 23:11 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Pierre Muller <muller at sourceware dot org> ---
Created attachment 8055
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8055&action=edit
Pascal equivalent source

Using free pascal compiler
fpc -gs -Mobjfpc test-class-pascal.pas
and
gdb ./test-class-pascal
with
b TA__CHECK
shows the same problem
that "this" variable is not displayed correctly 
in stack frame.

Note that the problem does not appear elsewhere:
(gdb) p this
works correctly.

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug symtab/17811] Stabs special "$t" support for this.
  2015-01-07 23:04 [Bug symtab/17811] New: Stabs special "$t" support for this muller at sourceware dot org
  2015-01-07 23:11 ` [Bug symtab/17811] " muller at sourceware dot org
@ 2015-01-07 23:15 ` muller at sourceware dot org
  2015-01-08  8:04 ` cvs-commit at gcc dot gnu.org
  2015-01-11 16:22 ` cvs-commit at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: muller at sourceware dot org @ 2015-01-07 23:15 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Pierre Muller <muller at sourceware dot org> ---
Proposed patch:

2015-01-07  Pierre Muller  <muller@sourceware.org>

       * stabsread.c (define_symbol): Set language for C++ special symbols.

diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 212c7fa..ec883ba 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -675,6 +675,8 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int
type,
       SYMBOL_LINE (sym) = 0;   /* unknown */
     }

+  SYMBOL_SET_LANGUAGE (sym, current_subfile->language,
+                      &objfile->objfile_obstack);
   if (is_cplus_marker (string[0]))
     {
       /* Special GNU C++ names.  */
@@ -710,8 +712,6 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int
type,
   else
     {
     normal:
-      SYMBOL_SET_LANGUAGE (sym, current_subfile->language,
-                          &objfile->objfile_obstack);
       if (SYMBOL_LANGUAGE (sym) == language_cplus)
        {
          char *name = alloca (p - string + 1);

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug symtab/17811] Stabs special "$t" support for this.
  2015-01-07 23:04 [Bug symtab/17811] New: Stabs special "$t" support for this muller at sourceware dot org
  2015-01-07 23:11 ` [Bug symtab/17811] " muller at sourceware dot org
  2015-01-07 23:15 ` muller at sourceware dot org
@ 2015-01-08  8:04 ` cvs-commit at gcc dot gnu.org
  2015-01-11 16:22 ` cvs-commit at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-01-08  8:04 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  025ac41482555f6273dee37988734a9f88633dbc (commit)
      from  acc018ac031c9e03e012d7d2f3871bfe6b16168d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=025ac41482555f6273dee37988734a9f88633dbc

commit 025ac41482555f6273dee37988734a9f88633dbc
Author: Pierre Muller <muller@ics.u-strasbg.fr>
Date:   Thu Jan 8 08:53:26 2015 +0100

        Set language for C++ special symbols.

    The special handling of C++ special symbol
    generates symbols that have no language.
    Those symbols cannot be displayed correctly in the backtrace stack.

    See
    https://sourceware.org/bugzilla/show_bug.cgi?id=17811
    for details and examples in C++ and pascal language.

    The patch below fixes this issue, by
    setting language of new symbol before
    special handling of special C++ symbols.

    2015-01-07  Pierre Muller  <muller@sourceware.org>

        PR symtab/17811
        * stabsread.c (define_symbol): Set language for C++ special symbols.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog   |    5 +++++
 gdb/stabsread.c |    5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug symtab/17811] Stabs special "$t" support for this.
  2015-01-07 23:04 [Bug symtab/17811] New: Stabs special "$t" support for this muller at sourceware dot org
                   ` (2 preceding siblings ...)
  2015-01-08  8:04 ` cvs-commit at gcc dot gnu.org
@ 2015-01-11 16:22 ` cvs-commit at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-01-11 16:22 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The users/hjl/linux/master branch has been updated by H.J. Lu
<hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=025ac41482555f6273dee37988734a9f88633dbc

commit 025ac41482555f6273dee37988734a9f88633dbc
Author: Pierre Muller <muller@ics.u-strasbg.fr>
Date:   Thu Jan 8 08:53:26 2015 +0100

        Set language for C++ special symbols.

    The special handling of C++ special symbol
    generates symbols that have no language.
    Those symbols cannot be displayed correctly in the backtrace stack.

    See
    https://sourceware.org/bugzilla/show_bug.cgi?id=17811
    for details and examples in C++ and pascal language.

    The patch below fixes this issue, by
    setting language of new symbol before
    special handling of special C++ symbols.

    2015-01-07  Pierre Muller  <muller@sourceware.org>

        PR symtab/17811
        * stabsread.c (define_symbol): Set language for C++ special symbols.

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-01-11 16:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-07 23:04 [Bug symtab/17811] New: Stabs special "$t" support for this muller at sourceware dot org
2015-01-07 23:11 ` [Bug symtab/17811] " muller at sourceware dot org
2015-01-07 23:15 ` muller at sourceware dot org
2015-01-08  8:04 ` cvs-commit at gcc dot gnu.org
2015-01-11 16:22 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).