Mail Archives: djgpp-workers/2001/04/27/05:25:17
> Date: Thu, 26 Apr 2001 18:49:02 +0200 (MET DST)
> From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
>
> > You could always cast the references with the appropriate type, of
> > course.
>
> I tried that, but for some reason I couldn't quite make out, it didn't
> seem to work.
Something like this should do, put it into gdb.ini:
define memory_handle
echo {\
output/x *(long *)((char *)&__djgpp_memory_handle_list + 8*$arg0)
echo ,
output/x *(unsigned *)((char *)&__djgpp_memory_handle_list + 8*$arg0 + 4)
echo }\n
end
document memory_handle
Usage: memory_handle N
Print the contents of the memory handle structure whose index
in the __djgpp_memory_handle_list[] array is given as an argument.
end
Note that the first handle is for the stub, and all the others list
the addresses relative to the DS base address. In a program that uses
Unixy sbrk algorithm, you will probably see only 1 handle; unused ones
are zeroed.
Btw, the `handle' member of the structure seems to have its MSB set,
at least on Windows (that's why I used "output/x"). So its
declaration in crt0.h should probably changed to unsigned instead of
long. Charles, am I right?
- Raw text -