jckarter/clay — Issue #105: Bogus debug location info
Author: jckarter
Created: 2011-12-31 03:25:35+00:00
State: open
Labels: debug-info, v0.1

With the following test program:

```
record Foo (i:Int, j:Int);

incr(a, n) {
a += n;
}

main() {
var x = Foo(0,0);

println(x);
incr(x.i, 1);
println(x);
incr(x.j, 1);
println(x);
incr(x.i, 1);
println(x);
incr(x.j, 1);
println(x);
}
```

I got the following while poking around with gdb:

```

% gdb bar
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug 8 20:32:45 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .. done

(gdb) run
Starting program: /Users/joe/Documents/Code/others/clay/bar
Reading symbols for shared libraries +........................ done
Foo(0, 0)
Foo(1, 0)
Foo(1, 1)
Foo(2, 1)
Foo(2, 2)

Program exited normally.
(gdb) break bar.clay:7
Breakpoint 1 at 0x100001b0f: file bar.clay, line 7.
(gdb) run
Starting program: /Users/joe/Documents/Code/others/clay/bar

Breakpoint 1, clay main() () at bar.clay:68
Line number 68 out of range; bar.clay has 19 lines.
```