worldofpax.blogg.se

How to install gdb on windows
How to install gdb on windows












how to install gdb on windows how to install gdb on windows

So you need to load tools\nim-gdb.py using source command. On Windows, nim-gdb is a bash script and you cannot use it without bash. And nim-gdb.py is a Python script that make GDB print Nim variables nicely. nim-gdb is a bash script that execute GDB and let GDB load Nim/tools/nim-gdb.py. If you don't use nim-gdb, execute source Nim/tools/nim-gdb.py command after you run gdb. If you cannot find nim-gdb, you can download Nim/bin/nim-gdb and Nim/tools/nim-gdb.py from Nim repository.

how to install gdb on windows

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 = a = bar ( 1 ) a = bar ( 2 ) a = bar ( 3 ) let tobj = initTestObj ( 11 ) main ( )Ĭompile this code with -debugger:native and load it to nim-gdb. nim c -debugger:native test.nim Debug simple program with GDB You need to add -debugger:native option when you compile your program like following example command so that you can debug your program with GDB. Compile your program so that you can debug it with GDB You can also install it alone with scoop install gdb command, but it is older than the GDB included in gcc. If you use package manager Scoop on Windows, GDB is installed when you install gcc with scoop install gcc.

how to install gdb on windows

If GDB is not installed on your PC, install it using your package manager (apt, pacman, emerge, etc). You can check if GDB is installed on your PC with following command. There is official Nim GDB Youtube Video.If you want to learn more about GDB, check GDB User Manual. You can stop your program at specified point and print a value of variable or run it line by line. Compile your program so that you can debug it with GDB.If you found my articles interesting or useful, please donate using following links:














How to install gdb on windows