2003-11-12 10:57:58

by Maciej Żenczykowski

[permalink] [raw]
Subject: x86 ptrace support question

Hi,

I'm ptraceing a child process and I'd like to take a peek at memory
pointed to by a seg:offs far pointer. Assuming seg is normal userspace DS
then the ptrace(PEEKDATA,..) works fine. If not then I must most likely
perform conversion to linear address by hand. However for this I need to
get at the code16/32, address16/32, base, limit, etc info of the segment
descriptor for this (given) segment. Obviously this data can be read from
the GDT/LDT. Unfortunately I can't figure out how to get at this without
having to patch the traced program code with support routines for exactly
this purpose and then undoing this and continuing.

Thanks,
MaZe.