Author Topic: VS 2008 Express and NASM debug info  (Read 10931 times)

Offline Ole Nielsby

  • New Member
  • Posts: 1
VS 2008 Express and NASM debug info
« on: April 01, 2010, 08:47:51 PM »
Using VC2008 Express and the VSrules supplied with the NASM installer, this asm file:

Code: [Select]
extern _ExitProcess@4
extern _MessageBoxW@16
ExitProcess equ _ExitProcess@4
MessageBox equ _MessageBoxW@16
global main

segment CODE use32 CLASS=CODE align=16

main:
push dword 0
push dword M2
push dword M1
push dword 0
call MessageBox
push dword 0
call ExitProcess
M1: dw "H", "e", "l", "l", "o", " ", "w", "o", "r", "l", "d", 0
M2: dw "M", "e", "s", "s", "a", "g", "e", 0

compiles fine but when I press F10 to step through it, I get a message:

Debugging information for 'test.exe' cannot be found or does not match. Symbols loaded (source information stripped). - and then - There is no source code available for the current location.

I can then opt for disassembly and step through the code in the disassembly pane, and the MessageBox appears as expected, but any breakpoints I set in the source are disabled.

The Debug output directory has a 17K .exe file and a 27K .pdb which is supposed to hold the debug info, but this seems of no use to the debugger. I understand the codeview debug info isn't perfect because Microsoft didn't publish the specs, but I'm still supposed to be able to set breakpoints in the source and hit them, right?

Anything special I need to do to tell the debugger where to find the source file? Or do I need to hack the VS rule/project files to get the debug info right?

Does anybody have a working and debugable  VS2008 Express NASM Hello World project?

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: VS 2008 Express and NASM debug info
« Reply #1 on: April 07, 2010, 05:30:42 PM »
Hi Ole,

I don't have an answer to your question... and I guess no one else does, either! I know that the "-g" switch in "-f win32" mode is silently ignored. I know that most Windows-Nasm users seem(?) to like Ollydbg:

http://www.ollydbg.de/

I don't know if there would be any hope of integrating Ollydbg with VS (or if it's what you'd want, if you could).

At one time, I entertained the notion of trying to add "codeview format" debugging information to Nasm. Apparently, "codeview format" is a moving target - there are several versions. I was moving toward Linux at the time, and it wasn't really my cup of tea, but I asked, "Can I get a 'Hoo Rah' on that, at least?" Silence... except for one anonymous benefactor who sent me a .chm of the spec(s), apparently not supposed to be "redistributable"... I got as far as breaking it down into individual .html files... next step would have been plain text... but I dropped the idea.  I doubt if that info is up-to-date. If MS has "settled down" about what the format is, perhaps that issue could be reopened. I'm not much interested in participating, I'm afraid...

Good luck with it, Ole. PITA not to be able to debug your stuff!

Best,
Frank