From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14983 invoked by alias); 3 Jul 2007 21:38:48 -0000 Received: (qmail 14975 invoked by uid 22791); 3 Jul 2007 21:38:47 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 03 Jul 2007 21:38:45 +0000 Received: (qmail 22630 invoked from network); 3 Jul 2007 21:38:43 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 Jul 2007 21:38:43 -0000 To: "Mohammed, Moqtadir" Cc: Subject: Re: Can this be happening? References: From: Jim Blandy Date: Tue, 03 Jul 2007 21:38:00 -0000 In-Reply-To: (Moqtadir Mohammed's message of "Fri, 29 Jun 2007 18:03:26 -0500") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-07/txt/msg00032.txt.bz2 "Mohammed, Moqtadir" writes: > I was trying to look at a core dump of a program, and gdb displays the following result for > #info registers > > eax 0xa0 160 > ecx 0x2 2 > edx 0xa 10 > ebx 0xa7e3de9c -1478238564 > esp 0xa6babddc 0xa6babddc > ebp 0xa6babe00 0xa6babe00 > esi 0xa7ef9d9a -1477468774 > edi 0x838f44c 137950284 > eip 0xa7d85cec 0xa7d85cec > eflags 0x50203 [ CF IF RF AC ] > cs 0x73 115 > ss 0x7b 123 > ds 0x7b 123 > es 0xb010007b -1341128581 > fs 0x0 0 > gs 0x33 51 > > Platform: IA32. (elf) > > My question is, how is the register 'es' being reported as a 32 bit value. > I may be completely naive asking this question, but I have been trying to google for anything > related to it, but haven't found an answer. Is 'es' not supposed to be only 16bit. Well, actually, GDB thinks they're all 32 bits long: static struct type * i386_register_type (struct gdbarch *gdbarch, int regnum) { if (regnum == I386_EIP_REGNUM) return builtin_type_void_func_ptr; if (regnum == I386_EFLAGS_REGNUM) return i386_eflags_type; if (regnum == I386_EBP_REGNUM || regnum == I386_ESP_REGNUM) return builtin_type_void_data_ptr; if (i386_fp_regnum_p (regnum)) return builtin_type_i387_ext; if (i386_mmx_regnum_p (gdbarch, regnum)) return i386_mmx_type (gdbarch); if (i386_sse_regnum_p (gdbarch, regnum)) return i386_sse_type (gdbarch); #define I387_ST0_REGNUM I386_ST0_REGNUM #define I387_NUM_XMM_REGS (gdbarch_tdep (current_gdbarch)->num_xmm_regs) if (regnum == I387_MXCSR_REGNUM) return i386_mxcsr_type; #undef I387_ST0_REGNUM #undef I387_NUM_XMM_REGS return builtin_type_int; } You can always check in GDB: (gdb) p sizeof ($cs) $1 = 4 (gdb) ptype $cs type = int (gdb) I don't know why the upper bits would be set. GDB may be misinterpreting the information in the core file.