This is the mail archive of the gdb@sourceware.cygnus.com 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]

TARGET_CHAR_BIT != 8



I'm in the process of revamping gdb for the TMS320C[34]x DSPs.  When I
originally did this port a few years ago, I used gdb-4.16 as the
basis.  Now I'm using the current cvs sources.  However, in the
intervening years there have been some major changes to the API that
I'm trying to reconcile.

My biggest problem is with the TYPE_LENGTH accessor macro.

The comment in gdbtypes.h has this pertinent comment for the length
element in struct type.

    /* Length of storage for a value of this type.  Various places pass
       this to memcpy and such, meaning it must be in units of
       HOST_CHAR_BIT.  Various other places expect they can calculate
       addresses by adding it and such, meaning it must be in units of
       TARGET_CHAR_BIT.  For some DSP targets, in which HOST_CHAR_BIT
       will (presumably) be 8 and TARGET_CHAR_BIT will be (say) 32, this
       is a problem.  One fix would be to make this field in bits
       (requiring that it always be a multiple of HOST_CHAR_BIT and
       TARGET_CHAR_BIT)--the other choice would be to make it
       consistently in units of HOST_CHAR_BIT.  */

The tic4x target has TARGET_CHAR_BIT defined as 32 and I'm building
gdb on an 8-bit host so I'm currently hosed.  Now what puzzles me is
that older versions of gdb had a length_bits field that worked just
fine for me.  Moreover, I cannot find any reference to the change in
the ChangeLogs so can some kind soul tell me why the change from bits
to chars was necessary and what is the best approach for me to rectify
the situation?


Cheers, Michael.



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