public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "ppluzhnikov at google dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug python/27021] Python Exception <class 'AttributeError'> 'NoneType' object has no attribute 'pointer': when using pretty-printer
Date: Sun, 06 Dec 2020 16:58:14 +0000	[thread overview]
Message-ID: <bug-27021-4717-lrGKzPdh3D@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27021-4717@http.sourceware.org/bugzilla/>

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

--- Comment #2 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
There is a very similar failure when the current frame is in the correct ELF
image, but has the "wrong" language:

--- main.cc ---
#include <map>

extern "C" int foo();
static std::map<int, int> foo_map;

int main()
{
  foo_map[1] = 10;
  foo_map[2] = 20;
  return foo();
}

--- foo.c --- // Note: plain "C"
#include <stdlib.h>

int foo() { abort(); }


gcc -g -c foo.c && g++ -g main.cc foo.o && ./a.out
gdb ./a.out core

GNU gdb (GDB) 11.0.50.20201205-git
...
Reading symbols from a.out...
[New LWP 228379]
Core was generated by `./a.out'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) up
#1  0x00007fb556b98537 in __GI_abort () at abort.c:79
79      abort.c: No such file or directory.
(gdb)
#2  0x000055732abe9942 in foo () at foo.c:3
3       int foo() { abort(); }
(gdb) p foo_map
Python Exception <type 'exceptions.AttributeError'> 'NoneType' object has no
attribute 'pointer':
$1 = std::map with 2 elements

(gdb) info symbol foo
foo in section .text of /tmp/a.out

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

  parent reply	other threads:[~2020-12-06 16:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-05  7:35 [Bug python/27021] New: " ppluzhnikov at google dot com
2020-12-05 16:40 ` [Bug python/27021] " ppluzhnikov at google dot com
2020-12-06 15:08 ` z49x2vmq at gmail dot com
2020-12-06 16:58 ` ppluzhnikov at google dot com [this message]
2020-12-08  1:05 ` z49x2vmq at gmail dot com
2020-12-08  1:11 ` z49x2vmq at gmail dot com
2020-12-08 18:31 ` simark at simark dot ca
2020-12-16 12:33 ` rae.kim at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-27021-4717-lrGKzPdh3D@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).