Mail Archives: djgpp/1999/02/21/09:22:27
In article <36cf4632 DOT 80880437 AT news DOT cso DOT uiuc DOT edu>, Peter Johnson writes:
>Dave Bird wrote:
>>
>> Can I debug MASM (or NASM) output with GDB or similar? I can't use
>> CodeView because it will reset large segment limits back to 64K or
>> TubboDebug because it won't let me allocate loads of memory;
>> apparently if I use masm's LINK /CO then I am producing COFF output.
>> However, GDB says "wrong file format" -- even though according to
>> the FAQ it should run EXE as well as COFF --
>
>The problem is that specifying the /CO option to MASM does produce
>COFF object files,
erm, that's "to LINK" (LINK /CO).
>but they don't contain sections named ".text",
>".data", etc. Also, you won't be able to debug programs unless they
>were linked with ld (the DJGPP/GNU linker). I have been able to get
>MASM-assembled code to link successfully with ld by hexediting the
>section names in the object file. However, in general, I think you'll
>have more success with NASM, as long as you link with ld!
OK, I'll get NASM, as that seems a fairly straightforward solution.
It might be worth a note in the FAQ -- eventually -- though, fair do's,
what I am trying is a bit non-standard and not all that frequent.
>>BEGIN FAQ QUOTE=======================================================[
>>
>>12.4 GDB would not debug unless it sees COFF output
>>
>>Q: I try invoking GDB on my program, but it says: "not in executable
>>format: File format not recognized." Huh?
>>+---------------------------------------------------------------------+
>>A: Most probably, you've invoked GDB from DJGPP v2.0 on a .exe program.
>>Debuggers which come with DJGPP v2.01 can debug COFF and .exe programs
>>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>alike, so upgrading to v2.01 should solve this problem.
INSERT: (though probably not for files produced by MASM and LINK
or even LINK /CO -- you would need to use NASM and LD instead).
>>========================================================]END FAQ QUOTE.
--
^-^-^-@@-^-;-^ http://www.xemu.demon.co.uk/
(..)__u news:alt.smoking.mooses
happy as a clam at high tide -. <_" .-._.-.
- Raw text -