• 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:45:04 -0400

Don't forget that you may run (with the gdb prompt of Xcode's
debugger) any function you want, like the classical "print-object
my_objc_var" or "p (void)CFSHow(my_corefoundation_var)". Here,
this will be a :
	p (void)DumpMyGraph("/tmp/dump.dot", my_graph_root)

You just need to write the function DumpMyGraph, and check that
it is not optimized away.

I hadn't thought about that! I'll have to spend some time playing with it... Thank you!

You can even do this in a Debugger Action in the IDE without going to the gdb command line. In fact, you can run a gdb script, a shell script, or an AppleScript, with various substitutions available at each breakpoint.

http://developer.apple.com/documentation/DeveloperTools/Conceptual/
XcodeUserGuide/Contents/Resources/en.lproj/
06_03_db_controlling_execution/chapter_41_section_2.html

Yes, but one sometime needs to view the content of several complex variables (like graphs), just before/after stepping, in order to see their evolution. In this case there's no associated breakpoint.

Breakpoints actions are useful to make traces (when "continue" is
checked) and automatically dump information when hitting breakpoints
instead of dumping each time this information manually. It's a bit
like dynamically inserting a printf("something") call (or more
complex code) in the original source.

In fact, it depends on what exactly needs Cem Karan.

Seeing the complete graph just before/after stepping is the ideal; I can make do with the printf() like workaround because I wrote a script that postprocesses the output into a series of graphs that I can look at to deduce what is going on. The downside to my script is that it doesn't handle temporary variables too well (E.g., you have a tree of nodes, and you create a temporary node pointer to walk the tree; my code currently doesn't work well in cleaning out the temporary node. I DON'T just walk the tree, because I want to make sure that these temporary nodes are being updated correctly as well)


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


  • Prev by Date: Re: Debugging dreams?
  • Next by Date: template error and Jam failed with exit code 1
  • Previous by thread: Re: Debugging dreams?
  • Next by thread: (no subject)
  • Index(es):
    • Date
    • Thread