#can't set breakpoints in specific function using cppvsdbg on windows

1 messages · Page 1 of 1 (latest)

lethal charm
#

i'm trying to debug bun on windows, using a vscode launch configuration as follows:

    {
      "type": "cppvsdbg",
      "sourceFileMap": {
        "D:\\a\\WebKit\\WebKit\\Source": "${workspaceFolder}\\src\\bun.js\\WebKit\\Source",
      },
      "request": "launch",
      "name": "Windows: bun test [file]",
      "program": "${workspaceFolder}/build/debug/bun-debug.exe",
      "args": ["test", "${file}"],
      "cwd": "${workspaceFolder}",
      "environment": [
        {
          "name": "BUN_DEBUG_QUIET_LOGS",
          "value": "1",
        },
        {
          "name": "BUN_DEBUG_jest",
          "value": "1",
        },
        {
          "name": "BUN_GARBAGE_COLLECTOR_LEVEL",
          "value": "1",
        },
      ],
    },

for some reason, i can't set breakpoints in the one function that i would like to breakpoint:

Breakpoint warning: No executable code of the debugger’s target code type is associated with this line.
Possible causes include: conditional compilation, compiler optimizations, or the target architecture of this line is not supported by the current debugger code type. - c:\bun-ben\src\bun.js\api\ffi.zig:1010
Breakpoint warning: No executable code of the debugger’s target code type is associated with this line.
Possible causes include: conditional compilation, compiler optimizations, or the target architecture of this line is not supported by the current debugger code type. - c:\bun-ben\src\bun.js\api\ffi.zig:1011
Breakpoint warning: No executable code of the debugger’s target code type is associated with this line.
Possible causes include: conditional compilation, compiler optimizations, or the target architecture of this line is not supported by the current debugger code type. - c:\bun-ben\src\bun.js\api\ffi.zig:1012
(also see attached screenshot of the breakpoints showing as disabled in the editor while the debugger is open)
i'm going to send a second message with more info due to discord character limit...

#

...you might think this is due to conditional compilation or something. however, when i add a @breakpoint() to the top of the function, the breakpoint is hit and the debugger knows which file it is in:

#

so clearly some part of the debug info is working enough to find this location

#

however, @breakpoint() isn't actually a viable solution here because i can't step line-by-line after hitting the breakpoint, as the debugger doesn't know where to stop at

#

hmm the function is invoked with @call(.always_inline)

#

lol yeah changing to never_inline fixed breakpoints

silk jay
#

an inlined function isn't really a function anymore

lethal charm
#

well i've had great luck with stepping and breakpoints in inlined functions in lldb

#

this is probably part zig issue part ms issue, i would be surprised if the visual studio can't breakpoint inline c++ functions given how common those are

worn crescent
#

well zig inlines functions semantically not as an optimization, afaik all llvm ever sees is a block basically

lethal charm
#

it works in lldb 🤷

lethal charm
worn crescent
#

not saying it does but its not the same as c++ so comparing it doesnt make much sense

#

id open an issue if you can find out anything more