Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[endb] nim --debugger:endb: eval 1+2 doesn't do anything #8454

Closed
2 tasks
timotheecour opened this issue Jul 26, 2018 · 3 comments
Closed
2 tasks

[endb] nim --debugger:endb: eval 1+2 doesn't do anything #8454

timotheecour opened this issue Jul 26, 2018 · 3 comments
Labels

Comments

@timotheecour
Copy link
Member

timotheecour commented Jul 26, 2018

  • neither these work in endb:
    eval 1+2
    o /tmp/z01.txt 1+2
nim c --nimcache:/tmp/nim//nimcache/ -o:/tmp/nim//app -r --debugger:endb -d:case1 tests/nim/inim/t03_debugger.nim
Hint: operation successful (13045 lines compiled; 0.194 sec total; 20.199MiB peakmem; Debug Build) [SuccessX]
*** endb| t03_debugger.nim(1) t03_debugger ***
*** endb| >>r
@[1, 2, 3]
t03_debugger.nim(11)     t03_debugger
t03_debugger.nim(8)      fun
lib/system.nim(2807)     sysFatal
Error: unhandled exception: index out of bounds [IndexError]
*** endb| lib/system.nim(2807) sysFatal ***
*** endb| >>eval 1+2
*** endb| >>o /tmp/z01.txt 1+2

probably doesn't matter but here's my test file:
tests/nim/inim/t03_debugger.nim:

var g0 = 1234

proc fun()=
  var a = 10
  var b = @[1, 2, 3]
  echo b
  when defined(case1):
    echo b[3]
  echo "end_fun"

fun()
echo "end"
  • --debugger:gdb doesn't seem to work
    also tried --debugger:gdb but that's even worse:
    nim c --nimcache:/tmp/nim//nimcache/ -o:/tmp/nim//app -r --debugger:gdb -d:case1 tests/nim/inim/t03_debugger.nim
    CC: timn_t03_debugger
    CC: stdlib_system
    Hint: operation successful (12180 lines compiled; 0.785 sec total; 16.254MiB peakmem; Debug Build) [SuccessX]
    @[1, 2, 3]
    /Users/timothee/git_clone/nim/timn/tests/nim/inim/t03_debugger.nim(11) t03_debugger
    /Users/timothee/git_clone/nim/timn/tests/nim/inim/t03_debugger.nim(8) fun
    /Users/timothee/git_clone/nim/Nim/lib/system.nim(2807) sysFatal
    Error: unhandled exception: index out of bounds [IndexError]
    Error: execution of an external program failed: '/tmp/nim//app '
@Araq
Copy link
Member

Araq commented Jul 30, 2018

We could map sysFatal to something GDB understands.

@Araq Araq added the Tools label Jul 30, 2018
@timotheecour
Copy link
Member Author

timotheecour commented Jul 30, 2018

@Araq I don't think sysFatal is related; if I put a breakpoint before the line that causes sysFatal (echo b[3]), and press r, eval 1+2 still doesn't do anything

@timotheecour
Copy link
Member Author

closing since ENDB will die in favor of gdb/lldb => see #8596 for lldb issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants