From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16604 invoked by alias); 15 Jun 2007 12:55:57 -0000 Received: (qmail 16593 invoked by uid 22791); 15 Jun 2007 12:55:56 -0000 X-Spam-Check-By: sourceware.org Received: from wa-out-1112.google.com (HELO wa-out-1112.google.com) (209.85.146.176) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 15 Jun 2007 12:55:54 +0000 Received: by wa-out-1112.google.com with SMTP id l35so1153209waf for ; Fri, 15 Jun 2007 05:55:53 -0700 (PDT) Received: by 10.114.156.1 with SMTP id d1mr2990635wae.1181912153058; Fri, 15 Jun 2007 05:55:53 -0700 (PDT) Received: by 10.114.166.13 with HTTP; Fri, 15 Jun 2007 05:55:53 -0700 (PDT) Message-ID: <656b5870706150555k47cf81c6w393d14502018b80b@mail.gmail.com> Date: Fri, 15 Jun 2007 12:55:00 -0000 From: Indira To: "Dave Korn" Subject: Re: Setting registers Cc: gdb@sourceware.org In-Reply-To: <018d01c7adc0$f10ff770$2e08a8c0@CAM.ARTIMI.COM> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <656b5870706130328v7121cdcdt18c4b59baebc0865@mail.gmail.com> <018d01c7adc0$f10ff770$2e08a8c0@CAM.ARTIMI.COM> 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-06/txt/msg00122.txt.bz2 Yes I am debuggin a core file. We cant set registers while debuggin a core file? On 6/13/07, Dave Korn wrote: > On 13 June 2007 11:28, Indira wrote: > > > Hi, > > > > I was writing a macro in which i was trying to the variable ebp and eip as, > > > > set variable $ebp = *(int *)($sp+8) > > set variable $eip = *(int *)($sp+36) > > > > but, even though by doing this th eregister values dont get updated. > > Why is this so? Can anyone help me on this? > > Dunno, works fine for me: > > Breakpoint 1, main () at time.c:13 > 13 { double t0 = get_time(), t1 = get_time(); > (gdb) info regis > eax 0x10 16 > ecx 0x401080 4198528 > edx 0x4c 76 > ebx 0x0 0 > esp 0x23cc80 0x23cc80 > ebp 0x23ccb8 0x23ccb8 > esi 0x611001a0 1628438944 > edi 0x401430 4199472 > eip 0x40108b 0x40108b > eflags 0x202 [ IF ] > cs 0x1b 27 > ss 0x23 35 > ds 0x23 35 > es 0x23 35 > fs 0x3b 59 > gs 0x0 0 > (gdb) set variable $ebp = *(int *)($sp+8) > (gdb) set variable $eip = *(int *)($sp+36) > (gdb) info regis > eax 0x10 16 > ecx 0x401080 4198528 > edx 0x4c 76 > ebx 0x0 0 > esp 0x23cc80 0x23cc80 > ebp 0x61166a78 0x61166a78 > esi 0x611001a0 1628438944 > edi 0x401430 4199472 > eip 0x2f 0x2f > eflags 0x202 [ IF ] > cs 0x1b 27 > ss 0x23 35 > ds 0x23 35 > es 0x23 35 > fs 0x3b 59 > gs 0x0 0 > (gdb) > > > You're not by any chance trying to debug a core file are you? > > cheers, > DaveK > -- > Can't think of a witty .sigline today.... > > -- Indu :) Smile.... & Make others Smile :)