• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
C++ class members debugging and alignment problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C++ class members debugging and alignment problems


  • Subject: C++ class members debugging and alignment problems
  • From: Howard Moon <email@hidden>
  • Date: Fri, 20 Nov 2009 13:38:35 -0800

Hi all,

I'm trying to debug some problems with my C++ bundle, and am having trouble debugging. In one of my classes, I have a dozen or so members, and when debugging I want to check their values from time to time. However, two of the members (longs) do not display a value in either the Debugger or the Expressions windows. Their type is reported as "<incomplete type>" in the Debugger window. They report as being "<out of scope>" if I enter them in the Expression window. If I try to "View Value As...", I get an "Internal Exception", on an assertion that some pointer is not null. I can see the values in hex if I choose one of the members before those two in the class and View Memory there, but of course then I have to compute the integer values myself from the byte-reversed hex values (a real pain!).

One thing I'm noticing is that there seems to be a couple of bytes of padding before those two members in the memory browser. The definitions in my class at that location are laid out like this (the names have been obviously changed):


... long a; long b; bool c; bool d; long e; // <---- The variables e and f are the ones in question long f; bool g; bool h; char i[10]; ...


The variables e and f are the ones in question. Apparently, the compiler adds two bytes of padding after the variable d, so that e is on a double-word boundary. That's understandable, but why can't the debugger know this? It finds the variables g, h and i with no problem. So what's up with e and f?


Is there any way to get Xcode's debugger to show me the real values? (BTW, I'm using "Stabs" as the debugging format.)

Thanks,
	-Howard


_______________________________________________ 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
  • Follow-Ups:
    • Re: C++ class members debugging and alignment problems
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: gdb/kernel crash: unable to read unknown load command 0x58
  • Next by Date: PBProj to Xcodeproj
  • Previous by thread: gdb/kernel crash: unable to read unknown load command 0x58
  • Next by thread: Re: C++ class members debugging and alignment problems
  • Index(es):
    • Date
    • Thread