odd bit-size types in gdb

Ashutosh Pal <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <40DC337867FFD941BD18FA705989F8F901617D5F2A@IN01WEMBXB.internal.synopsys.com>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.