Bug 11796 - `list' and `info line' fail on `struct typename'
Summary: `list' and `info line' fail on `struct typename'
Status: UNCONFIRMED
Alias: None
Product: gdb
Classification: Unclassified
Component: symtab (show other bugs)
Version: unknown
: P2 normal
Target Milestone: 7.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-08 08:22 UTC by Jan Kratochvil
Modified: 2023-12-11 01:00 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2010-07-08 08:22:21 UTC
It works for single-word types:

(gdb) info line htab_t
Line number 144 is out of range for "./../include/hashtab.h".
(gdb) list htab_t
144	typedef struct htab *htab_t;

But not for multi-word types:

(gdb) info line struct symbol
Function "struct" not defined.
(gdb) list struct symbol
Function "struct" not defined.

Despite:

(gdb) ptype struct symbol
type = struct symbol {
    struct general_symbol_info ginfo;
[...]
}

I believe `list', `info line' (others?) should not take just the first word.
Comment 1 Tom Tromey 2023-12-11 01:00:04 UTC
It's strange that they work for types at all.
This is probably an artifact of the VAR_DOMAIN stuff,
where some types appear in the same namespace as
variables and functions.

"list" and "info line" accept a linespec.
I do think it would be good if this worked, though
after bug #30164 it will be a little harder.
Perhaps we could add a new "also try a type" flag
to linespec, so it could fall back on finding
a type.