public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "werwolv98 at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug python/30489] gdb.Type.template_argument issue when using __int128 unsigned
Date: Fri, 26 May 2023 06:18:25 +0000	[thread overview]
Message-ID: <bug-30489-4717-PCcWy2VvfI@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30489-4717@http.sourceware.org/bugzilla/>

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

--- Comment #2 from WerWolv <werwolv98 at gmail dot com> ---
(In reply to Tom Tromey from comment #1)
> (In reply to WerWolv from comment #0)
> 
> > The pretty printer seems to use `Type.template_argument(n)` under the hood
> > which throws a `RuntimeError: syntax error` if one of the types is a
> > unsigned int128 type.
> 
> Can you post the Python stack trace for this?
> 
> Anyway I was able to reproduce the behavior, even with git master --
> eliminating my theory that maybe the recent 128-bit work fixed this.

I wrote a small test script that simply tries to print the first template type
name as value of the type. The stacktrace for that is
```
Traceback (most recent call last):
  File "<string>", line 15, in to_string
  File "<string>", line 5, in get_template_arg_list
RuntimeError: syntax error
```

The only place I could find "syntax error" in the codebase was in the parser so
I assume it's comming from there somewhere.

With the original libstdc++ pretty printer you don't get any stacktrace at all
because they use a try-except in their get_template_arg_list as terminating
condition which fails on the first try so it just returns an empty list of
template types

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

  parent reply	other threads:[~2023-05-26  6:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 13:45 [Bug python/30489] New: " werwolv98 at gmail dot com
2023-05-25 16:03 ` [Bug python/30489] " tromey at sourceware dot org
2023-05-26  6:18 ` werwolv98 at gmail dot com [this message]
2023-05-26 19:28 ` tromey at sourceware dot org
2023-05-26 21:23 ` tromey at sourceware dot org

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-30489-4717-PCcWy2VvfI@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).