Different structure sizes
Different structure sizes
- Subject: Different structure sizes
- From: david tay <email@hidden>
- Date: Mon, 12 Dec 2005 17:41:32 -0800
Hi,
I have compiled some code that uses data structures such as
typedef struct PadState {
UInt8 num;
UInt8 myData[7];
} PadState;
and
typedef struct DeviceSettings {
PadState myState;
UInt32 myOtherStuff1;
UInt32 myOtherStuff2;
UInt8 myByteSizedData1;
UInt8 myByteSizedData2;
UInt8 myByteSizedData3;
UInt8 myByteSizedData4;
} DeviceSettings;
In a simple user space test app, sizeof(PadState) gives 8 and sizeof
(DeviceSettings) gives 20 when inspecting things using gdb.
When I use the same constructs in a kext, and look at things with
remote gdb,
sizeof(PadState) gives 6 and sizeof(DeviceSettings) is 20.
Both the test app and kext were compiled using gcc 4.0.1 using XCode
2.2 with MacOSX10.4u.sdk.
Is this caused by a bug in gdb? Or should I be concerned that this
could be a real problem.
Thanks,
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden