This is the mail archive of the gdb@sources.redhat.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]
Other format: [Raw text]

Re: integer types in gdb code



CORE_ADDR  ~= void *
LONGEST ~= long
ULONGEST ~= unsigned long

No 16 and 8 bit constructs?  Also, what if you want to guarantee the number
of bits?  From defs.h it looks to me like LONGEST could be 32 or 64 bits, so
if you're reading structures over the wire, you could have problems.
The above are GDB's host types.

When representing target types (or stuff related to a protocol) GDB can either use a function like extract_unsigned_integer() or construct a type exactly describing the data using that (but be wary of byte order problems).

Trying to do something like:

struct { uint32_t i; ... }

can end up being non-portable (due to struct packing issues and the like).

Andrew



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