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]

odd bit-size types in gdb


Hi Experts,

Has anybody earlier looked into adding support for odd bit-size types with in GDB - for example, supporting
    - a integer like type of 23 (say) bits
    - a vector (or array) type of 23x100 bits
I am retargeting gdb for an internal processor model that has registers, memory-words and the corresponding C compiler intrinsic types of odd bit-sizes. In the GDB code, I noticed a few things which will require to be changed to support this:
     - the type lengths today are stored in terms of bytes. Moreover, only DW_AT_byte_size attribute is read for getting the type sizes from dwarf info
     - operation on Value objects like reading an array element from the fetched byte buffer etc. will require bit-level operations
Are there other more basic things that may require changes for this?
Although for now, I thought of taking an alternate approach where I align the types to next closest 8-bit boundary and apply/remove bit-paddings when getting/setting the values from the target. This will hopefully keep GDB internals abstracted from odd bit-sizes handling. Do you see any gotcha's with this approach?

Thanks and Regards,
Ashutosh



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