public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/26598] New: skip compares pattern against mangled name
@ 2020-09-10 14:59 simark at simark dot ca
  2020-09-10 15:00 ` [Bug gdb/26598] " simark at simark dot ca
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: simark at simark dot ca @ 2020-09-10 14:59 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 26598
           Summary: skip compares pattern against mangled name
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: simark at simark dot ca
  Target Milestone: ---

This commit introduced a regression:

commit bcfe6157ca288efed127c5efe21ad7924e0d98cf
Author: Tom Tromey <tom@tromey.com>
Date:   Fri Apr 24 15:35:01 2020 -0600

    Use the linkage name if it exists

Before this, skip function entries are compared against the demangled name,
after this commit they are compared against the mangled name.

I'm using this C++ test file:

1 #include <vector>
2 int main ()
3 {
4   std::vector<int> vec(10);
5 }

Behavior before:

(gdb) b 4
Breakpoint 1 at 0x40082a: file test.cpp, line 4.
(gdb) r
Starting program: /home/smarchi/build/binutils-gdb/gdb/a.out 

Breakpoint 1, main () at test.cpp:4
4         std::vector<int> vec(10);
(gdb) skip -rfu ^std::
Function(s) ^std:: will be skipped when stepping.
(gdb) set debug skip on
(gdb) s
skip: checking if function std::allocator<int>::allocator() matches regex
^std::...yes.
skip: checking if function std::vector<int, std::allocator<int>
>::vector(unsigned long, std::allocator<int> const&) matches regex
^std::...yes.
skip: checking if function std::allocator<int>::~allocator() matches regex
^std::...yes.
skip: checking if function std::vector<int, std::allocator<int> >::~vector()
matches regex ^std::...yes.
5       }

Behavior after:

(gdb) b 4
Breakpoint 1 at 0x40082a: file test.cpp, line 4.
(gdb) r
Starting program: /home/smarchi/build/binutils-gdb/gdb/a.out 

Breakpoint 1, main () at test.cpp:4
4         std::vector<int> vec(10);
(gdb) skip -rfu ^std::
Function(s) ^std:: will be skipped when stepping.
(gdb) set debug skip on
(gdb) s
skip: checking if function _ZNSaIiEC2Ev matches regex ^std::...no.
skip: checking if function _ZNSaIiEC2Ev matches regex ^std::...no.
std::allocator<int>::allocator (this=0x7fffffffe26f) at
/usr/include/c++/9/bits/allocator.h:138
138           allocator() _GLIBCXX_NOTHROW { }

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

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

* [Bug gdb/26598] skip compares pattern against mangled name
  2020-09-10 14:59 [Bug gdb/26598] New: skip compares pattern against mangled name simark at simark dot ca
@ 2020-09-10 15:00 ` simark at simark dot ca
  2020-09-10 15:08 ` brobecker at gnat dot com
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: simark at simark dot ca @ 2020-09-10 15:00 UTC (permalink / raw)
  To: gdb-prs

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

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.1

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

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

* [Bug gdb/26598] skip compares pattern against mangled name
  2020-09-10 14:59 [Bug gdb/26598] New: skip compares pattern against mangled name simark at simark dot ca
  2020-09-10 15:00 ` [Bug gdb/26598] " simark at simark dot ca
@ 2020-09-10 15:08 ` brobecker at gnat dot com
  2020-09-10 15:49 ` simark at simark dot ca
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: brobecker at gnat dot com @ 2020-09-10 15:08 UTC (permalink / raw)
  To: gdb-prs

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

Joel Brobecker <brobecker at gnat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |brobecker at gnat dot com,
                   |                            |tromey at sourceware dot org

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

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

* [Bug gdb/26598] skip compares pattern against mangled name
  2020-09-10 14:59 [Bug gdb/26598] New: skip compares pattern against mangled name simark at simark dot ca
  2020-09-10 15:00 ` [Bug gdb/26598] " simark at simark dot ca
  2020-09-10 15:08 ` brobecker at gnat dot com
