gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

ASM > Deubbing macro code...

#25855 - poslundc - Sun Aug 29, 2004 8:37 pm

I'm trying to debug a large piece of assembly code (3000 lines) that uses lots and lots of macros (using the GAS tags .macro and .endm).

Problem is that when GAS reports its errors, it gives me a line number with the macros expanded into the actual code, so I can't track down what line the error is occurring on.

Does anyone know of a way to get GAS to preprocess the code without actually attempting to assemble it, so I can find out what lines these errors are actually on? I couldn't find anything in the GAS man pages.

Thanks,

Dan.

#25856 - poslundc - Sun Aug 29, 2004 8:56 pm

And before it's suggested, I can't seem to run GASP on its own from the CLI... I get an error message when I try ("./gasp undefined reference to _errors expected to be defined in /usr/lib/libSystem.B.dylib; Trace/BPT trap").

Dan.

#25857 - poslundc - Sun Aug 29, 2004 9:09 pm

OK, I solved the problem by saving a copy of the file, then doing a global find/replace to comment out all of the .macro and .endm directives, then another find/replace to comment out all of the macro-calls (fortunately they are all prefixed with the same string).

Then I was able to run the assembler on my commented code, and look up the line numbers it found errors on in the real code.

So, problem solved!

Dan.