From: Frank K. <fbk...@zy...> - 2011-05-16 14:41:18
|
Fritz Wuehler wrote: > Hi guys, I am trying to learn x86 assembly with NASM since it uses the less > hideous Intel syntax! However the debugger front end I tried doesn't seem to > recognize this format and I can't set breakpoints. Whoever is using NASM on > Linux can you explain your environment a bit, what tools should I be using > etc. for best results. Thanks guys. There was recently some discussion of debuggers for Linux on the Nasm Forum: http://forum.nasm.us/index.php?topic=1056.0 You don't say what debugger front end you tried, but ASSuming it's for gdb... 1)It seems to help to start with a "nop" right after the "_start:" label. If you're starting with "main", so that the "_start:" label is elsewhere, this may not help. 2)Give Nasm "-F dwarf" on the command line. The default is "stabs" if you just use the "-g" switch. I honestly don't see any difference, but "dwarf" is the "native" format, and is supposed to be "better". 3) Don't give ld the "-s" switch, of course, or it'll strip the debug info back out. :) 4) Nasm's "local label" syntax doesn't play nicely with gdb. You can use local labels, but don't expect to tell gdb about 'em - it thinks you're trying to reference a member of a structure! If none of that helps, tell us more about exactly what you're doing, and what's happening. Best, Frank |