@ 2020-09-10 15:49 ` simark at simark dot ca
  2020-09-10 17:34 ` simark at simark dot ca
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: simark at simark dot ca @ 2020-09-10 15:49 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Simon Marchi <simark at simark dot ca> ---
gdb.base/skip.c and gdb.base/skip1.c compile as C++, so a good start might be
to run the test (gdb.base/skip.exp) with it compiled as a C program, then as a
C++ program.  It might be enough, but we could also add some specific C++
tests.

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

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

* [Bug gdb/26598] skip compares pattern against mangled name
  2020-09-10 14:59 [Bug gdb/26598] New: skip compares pattern against mangled name simark at simark dot ca
                   ` (2 preceding siblings ...)
  2020-09-10 15:49 ` simark at simark dot ca
@ 2020-09-10 17:34 ` simark at simark dot ca
  2020-09-10 17:37 ` simark at simark dot ca
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: simark at simark dot ca @ 2020-09-10 17:34 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Simon Marchi <simark at simark dot ca> ---
(In reply to Simon Marchi from comment #1)
> gdb.base/skip.c and gdb.base/skip1.c compile as C++, so a good start might
> be to run the test (gdb.base/skip.exp) with it compiled as a C program, then
> as a C++ program.  It might be enough, but we could also add some specific
> C++ tests.

I'll attach some patches that does this.  It is not sufficient to catch the bug
though, it will need to be tweaked further to exercise this.

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

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

* [Bug gdb/26598] skip compares pattern against mangled name
  2020-09-10 14:59 [Bug gdb/26598] New: skip compares pattern against mangled name simark at simark dot ca
                   ` (3 preceding siblings ...)
  2020-09-10 17:34 ` simark at simark dot ca
@ 2020-09-10 17:37 ` simark at simark dot ca
  2020-09-10 17:37 ` simark at simark dot ca
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: simark at simark dot ca @ 2020-09-10 17:37 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Simon Marchi <simark at simark dot ca> ---
Created attachment 12833
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12833&action=edit
Patch 1 to improve test case

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

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

* [Bug gdb/26598] skip compares pattern against mangled name
  2020-09-10 14:59 [Bug gdb/26598] New: skip compares pattern against mangled name simark at simark dot ca
                   ` (4 preceding siblings ...)
  2020-09-10 17:37 ` simark at simark dot ca
@ 2020-09-10 17:37 ` simark at simark dot ca
  2020-09-16 18:05 ` tromey at sourceware dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: simark at simark dot ca @ 2020-09-10 17:37 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Simon Marchi <simark at simark dot ca> ---
Created attachment 12834
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12834&action=edit
Patch 2 to improve test case

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

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

* [Bug gdb/26598] skip compares pattern against mangled name
  2020-09-10 14:59 [Bug gdb/26598] New: skip compares pattern against mangled name simark at simark dot ca
                   ` (5 preceding siblings ...)
  2020-09-10 17:37 ` simark at simark dot ca
@ 2020-09-16 18:05 ` tromey at sourceware dot org
  2020-09-16 18:10 ` tromey at sourceware dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2020-09-16 18:05 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |tromey at sourceware dot org

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

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

* [Bug gdb/26598] skip compares pattern against mangled name
  2020-09-10 14:59 [Bug gdb/26598] New: skip compares pattern against mangled name simark at simark dot ca
                   ` (6 preceding siblings ...)
  2020-09-16 18:05 ` tromey at sourceware dot org
@ 2020-09-16 18:10 ` tromey at sourceware dot org
  2020-09-16 18:11 ` tromey at sourceware dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2020-09-16 18:10 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
FWIW I found it easier to just write a new test.
I tried reworking the existing test but there were
a lot of tiny fixes to make.

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

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

* [Bug gdb/26598] skip compares pattern against mangled name
  2020-09-10 14:59 [Bug gdb/26598] New: skip compares pattern against mangled name simark at simark dot ca
                   ` (7 preceding siblings ...)
  2020-09-16 18:10 ` tromey at sourceware dot org
@ 2020-09-16 18:11 ` tromey at sourceware dot org
  2020-09-16 19:53 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2020-09-16 18:11 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
https://sourceware.org/pipermail/gdb-patches/2020-September/171908.html

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

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

* [Bug gdb/26598] skip compares pattern against mangled name
  2020-09-10 14:59 [Bug gdb/26598] New: skip compares pattern against mangled name simark at simark dot ca
                   ` (8 preceding siblings ...)
  2020-09-16 18:11 ` tromey at sourceware dot org
@ 2020-09-16 19:53 ` cvs-commit at gcc dot gnu.org
  2020-09-16 19:56 ` cvs-commit at gcc dot gnu.org
  2020-09-16 19:57 ` tromey at sourceware dot org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-16 19:53 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #7 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

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

commit fe83066292c6aaa8227b2d38c343379a209cb4ba
Author: Tom Tromey <tromey@adacore.com>
Date:   Wed Sep 16 09:49:36 2020 -0600

    Match demangled name in "skip"

    PR gdb/26598 notes that, before commit bcfe6157ca28 ("Use the linkage
    name if it exists"), the "skip" command would match the demangled name
    of a symbol, but now only matches the linkage name.

    This patch fixes this regression.  I looked at all calls to
    function_name_is_marked_for_skip, and only one used the linkage name.

    2020-09-16  Tom Tromey  <tromey@adacore.com>

            PR gdb/26598:
            * infrun.c (fill_in_stop_func): Use find_pc_partial_function_sym.

    gdb/testsuite/ChangeLog
    2020-09-16  Tom Tromey  <tromey@adacore.com>

            PR gdb/26598:
            * gdb.base/skipcxx.exp: New file.
            * gdb.base/skipcxx.cc: New file.

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

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

* [Bug gdb/26598] skip compares pattern against mangled name
  2020-09-10 14:59 [Bug gdb/26598] New: skip compares pattern against mangled name simark at simark dot ca
                   ` (9 preceding siblings ...)
  2020-09-16 19:53 ` cvs-commit at gcc dot gnu.org
@ 2020-09-16 19:56 ` cvs-commit at gcc dot gnu.org
  2020-09-16 19:57 ` tromey at sourceware dot org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-16 19:56 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #8 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-10-branch branch has been updated by Tom Tromey
<tromey@sourceware.org>:

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

commit 1f2950be0b170553772eed6662c0e6613cbd58f7
Author: Tom Tromey <tromey@adacore.com>
Date:   Wed Sep 16 09:49:36 2020 -0600

    Match demangled name in "skip"

    PR gdb/26598 notes that, before commit bcfe6157ca28 ("Use the linkage
    name if it exists"), the "skip" command would match the demangled name
    of a symbol, but now only matches the linkage name.

    This patch fixes this regression.  I looked at all calls to
    function_name_is_marked_for_skip, and only one used the linkage name.

    2020-09-16  Tom Tromey  <tromey@adacore.com>

            PR gdb/26598:
            * infrun.c (fill_in_stop_func): Use find_pc_partial_function_sym.

    gdb/testsuite/ChangeLog
    2020-09-16  Tom Tromey  <tromey@adacore.com>

            PR gdb/26598:
            * gdb.base/skipcxx.exp: New file.
            * gdb.base/skipcxx.cc: New file.

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

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

* [Bug gdb/26598] skip compares pattern against mangled name
  2020-09-10 14:59 [Bug gdb/26598] New: skip compares pattern against mangled name simark at simark dot ca
                   ` (10 preceding siblings ...)
  2020-09-16 19:56 ` cvs-commit at gcc dot gnu.org
@ 2020-09-16 19:57 ` tromey at sourceware dot org
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2020-09-16 19:57 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.

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

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

end of thread, other threads:[~2020-09-16 19:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 14:59 [Bug gdb/26598] New: skip compares pattern against mangled name simark at simark dot ca
2020-09-10 15:00 ` [Bug gdb/26598] " simark at simark dot ca
2020-09-10 15:08 ` brobecker at gnat dot com
2020-09-10 15:49 ` simark at simark dot ca
2020-09-10 17:34 ` simark at simark dot ca
2020-09-10 17:37 ` simark at simark dot ca
2020-09-10 17:37 ` simark at simark dot ca
2020-09-16 18:05 ` tromey at sourceware dot org
2020-09-16 18:10 ` tromey at sourceware dot org
2020-09-16 18:11 ` tromey at sourceware dot org
2020-09-16 19:53 ` cvs-commit at gcc dot gnu.org
2020-09-16 19:56 ` cvs-commit at gcc dot gnu.org
2020-09-16 19:57 ` tromey at sourceware dot 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).