mirror of
https://github.com/bearlanguageorg/bear.git
synced 2026-08-26 15:17:19 +00:00
Debugger
This commit is contained in:
+3
-1
@@ -16,6 +16,7 @@ pub fn link(paths []string, out string) ! {
|
||||
mut symbols := map[string]int{}
|
||||
mut relocs := []obj.Reloc{}
|
||||
mut lines := []obj.LineInfo{}
|
||||
mut locals := []obj.DbgLocal{}
|
||||
for p in paths {
|
||||
o := obj.read(p)!
|
||||
base := code.len
|
||||
@@ -32,6 +33,7 @@ pub fn link(paths []string, out string) ! {
|
||||
for l in o.lines {
|
||||
lines << obj.LineInfo{ off: l.off + u32(base), line: l.line }
|
||||
}
|
||||
locals << o.locals
|
||||
}
|
||||
// resolve relocations
|
||||
for r in relocs {
|
||||
@@ -51,7 +53,7 @@ pub fn link(paths []string, out string) ! {
|
||||
for name, entry in symbols {
|
||||
fns << obj.BinFn{ name: name, entry: entry }
|
||||
}
|
||||
obj.write_bin(out, obj.Bin{ fns: fns, strings: strings, code: code, lines: lines })!
|
||||
obj.write_bin(out, obj.Bin{ fns: fns, strings: strings, code: code, lines: lines, locals: locals })!
|
||||
}
|
||||
|
||||
fn intern_str(mut table []string, s string) int {
|
||||
|
||||
Reference in New Issue
Block a user