Re: [PATCH 1/2] gdb: fix crash when pretty printing anonymous struct with base class
Simon Marchi <[email protected]>
| Newsgroups | gmane.comp.gdb.patches |
|---|---|
| Message-ID | <[email protected]> |
On 8/20/26 12:21 PM, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi <[email protected]> writes: > > Simon> As I was reviewing another patch, I was wondering if we allowed > Simon type->name() to be nullptr. The answer is yes, but there are some spots > Simon> that don't check for nullptr, when they should. > > Thanks for looking at this. > > I sometimes wonder if this is something we ought to fix, like reject > nullptr here. But shrug. I think we could initialize it to "" so that it's never nullptr, and we have just one normal way to representing a type with no name. > Simon> - gdb_puts (type->name (), stream); > Simon> + gdb_puts (type->safe_name (), stream); > > It would be nice here if the <...> form were in metadata style. I'll look into it. Simon