mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 08:34:42 +08:00
Looks like gdb supports Nim - then so does Seer!
This commit is contained in:
@@ -0,0 +1 @@
|
||||
hellonim
|
||||
@@ -0,0 +1,10 @@
|
||||
.PHONY: all
|
||||
all: hellonim
|
||||
|
||||
hellonim: hellonim.nim
|
||||
nim c --debugger:native hellonim.nim
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f hellonim
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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": ""
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user