From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22406 invoked by alias); 22 Mar 2010 15:05:02 -0000 Received: (qmail 22281 invoked by uid 22791); 22 Mar 2010 15:05:01 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Mar 2010 15:04:56 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id o2MF3W0K009706; Mon, 22 Mar 2010 16:03:32 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id o2MF3Vmj017896; Mon, 22 Mar 2010 16:03:31 +0100 (CET) Date: Mon, 22 Mar 2010 15:05:00 -0000 Message-Id: <201003221503.o2MF3Vmj017896@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: hjl.tools@gmail.com CC: teawater@gmail.com, msnyder@vmware.com, dan@codesourcery.com, gdb-patches@sourceware.org In-reply-to: <6dc9ffc81003220735k54fbef51o4f5c9ebec06fffa7@mail.gmail.com> (hjl.tools@gmail.com) Subject: Re: [RFA 3/5] Prec: x86 segment register support: target References: <4B9FCA21.9020904@vmware.com> <20100316200424.GA29097@caradoc.them.org> <6dc9ffc81003220735k54fbef51o4f5c9ebec06fffa7@mail.gmail.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00758.txt.bz2 > Date: Mon, 22 Mar 2010 07:35:00 -0700 > From: "H.J. Lu" > > On Mon, Mar 22, 2010 at 7:02 AM, Hui Zhu wrote: > > Thanks Michael and Daniel. > > > > I make a patch to add base of segments registers to x86-32: > > (gdb) info reg > > eax            0xffffd514       -10988 > > ecx            0x1eda96c5       517641925 > > edx            0x1      1 > > ebx            0xf7fb1ff4       -134537228 > > esp            0xffffd488       0xffffd488 > > ebp            0xffffd488       0xffffd488 > > esi            0x8048510        134513936 > > edi            0x80483d0        134513616 > > eip            0x8048487        0x8048487 > > eflags         0x246    [ PF ZF IF ] > > cs             0x23     35 > > ss             0x2b     43 > > ds             0x2b     43 > > es             0x2b     43 > > fs             0x0      0 > > gs             0x63     99 > > cs_base        0x0      0 > > ss_base        0x0      0 > > ds_base        0x0      0 > > es_base        0x0      0 > > fs_base        0x0      0 > > gs_base        0xf7e528d0       -135976752 > > > > I try it in x86-32 pc and 32bit code in x86-64.  It works OK. > > > > Please help me review it. > > > > Best regards, > > Hui > > > > 2010-03-22  Hui Zhu   > > > >        * features/i386/32bit-linux.xml (org.gnu.gdb.i386.linux): Add > >        cs_base, ss_base, ds_base, es_base, fs_base and gs_base. > >        * i386-tdep.h (i386_segment_base_regnum): New enum. > >        * amd64-linux-nat.c (GDT_ENTRY_TLS_MIN, > >        GDT_ENTRY_TLS_MAX): New marco. > >        (ps_get_thread_area): New extern. > >        (amd64_linux_fetch_inferior_registers): Add > >        code to get 32 bits segment registers base. > >        * i386-linux-nat.c (GDT_ENTRY_TLS_ENTRIES, > >        GDT_ENTRY_TLS_MIN, > >        GDT_ENTRY_TLS_MAX): New marco. > >        (ps_get_thread_area): New extern. > >        (i386_linux_fetch_inferior_registers): Add > >        code to get segment registers base. > > Are we going to support them on other OSes? If not, > the contents of i386_segment_base_regnum should be > moved to i386-linux-tdep.h and those values should > be after > > /* Register number for the "orig_eax" pseudo-register. If this > pseudo-register contains a value >= 0 it is interpreted as the > system call number that the kernel is supposed to restart. */ > #define I386_LINUX_ORIG_EAX_REGNUM I386_SSE_NUM_REGS > > In any cases, they shouldn't be hard-coded to any values. > Otherwise, it won't work with AVX, which will add more registers. In any case; this stuff will have to wait until we're done withe the AVX stuff, which I'll be looking at again tonight.