• 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: Debugging dreams?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging dreams?


  • Subject: Re: Debugging dreams?
  • From: Cem Karan <email@hidden>
  • Date: Thu, 8 Jun 2006 07:32:59 -0400

I'm in the process of trying to track down an error in how my
object graph is being updated, and would like to be able to
visualize the current state of the graph at all times.  The
debugger in XCode allows me to either a) view the current state
of the variables of my structs using the default format or b)
create a custom formatter that only displays text.  I would
rather use GraphViz to display a graphical rendering of what my
object graph is like as I'm stepping thru my code, but this
requires knowledge of the current state of the machine at each
step.  This is EXACTLY what GDB (and therefore XCode) are doing
every single step of the way.  So my question is, how do I query
XCode for all the relevant information?  Am I even able to this?
In my idealized view of the world, XCode would have a CoreData
data store defined that is updated every time I step the
debugger, which would allow me to implement a KVO based plugin
that called GraphViz to present a view of the current state of my
object graph.  I don't see that though... and I'm all ears for
suggestions!  My current process is to use LOTS of printf()
statements to a log file, and then postprocess the file into
something that GraphViz can handle.


Why not link in some sort of socket library and send update
commands via
IPC? You could even have a CoreData application which acts as a
server
and listens to update commands. This would work even when you
are in debug mode.


Regards, Alexander

I think I see what you're saying, and you're right, that would work. The reason I was hoping to write something that plugs into XCode is that my current system requires me to make changes to my code. This is problematic for two reasons:

1) I'm not seeing what my code is doing, I'm seeing what my code +
my update function is doing.  This is problematic because if my
update function has a bug in it, then I need to debug that as
well.  In addition, it may change the state of the machine in a
manner that is different than what would happen if the update code
isn't there (currently, I use macros everywhere, which I define as
nothing when I don't want them)

2) I have to manually go through and instrument my code everywhere
I see a variable update.  If I miss a single location, then what I
see, and what I think I see are two different things.

For these reasons, I'd rather use something provided by XCode.  I
know that the XCode team have a much better understanding of
instrumenting code than I do, and could provide a much cleaner
interface.  Also, if I ran into bugs, I would have a greater level
of trust that it was a real problem, and not a potential problem in
my debug code.  In short, I have reasons for wishing to use XCode
as my data source.

Have you considered using the AppleScript Debugger Action to send the appropriate data to OmniGraffle via an AppleEvent?

No, I hadn't; I'm VERY unfamiliar with AppleScript, so it isn't the first thing that comes to mind. What would I need to do to go this path? I can see that XCode's dictionary has support for breakpoints, but I don't see anything that leaps out and says "this is how you get the variable's/graph's/whatever current value"


On a different note, I've come to realize how useful automatic garbage collection could be for debugging; if you hook the debugger and collector together, and force collection every time you step, then if you attempt to follow a dead pointer, the garbage collector will know if its pointing to anything that is live on the heap. If its pointing to something on the stack, you already have enough info to figure that one out... you could even query the collector for what pointers are currently alive, even the ones that are disconnected from anything.

Thanks,
Cem Karan
_______________________________________________
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: Debugging dreams?
      • From: Jonathon Mah <email@hidden>
  • Prev by Date: Re: Calling PPC framework from Universal app
  • Next by Date: Re: Debugging dreams?
  • Previous by thread: Re: Debugging dreams?
  • Next by thread: Re: Debugging dreams?
  • Index(es):
    • Date
    • Thread