Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

K/N debugger on Windows #2326

Closed
msink opened this issue Nov 14, 2018 · 3 comments
Closed

K/N debugger on Windows #2326

msink opened this issue Nov 14, 2018 · 3 comments

Comments

@msink
Copy link
Contributor

msink commented Nov 14, 2018

Now Kotlin/Natve works in CLion EAP on Windows, so - what should be used as debugger?

  • gdb from msys2-mingw works only for breakpoints and primitive types inspections,
  • llvm from msys2-mingw does not work:
C:\msys64\mingw64\bin\lldb.exe: unknown option -- interpreter=mi2
error: unknown or ambiguous option

Process finished with exit code 0

and anyway it is useless:

(lldb) script
error: your copy of LLDB does not support scripting.
@olonho
Copy link
Contributor

olonho commented Nov 15, 2018

Currently, debugging story on Windows is not yet ready, but we plan to support that eventually.

@msink
Copy link
Contributor Author

msink commented Jul 17, 2019

Well, now lldb-1-windows is available on current master, so I can try debugging.
Lets try as steps from DEBUGGING.md:

msink@Sinkovsky MINGW64 /f/src/kotlin-native
$ /f/work/.konan/dependencies/lldb-1-windows/bin/lldb main.exe
(lldb) target create "main.exe"
Current executable set to 'main.exe' (x86_64).
b main.kt:5
(lldb) b main.kt:5
Breakpoint 1: where = main.exe`kfun:main() + 269 at main.kt:5:13, address = 0x000000000042be8d
r
(lldb) r
Process 10928 launched: 'F:\src\kotlin-native\main.exe' (x86_64)
Process 10928 stopped
* thread #1, stop reason = breakpoint 1.1
    frame #0: 0x000000000042be8d main.exe`kfun:main() at main.kt:5:13
   2        var x = 1
   3        var y = 2
   4        var p = Point(x, y)
-> 5        println("p = $p")
                    ^
   6    }
   7    data class Point(val x: Int, val y: Int)
(lldb) fr var
(lldb) fr var
(int) x = 1
(int) y = 2
(ObjHeader *) p = 0x0000000000395978
command script import dist/tools/konan_lldb.py
(lldb) command script import dist/tools/konan_lldb.py
fr var
(lldb) fr var
(int) x = 1
(int) y = 2
(ObjHeader *) p = {}
p p
(lldb) p p
(ObjHeader *) $4 = {}

Something wrong here, should be:

(ObjHeader *) p = Point(x=1, y=2)

@vvlevchenko
Copy link
Contributor

According to migrating issue tracking to YouTrack, closing this issue in favour of KT-45987 basic lldb scenario doesn't work on Windows

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

No branches or pull requests

3 participants