Breakpoint placement in *.s assembly file issues

Sysprogs forums Forums VisualGDB Breakpoint placement in *.s assembly file issues

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #32507
    iklask
    Participant

    I have been trying to debug my cstartup.s and have noticed the breakpoints don’t always get placed correctly on instructions/lines I select while I’m in a *.s assembly file. I’ve also noticed that the syntax highlighting of the files get very confused.

    I’ve been compiling these assembly files with the c preprocessor so there are some macro defines as well, but the macros always show up colored as comments. My guess currently is that VS doesn’t exactly understand these assembly files when it comes to intellisense/syntax? And because of the confusion VS has a hard time letting me place breakpoints down on valid lines?

    I do not have any optimizations on so its not like these instructions are getting optimized out (and I can step to them fine). I’m not sure if this is a general issue with GDB debugging, VS, or the VGDB extension.

    #32508
    support
    Keymaster

    Hi,

    Indeed, neither Visual Studio nor VisualGDB supports syntax highlighting in the assembly files. That said, it does not affect debugging. When you set a breakpoint in a source file, VisualGDB simply issues a -break-insert command directly to the gdb debugger, that in turn interprets the debug symbols and translates it to a physical breakpoint at a specific address. The process of translating source file locations to memory addresses is entirely done by gdb and is not affected by any IDE features. You can double-check the commands issued by VisualGDB to gdb via the GDB Session window.

    If the breakpoints are not working, the assembly files could have been built without debug symbols, or some macros inside them might be interfering with the way gdb handles breakpoints.

    You can also try using the Disassembly view in Visual Studio. It takes the assembly dump directly from gdb and knows the exact address of every line displayed there. Hence, breakpoints set via the Disassembly view will work regardless of the symbol issues.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.