Date: Wed, 24 Feb 1999 11:09:14 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Dave Bird cc: djgpp AT delorie DOT com Subject: Re: I just wanted to assemble this old program under NASM.... In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Wed, 24 Feb 1999, Dave Bird wrote: > >DJGPP programs *start* in 32-bit mode. You can't switch to/from real > >mode the way you're thinking in a djgpp program. > You mean "no program which does so can be defined in assembler, > assembled and linked, then fed to GDB......" :-? Probably not, at least not in the DJGPP port of GDB. Here's some background on how debugger support works in DJGPP. Since there's no way to run two programs (the debugger and the debuggee) concurrently, and no DOS function to load a protected-mode COFF executable, DJGPP debuggers cannot use OS services to load the debuggee and attach the debugger to it, the way e.g. the DOS DEBUG command of yore does. Instead, there's a bunch of functions in libdbg.a library, against which all DJGPP debuggers are linked, which allows any DJGPP program to do the following magic: - load another DJGPP program, in the same way the stub loader does; - hook several DOS and DPMI services so that e.g. when the debuggee hits a breakpoint and generates SIGTRAP, the control jumps to the debugger; - resume the debuggee after the control was passed to the debugger for some reason (like a breakpoint or a signal); - set and unset breakpoints. The debugging library was written specifically for DJGPP, with nothing else in mind but debugging DJGPP-style COFF images that run in a DPMI environment. From this description, it should become clear that the DJGPP debuggers are probably not good for debugging anything but DJGPP programs, or programs that at least look and behave like DJGPP ones.