This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

AW: Bitfields


> I realize the submitted patch is just an experiment.
> If you want to submit a patch for formal review you'll need to remove
> all the whitespace fixes (do them in a separate patch), and remove the
> debugging prints.
>
At the new ptype.diff only the code changes are included.
It's a patch for gdb7.0.1 which shows the bitpos and bitsize at bitfields at c/c++.
At file langugage.h at the "struct language_defn" an additional member la_print_type_through_value is added. Through this change all language dependent files had to be changed.

> One issue is that there's one school of thought that says that for h/w
> registers "bitpos" must be printed according to the architecture's
> specification: some architectures number the most significant bit as
> bit 0, others number the least significant bit as bit 0.  When used in
> the context of printing h/w register bits, I do think gdb's output
> should match ISA docs.
> But imposing such numbering schemes on the user for structs in general
> would be bad I think.
> I guess we could add a flag to TYPE_CODE_STRUCT that says whether to
> print bitpos according to the ISA or not.
This not implemented in the patch.

Attachment: ptype.diff
Description: ptype.diff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]