[Bug python/30489] gdb.Type.template_argument issue when using __int128 unsigned

werwolv98 at gmail dot com sourceware-bugzilla@sourceware.org
Fri May 26 06:18:25 GMT 2023


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.


More information about the Gdb-prs mailing list