Mail Archives: djgpp-workers/1996/10/28/11:11:07
On Mon, 28 Oct 1996, Robert Hoehne wrote:
> As far as I understood the code in dbgcom.c NO. The v2loadimage()
> creates a new PSP for the image and puts it in the stubinfo or
Charles already confirmed what I suspected: that's a fake PSP which is
only good enough if neither the debuggee nor the debugger do anything
that changes the contents of the PSP. In particular, if any one of them
crosses the 20 open files threshold, which causes DOS to allocate a
larger table for the handles, the fake PSP will still hold a pointer to
an old table. (Hmm... this means that after that, `fstat' in the
debuggee won't work... seems like a subtle bug to me.)
> But I'm not so familiar with this low level DOS programming. I have
> looked also in the code of stat() and fstat() where are some code
> with the filehandle table, but I didn't understand it yet in
> all details.
Since I wrote that code, I hope I can explain everything there 8-). Just
ask what you want to know. I still don't understand how would you know
which handle belongs to the debugger and which to the debuggee, though.
In fact, I don't even see how can the debugger access the handles used by
the debuggee. They use different instances of the data structures inside
file-oriented libc functions (since each has its own copy of the libc
functions), and so a file handle that was open by the debuggee might be
invalid for the debugger, and vice versa.
Maybe if I understood better the problem that you are trying to solve, I
could think about a way to overcome these difficulties.
- Raw text -