public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/26122] New: gdb fails to demangle a name
@ 2020-06-16 15:18 mgaudet at mozilla dot com
  2020-09-02 16:18 ` [Bug c++/26122] " trass3r at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: mgaudet at mozilla dot com @ 2020-06-16 15:18 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 26122
           Summary: gdb fails to demangle a name
           Product: gdb
           Version: 9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: mgaudet at mozilla dot com
  Target Milestone: ---

Using a locally compiled GDB 9.2, I'm trying to use `skip -rfunction`,
however,according to `set debug skip on`, the regexp is being applied to the
mangled name, not the demangled name: 

```
(gdb) step 
skip: checking if function
_ZN2JS6HandleINS_11PropertyKeyEEC2IS1_EERKNS_6RootedIT_EENSt9enable_ifIXsr3stdE16is_convertible_vIS5_S1_EEiE4typeE
matches regex .*JS::Handle.*...no.
skip: checking if function
_ZN2JS6HandleINS_11PropertyKeyEEC2IS1_EERKNS_6RootedIT_EENSt9enable_ifIXsr3stdE16is_convertible_vIS5_S1_EEiE4typeE
matches regex .*JS::Handle.*...no.
```

This appears to be because the name cannot be demangled by GDB: 

```
(gdb) demangle
_ZN2JS6HandleINS_11PropertyKeyEEC2IS1_EERKNS_6RootedIT_EENSt9enable_ifIXsr3stdE16is_convertible_vIS5_S1_EEiE4typeE 
Can't demangle
"_ZN2JS6HandleINS_11PropertyKeyEEC2IS1_EERKNS_6RootedIT_EENSt9enable_ifIXsr3stdE16is_convertible_vIS5_S1_EEiE4typeE"
```

Gimli-rs cpp_demangle [1] appears to demangle it correctly: 


```
$ /home/matthew/.cargo/bin/cppfilt 
_ZN2JS6HandleINS_11PropertyKeyEEC2IS1_EERKNS_6RootedIT_EENSt9enable_ifIXsr3stdE16is_convertible_vIS5_S1_EEiE4typeE 
JS::Handle<JS::PropertyKey>::Handle<JS::PropertyKey>(std::enable_if<std::is_convertible_v<JS::PropertyKey,
JS::PropertyKey>, int>::type) 
```

[1]: https://github.com/gimli-rs/cpp_demangle

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

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

* [Bug c++/26122] gdb fails to demangle a name
  2020-06-16 15:18 [Bug c++/26122] New: gdb fails to demangle a name mgaudet at mozilla dot com
@ 2020-09-02 16:18 ` trass3r at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: trass3r at gmail dot com @ 2020-09-02 16:18 UTC (permalink / raw)
  To: gdb-prs

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

trass3r <trass3r at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |trass3r at gmail dot com

--- Comment #1 from trass3r <trass3r at gmail dot com> ---
Confirmed on trunk but it has nothing to do with not being able to demangle.
It happens with a simple std::make_unique<int>(5) call and regex ^std:: too.

The problem is that in infrun.c
function_name_is_marked_for_skip (ecs->stop_func_name,
actually gets the mangled name unlike in other calls to that function.

https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/infrun.c;h=938bc081a1c96ab0551046b6cccc777bd40dd78e;hb=HEAD#l6859

The only workaround is to match the mangled name, 'skip -rfu ^_ZSt' in my case.

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

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 15:18 [Bug c++/26122] New: gdb fails to demangle a name mgaudet at mozilla dot com
2020-09-02 16:18 ` [Bug c++/26122] " trass3r at gmail dot com

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).