Date: Wed, 12 Feb 1997 08:19:21 +0200 (IST) From: Eli Zaretskii To: Gregary J Boyles cc: djgpp AT delorie DOT com Subject: Re: GDB problem. In-Reply-To: <5dpd2p$qev@lion.cs.latrobe.edu.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On 11 Feb 1997, Gregary J Boyles wrote: > I have noticed something alarmibng about GDB. Occassionally, when you step > into a function, the code being executed for the function belongs to some > other unrelated function. Please post the code of the function, the commands you gave to GDB and what GDB printed. The above never happened to me, even when the program was compiled with optimizations. Optimizations can indeed rearrange the code a bit, but they should never mess code from different functions, unless GCC inlines functions (which usually only happens when you compile with -O3). > I assume this has something to do with paging > and the required code not currently being in memory. That is a wrong assumption. If a given page is not in memory when GDB needs to read it, it is brought to memory transparently by the virtual memory mechanism built into the DPMI host. This must happen *before* the page is accessed by GDB, or else it will crash with Page Fault exception.