public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/30556] New: printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask.
@ 2023-06-15 17:45 yuri at tsoft dot com
  2023-06-16 14:25 ` [Bug c++/30556] " tromey at sourceware dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: yuri at tsoft dot com @ 2023-06-15 17:45 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30556
           Summary: printing the std::string array fails: {Python
                    Exception <class 'gdb.error'>: There is no member or
                    method named __short_mask.
           Product: gdb
           Version: 13.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: yuri at tsoft dot com
  Target Milestone: ---

Printing colourData in this code:

include <string>

static std::string colourData [] {
        std::string("x"),
        std::string("y")
};

int main() {
}


fails:

Breakpoint 1, main () at ss.cpp:12
12      }
(gdb) p colourData
$1 = {Python Exception <class 'gdb.error'>: There is no member or method named
__short_mask.
, Python Exception <class 'gdb.error'>: There is no member or method named
__short_mask.
}


FreeBSD 13.2
Python-3.9

-- 
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 c++/30556] printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask.
  2023-06-15 17:45 [Bug c++/30556] New: printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask yuri at tsoft dot com
@ 2023-06-16 14:25 ` tromey at sourceware dot org
  2023-08-03 16:44 ` tromey at sourceware dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2023-06-16 14:25 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
This works for me:

(gdb) p colourData 
$1 = {"x", "y"}

Using:
set python print-stack full
would show more of what went wrong.

Most likely, though, this is a bug in whatever pretty-printers you
are using.  gdb doesn't refer to "__short_mask".

-- 
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 c++/30556] printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask.
  2023-06-15 17:45 [Bug c++/30556] New: printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask yuri at tsoft dot com
  2023-06-16 14:25 ` [Bug c++/30556] " tromey at sourceware dot org
@ 2023-08-03 16:44 ` tromey at sourceware dot org
  2023-08-03 16:50 ` yuri at tsoft dot com
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2023-08-03 16:44 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-08-03
             Status|UNCONFIRMED                 |WAITING

-- 
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 c++/30556] printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask.
  2023-06-15 17:45 [Bug c++/30556] New: printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask yuri at tsoft dot com
  2023-06-16 14:25 ` [Bug c++/30556] " tromey at sourceware dot org
  2023-08-03 16:44 ` tromey at sourceware dot org
@ 2023-08-03 16:50 ` yuri at tsoft dot com
  2023-08-03 18:34 ` tromey at sourceware dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: yuri at tsoft dot com @ 2023-08-03 16:50 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from yuri at tsoft dot com ---
I don't have the ~/.gdbinit file so everything should be default.
Where could the pretty printers come from?

-- 
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 c++/30556] printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask.
  2023-06-15 17:45 [Bug c++/30556] New: printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask yuri at tsoft dot com
                   ` (2 preceding siblings ...)
  2023-08-03 16:50 ` yuri at tsoft dot com
@ 2023-08-03 18:34 ` tromey at sourceware dot org
  2023-08-03 18:42 ` yuri at tsoft dot com
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2023-08-03 18:34 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
They can be loaded in various ways, e.g. if your program
loads a shared library, associated printers might show up.
You can see with "info pretty-printer".

Anyway see the earlier note about "set python print-stack full".
That output would show exactly where the exception occurs.
Can you send that?

-- 
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 c++/30556] printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask.
  2023-06-15 17:45 [Bug c++/30556] New: printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask yuri at tsoft dot com
                   ` (3 preceding siblings ...)
  2023-08-03 18:34 ` tromey at sourceware dot org
@ 2023-08-03 18:42 ` yuri at tsoft dot com
  2023-08-03 18:43 ` yuri at tsoft dot com
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: yuri at tsoft dot com @ 2023-08-03 18:42 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from yuri at tsoft dot com ---
(gdb) info pretty-printer
global pretty-printers:
  builtin
    mpx_bound128
objfile /usr/lib/libc++.so.1 pretty-printers:
  libc++
    deque
    deque::iterator
    forward_list
    forward_list::iterator
    list
    list::iterator
    stack
    string
    unique_ptr
    unordered_map
    unordered_map::iterator
    vector
(gdb)

-- 
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 c++/30556] printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask.
  2023-06-15 17:45 [Bug c++/30556] New: printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask yuri at tsoft dot com
                   ` (4 preceding siblings ...)
  2023-08-03 18:42 ` yuri at tsoft dot com
@ 2023-08-03 18:43 ` yuri at tsoft dot com
  2023-08-03 18:44 ` yuri at tsoft dot com
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: yuri at tsoft dot com @ 2023-08-03 18:43 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from yuri at tsoft dot com ---
(gdb) set python print-stack full
(gdb) p colourData
$2 = {Traceback (most recent call last):
  File "/usr/local/share/libcxx-gdbpy/libcxx/printers.py", line 310, in
to_string
    is_long = (r_first['__s']['__size_'] & self.val['__short_mask']) != 0
gdb.error: There is no member or method named __short_mask.

, Traceback (most recent call last):
  File "/usr/local/share/libcxx-gdbpy/libcxx/printers.py", line 310, in
to_string
    is_long = (r_first['__s']['__size_'] & self.val['__short_mask']) != 0
gdb.error: There is no member or method named __short_mask.

}
(gdb)

-- 
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 c++/30556] printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask.
  2023-06-15 17:45 [Bug c++/30556] New: printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask yuri at tsoft dot com
                   ` (5 preceding siblings ...)
  2023-08-03 18:43 ` yuri at tsoft dot com
