This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
odd bit-size types in gdb
- From: Ashutosh Pal <Ashutosh dot Pal at synopsys dot com>
- To: "gdb at sourceware dot org" <gdb at sourceware dot org>
- Date: Tue, 8 Aug 2017 12:08:38 +0000
- Subject: odd bit-size types in gdb
- Authentication-results: sourceware.org; auth=none
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