Odin
Odin copied to clipboard
Add debug info for labels to Odin
This is a PR that adds debug info for labels in the Odin compiler, so now labels attached to statements in general like if, block, for, etc., have debug info.
package labels
import "core:fmt"
main :: proc() {
myloop: for i in 0..<5 {
fmt.println("We have debug labels now!")
}
myswitch: switch true {
case:
fmt.println("Debug labels on switches but not in cases")
}
myif: if true {
fmt.println("Debug labels on if statements")
}
// etc...
}
This is useful because debuggers can discern the location of code given a function and label and do actions to it like putting breakpoints on it. It's less finnicky than line breakpoints when it comes to source code changes.
# This works on gdb and puts a breakpoint on the 'myif' label in the code above
b labels.main:myif