@ 2023-08-03 18:44 ` yuri at tsoft dot com
  2023-08-03 18:46 ` yuri at tsoft dot com
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: yuri at tsoft dot com @ 2023-08-03 18:44 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from yuri at tsoft dot com ---
$ pkg which /usr/local/share/libcxx-gdbpy/libcxx/printers.py
/usr/local/share/libcxx-gdbpy/libcxx/printers.py was installed by package
gdb-13.1_2

-- 
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 c++/30556] printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask.
  2023-06-15 17:45 [Bug c++/30556] New: printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask yuri at tsoft dot com
                   ` (6 preceding siblings ...)
  2023-08-03 18:44 ` yuri at tsoft dot com
@ 2023-08-03 18:46 ` yuri at tsoft dot com
  2023-08-03 19:20 ` simon.marchi at polymtl dot ca
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: yuri at tsoft dot com @ 2023-08-03 18:46 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #7 from yuri at tsoft dot com ---
So gdb does refer to '__short_mask' in the file
/usr/local/share/libcxx-gdbpy/libcxx/printers.py that it installs.

-- 
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 c++/30556] printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask.
  2023-06-15 17:45 [Bug c++/30556] New: printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask yuri at tsoft dot com
                   ` (7 preceding siblings ...)
  2023-08-03 18:46 ` yuri at tsoft dot com
@ 2023-08-03 19:20 ` simon.marchi at polymtl dot ca
  2023-08-03 20:37 ` yuri at tsoft dot com
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: simon.marchi at polymtl dot ca @ 2023-08-03 19:20 UTC (permalink / raw)
  To: gdb-prs

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

Simon Marchi <simon.marchi at polymtl dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simon.marchi at polymtl dot ca

--- Comment #8 from Simon Marchi <simon.marchi at polymtl dot ca> ---
(In reply to yuri from comment #7)
> So gdb does refer to '__short_mask' in the file
> /usr/local/share/libcxx-gdbpy/libcxx/printers.py that it installs.

That file is installed (and maintained) by libcxx:

https://github.com/llvm-mirror/libcxx/blob/master/utils/gdb/libcxx/printers.py

-- 
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 c++/30556] printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask.
  2023-06-15 17:45 [Bug c++/30556] New: printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask yuri at tsoft dot com
                   ` (8 preceding siblings ...)
  2023-08-03 19:20 ` simon.marchi at polymtl dot ca
@ 2023-08-03 20:37 ` yuri at tsoft dot com
  2023-08-03 20:39 ` yuri at tsoft dot com
  2023-08-03 22:01 ` yuri at tsoft dot com
  11 siblings, 0 replies; 13+ messages in thread
From: yuri at tsoft dot com @ 2023-08-03 20:37 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #9 from yuri at tsoft dot com ---
(In reply to Simon Marchi from comment #8)
> (In reply to yuri from comment #7)
> > So gdb does refer to '__short_mask' in the file
> > /usr/local/share/libcxx-gdbpy/libcxx/printers.py that it installs.
> 
> That file is installed (and maintained) by libcxx:
> 
> https://github.com/llvm-mirror/libcxx/blob/master/utils/gdb/libcxx/printers.
> py

So this looks like a bug in libcxx-distributed files.

-- 
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 c++/30556] printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask.
  2023-06-15 17:45 [Bug c++/30556] New: printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask yuri at tsoft dot com
                   ` (9 preceding siblings ...)
  2023-08-03 20:37 ` yuri at tsoft dot com
@ 2023-08-03 20:39 ` yuri at tsoft dot com
  2023-08-03 22:01 ` yuri at tsoft dot com
  11 siblings, 0 replies; 13+ messages in thread
From: yuri at tsoft dot com @ 2023-08-03 20:39 UTC (permalink / raw)
  To: gdb-prs

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

yuri at tsoft dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |https://github.com/llvm/llv
                   |                            |m-project/issues/64398

-- 
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 c++/30556] printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask.
  2023-06-15 17:45 [Bug c++/30556] New: printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask yuri at tsoft dot com
                   ` (10 preceding siblings ...)
  2023-08-03 20:39 ` yuri at tsoft dot com
@ 2023-08-03 22:01 ` yuri at tsoft dot com
  11 siblings, 0 replies; 13+ messages in thread
From: yuri at tsoft dot com @ 2023-08-03 22:01 UTC (permalink / raw)
  To: gdb-prs

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

yuri at tsoft dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |NOTABUG
             Status|WAITING                     |RESOLVED

--- Comment #10 from yuri at tsoft dot com ---
The old libcxx snapshot used in the FreeBSD devel/gdb port caused 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

end of thread, other threads:[~2023-08-03 22:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15 17:45 [Bug c++/30556] New: printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask yuri at tsoft dot com
2023-06-16 14:25 ` [Bug c++/30556] " tromey at sourceware dot org
2023-08-03 16:44 ` tromey at sourceware dot org
2023-08-03 16:50 ` yuri at tsoft dot com
2023-08-03 18:34 ` tromey at sourceware dot org
2023-08-03 18:42 ` yuri at tsoft dot com
2023-08-03 18:43 ` yuri at tsoft dot com
2023-08-03 18:44 ` yuri at tsoft dot com
2023-08-03 18:46 ` yuri at tsoft dot com
2023-08-03 19:20 ` simon.marchi at polymtl dot ca
2023-08-03 20:37 ` yuri at tsoft dot com
2023-08-03 20:39 ` yuri at tsoft dot com
2023-08-03 22:01 ` yuri at tsoft 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).