Looks like gdb supports Nim - then so does Seer!

This commit is contained in:
Ernie Pasveer
2024-03-18 20:18:10 -05:00
parent fae603356a
commit 0563718be9
4 changed files with 71 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
hellonim
+10
View File
@@ -0,0 +1,10 @@
.PHONY: all
all: hellonim
hellonim: hellonim.nim
nim c --debugger:native hellonim.nim
.PHONY: clean
clean:
rm -f hellonim
+35
View File
@@ -0,0 +1,35 @@
type
TestObj = object
num: int
val: float
str: string
proc initTestObj(num: int): TestObj =
TestObj(num: num, val: 3.141, str: "TestObj")
proc foo(x: int): int =
let y = x + 2
return y * 10
proc bar(x: int): int =
if x == 3:
return foo(x)
return x * 100
proc main =
var a = 1
a += 3
let str = "foobar"
var seq1 = @[0, 1, 2, 3, 4]
a = bar(1)
a = bar(2)
a = bar(3)
let tobj = initTestObj(11)
main()
# A simple Nim program.
# https://internet-of-tomohiro.netlify.app/nim/gdb.en.html
# https://forum.nim-lang.org/t/11214
+25
View File
@@ -0,0 +1,25 @@
{
"seerproject": {
"executable": "hellonim",
"postgdbcommands": [
""
],
"pregdbcommands": [
"skip -gfile lib/system.nim",
"skip -gfile lib/system/*.nim"
],
"startmode": {
"arguments": "",
"breakinfunction": false,
"breakinfunctionname": "",
"breakinmain": true,
"breakpointsfile": "",
"nobreak": false,
"nonstopmode": false,
"randomizestartaddress": false,
"showassemblytab": false
},
"symbolfile": "",
"workingdirectory": ""
}
}