From: Fritz W. <fr...@sp...> - 2011-05-16 20:07:21
|
You wrote: > 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 I'll have a look, thanks. > > You don't say what debugger front end you tried, but ASSuming it's for > gdb... Sorry about that! New as I am to Linux development I ASSumed there was only 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". I've been using stabs but as you and the previous poster said dwarf, I'll start using that instead. > > 3) Don't give ld the "-s" switch, of course, or it'll strip the debug > info back out. :) Right :-) > > 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! Good to know. > > If none of that helps, tell us more about exactly what you're doing, and > what's happening. Thank you. |