Bug 272922 - devel/gdb: printing the std::string array fails: {Python Exception <class 'gdb.error'>: There is no member or method named __short_mask.
Summary: devel/gdb: printing the std::string array fails: {Python Exception <class 'gd...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: John Baldwin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-03 20:46 UTC by Yuri Victorovich
Modified: 2024-09-25 14:07 UTC (History)
0 users

See Also:
pizzamig: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2023-08-03 20:46:00 UTC
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.
}

This is caused by files included in the gdb distribution but originating from the libc++ project.


gdb-13.1
FreeBSD 13.2
Python-3.9

==References==
* GDB bug report: https://sourceware.org/bugzilla/show_bug.cgi?id=30556
* LLVM bug report: https://github.com/llvm/llvm-project/issues/64398
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2023-08-03 21:52:19 UTC
I think that this tarball bsdjhb-libcxx-gdbpy-03d0d9b_GH0.tar.gz contains an outdated printers.py

You should switch to the latest LLVM repository for printers.py
Comment 2 Luca Pizzamiglio freebsd_committer freebsd_triage 2023-08-06 15:16:32 UTC
Re-assign to jhb@, as he is maintaining the python scritps
Comment 3 John Baldwin freebsd_committer freebsd_triage 2024-08-05 19:17:15 UTC
I've added updates to the libcxx-gdbpy scripts for this (and another change) and included it in the GDB 15 update review at https://reviews.freebsd.org/D46232
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-09-24 16:10:02 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=82beca9e630ec9226c58a9cd3ee9adb355e21314

commit 82beca9e630ec9226c58a9cd3ee9adb355e21314
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-09-24 16:08:56 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-09-24 16:08:56 +0000

    devel/gdb: Upgrade to 15.1

    This includes an update to the bundled libc++ pretty printers with
    fixes for recent changes in libc++ to std::string and std::unordered_map.

    PR:             272922
    Sponsored by:   AFRL, DARPA
    Differential Revision:  https://reviews.freebsd.org/D46232

 devel/gdb/Makefile                       |   7 +-
 devel/gdb/distinfo                       |  10 +--
 devel/gdb/files/extrapatch-kgdb          | 102 +++++++++++++--------------
 devel/gdb/files/kgdb/aarch64-fbsd-kern.c |   9 +--
 devel/gdb/files/kgdb/amd64fbsd-kern.c    |   8 +--
 devel/gdb/files/kgdb/arm-fbsd-kern.c     |  10 +--
 devel/gdb/files/kgdb/fbsd-kld.c          | 116 +++++++++++++------------------
 devel/gdb/files/kgdb/fbsd-kthr.c         |  17 ++---
 devel/gdb/files/kgdb/fbsd-kvm.c          |  10 +--
 devel/gdb/files/kgdb/i386fbsd-kern.c     |  16 ++---
 devel/gdb/files/kgdb/kgdb-main.c         |   2 +
 devel/gdb/files/kgdb/kgdb.h              |   2 +-
 devel/gdb/files/kgdb/mipsfbsd-kern.c     |  10 +--
 devel/gdb/files/kgdb/ppcfbsd-kern.c      |   8 +--
 devel/gdb/files/kgdb/riscv-fbsd-kern.c   |   8 +--
 devel/gdb/files/kgdb/sparc64fbsd-kern.c  |   8 +--
 devel/gdb/pkg-plist                      |   5 ++
 17 files changed, 167 insertions(+), 181 deletions(-)