This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Option to elide single-bit bitfields when printing structures
- To: Zack Weinberg <zackw at Stanford dot EDU>
- Subject: Re: Option to elide single-bit bitfields when printing structures
- From: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Date: Sun, 25 Feb 2001 09:51:13 +0200 (IST)
- cc: dberlin at redhat dot com, gdb-patches at sources dot redhat dot com
On Sat, 24 Feb 2001, Zack Weinberg wrote:
> > Then IMHO this feature is less helpful than it could be. See the list
> > above: can you really remember all of the flags if they are not shown?
> > And if half of them are shown, is it really easy to know which are and
> > which aren't?
>
> Perhaps you are not familiar with the way these flags get used in gcc.
I thought you were proposing a general-purpose feature, not something
specific to GCC. If this is GCC-specific, I tend to agree with Michael:
throw together a bunch of special-purpose commands using the GDB
scripting facilities, put them on .gdbinit distributed with GCC, and be
done with it. That's what Emacs does, for example.
> GCC already has a prettyprinter you can call from the debugger for
> these things, which obeys the same convention. The problem with it is
> that if the structure is damaged, the prettyprinter is liable to
> crash.
Perhaps it would be better to make the GCC prettyprinter more robust in
the face of such calamities. After all, GDB doesn't do anything that any
other program cannot do, to avoid crashing when accessing invalid
addresses and corrupted data structures.