Bug in i386_process_record?

Eli Zaretskii eliz@gnu.org
Mon Aug 24 19:20:00 GMT 2009


> From: Hui Zhu <teawater@gmail.com>
> Date: Mon, 24 Aug 2009 08:00:29 +0800
> Cc: gdb-patches@sourceware.org
> 
> #rep stos %eax,%es:(%edi)
> $edi + 0 = 0x8049660 blob1
> $edi + $es != 0x8049660 blob1

Well, of course! %es:(%edi) does _not_ mean $es+$edi, it means that
$edi is used to address the section whose segment descriptor's index
(a.k.a. selector) is in $es.  That is, in your case, 0x7b is the
selector that identifies the segment descriptor of the section where
blob1[] is stored (.bss, if my rusty memory doesn't deceive me).

Am I missing something?  If not, what was this example supposed to
prove, exactly?



More information about the Gdb-patches mailing list