Adding instructions for setting breakpoints in Xcode in jai files
This commit is contained in:
parent
427953c5f8
commit
bfc294f46e
|
@ -1,6 +1,5 @@
|
||||||
# Debugging on OSX
|
# Debugging on OSX
|
||||||
|
|
||||||
**TODO: Figure out how to set breakpoints in Xcode**
|
|
||||||
**TODO: Figure out why Xcode detaches from the process after you take a Metal snapshot, leavin the window there forever**
|
**TODO: Figure out why Xcode detaches from the process after you take a Metal snapshot, leavin the window there forever**
|
||||||
|
|
||||||
## Basics
|
## Basics
|
||||||
|
@ -10,26 +9,21 @@
|
||||||
3. Set the Build Tool for the target to either:
|
3. Set the Build Tool for the target to either:
|
||||||
- `/usr/bin/true` - this is essentially a no-op if you want to be building elsewhere
|
- `/usr/bin/true` - this is essentially a no-op if you want to be building elsewhere
|
||||||
- `../bin/build.sh` (or similar) - the path to your build script. IMPORTANT: it seems Xcode doesn't resolve absolute paths, just paths relative to the project location.
|
- `../bin/build.sh` (or similar) - the path to your build script. IMPORTANT: it seems Xcode doesn't resolve absolute paths, just paths relative to the project location.
|
||||||
4. With the project open go to `Product > Scheme > Edit Scheme > Run > Info > Executable` and select the executable you want to run.
|
4. With the project open go to `Product > Scheme > Edit Scheme > Run > Info > Executable` and select the executable you want to run.
|
||||||
5. Cmd+R to Run.
|
5. Cmd+R to Run.
|
||||||
|
|
||||||
Debugging this way, you can have Xcode run an executable in a .app or just from any directory. There do seem to be differences in the ways some graphics systems are initialized - I get different window scaling in each case.
|
Debugging this way, you can have Xcode run an executable in a .app or just from any directory. There do seem to be differences in the ways some graphics systems are initialized - I get different window scaling in each case.
|
||||||
|
|
||||||
### Breakpoints
|
### Breakpoints
|
||||||
_I can't get these to be set via the Xcode Debugger at the moment. I'm not sure why. As an alternative, you can set them via the lldb command line interface in Xcode, and then navigate the stack with the UI just fine._
|
|
||||||
|
|
||||||
**To set on a particular file/line**
|
To get breakpoints to work, you have to tell Xcode to treat your .jai files as source code.
|
||||||
|
|
||||||
`b --file <file_name> --line <line_number>`
|
1. Right click your file.
|
||||||
|
2. Select show file inspector.
|
||||||
|
3. In the Inspector, change Type from "Default - Plain Text" to "C Source"
|
||||||
|
|
||||||
**To set at the entry to a particular function**
|
You should now be able to set breakpoints in that file.
|
||||||
|
As far as I can tell, there isn't a convenient way to set all .jai files to be loaded as C Source files so you have to do this individually.
|
||||||
`b <function_name>`
|
|
||||||
_Note: this doesn't work if function_name is "main" - it adds a baker's dozen of breakpoints at different places_
|
|
||||||
|
|
||||||
**To remove all breakpoints**
|
|
||||||
|
|
||||||
`breakpoint delete`
|
|
||||||
|
|
||||||
## Graphics
|
## Graphics
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue