www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/12/01:27:50

Date: Wed, 12 Feb 1997 08:19:21 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Gregary J Boyles <boylesgj AT lion DOT cs DOT latrobe DOT edu DOT au>
cc: djgpp AT delorie DOT com
Subject: Re: GDB problem.
In-Reply-To: <5dpd2p$qev@lion.cs.latrobe.edu.au>
Message-ID: <Pine.SUN.3.91.970212081359.6507C-100000@is>
MIME-Version: 1.0

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019