• 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
Re: Struct introspection or information
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Struct introspection or information


  • Subject: Re: Struct introspection or information
  • From: Steve Christensen <email@hidden>
  • Date: Mon, 5 Nov 2007 14:14:00 -0800

On Nov 5, 2007, at 12:33 PM, Monitus wrote:

Good day everyone - sorry if this is not totally Cocoa-related: if there's a better list for this, please let me know and accept my apologies in advance...

Is there any way to know the fields in a C structure, if you don't have the headers that define it?

No. The compiler uses a struct declaration to determine the type, size and offsets of each of its fields, as well as for determining the overall size of the struct itself. Once the C source is converted into assembly language instructions the field information is no longer needed.


Or at the very least, is it possible to access it's field values?

If you're thinking it terms of a source debugger, no, since no symbolic information remains. You can certainly dump memory starting at the base address of the structure and try to figure out where the various fields are and what they might contain.


steve

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Struct introspection or information (From: Monitus <email@hidden>)

  • Prev by Date: DTrace Scripts Site
  • Next by Date: Can 10.4 apps be built with Obj-C 2.0?
  • Previous by thread: Re: Struct introspection or information
  • Next by thread: Re: Struct introspection or information
  • Index(es):
    • Date
    • Thread