From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3477 invoked by alias); 15 Feb 2013 15:18:02 -0000 Received: (qmail 3450 invoked by uid 22791); 15 Feb 2013 15:18:00 -0000 X-SWARE-Spam-Status: No, hits=-3.4 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,MIME_CHARSET_FARAWAY,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout23.012.net.il (HELO mtaout23.012.net.il) (80.179.55.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Feb 2013 15:17:48 +0000 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MI900H00P1Y1G00@a-mtaout23.012.net.il> for gdb@sourceware.org; Fri, 15 Feb 2013 17:17:28 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MI900GOVP53RS50@a-mtaout23.012.net.il>; Fri, 15 Feb 2013 17:17:28 +0200 (IST) Date: Fri, 15 Feb 2013 15:18:00 -0000 From: Eli Zaretskii Subject: Re: How to monitor register In-reply-to: <32f36d08.2667.13cde461a04.Coremail.guoqiuping81112@163.com> To: =?gbk?B?ufnH78a9?= Cc: gdb@sourceware.org Reply-to: Eli Zaretskii Message-id: <83a9r5txlx.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=gbk Content-transfer-encoding: 8BIT References: <83boblu1h6.fsf@gnu.org> <32f36d08.2667.13cde461a04.Coremail.guoqiuping81112@163.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: 2013-02/txt/msg00059.txt.bz2 > Date: Fri, 15 Feb 2013 22:33:21 +0800 (CST) > From: ¹ùÇïÆ½ > Cc: gdb@sourceware.org > > the comand "watch $ebp" seems not work. > i write a simple code to test the comad like this: > void func1(){int i = 0; i++;} > void func2(){int i = 0; i++;} > int main(){func1(); func2();} > i watch $ebp while using gdb to startup the program, it will not pause when invoke func1 and func2. > the gdb's version is 7.1 Works for me with GDB 7.5.1 (on MS-Windows): (gdb) start Temporary breakpoint 1 at 0x401342: file twatch.c, line 3. Starting program: D:\usr\eli\data\twatch.exe [New Thread 26676.0x6804] Temporary breakpoint 1, 0x00401342 in main () at twatch.c:3 3 int main(){func1(); func2();} (gdb) watch $ebp Watchpoint 2: $ebp (gdb) c Continuing. Watchpoint 2: $ebp Old value = (void *) 0x22ff78 New value = (void *) 0x22ff58 0x004012f3 in func1 () at twatch.c:1 1 void func1(){int i = 0; i++;} (gdb) c Continuing. Watchpoint 2: $ebp Old value = (void *) 0x22ff58 New value = (void *) 0x22ff78 0x00401303 in func1 () at twatch.c:1 1 void func1(){int i = 0; i++;} (gdb) c Continuing. Watchpoint 2: $ebp Old value = (void *) 0x22ff78 New value = (void *) 0x22ff58 0x00401307 in func2 () at twatch.c:2 2 void func2(){int i = 0; i++;} (gdb) c Continuing. Watchpoint 2: $ebp Old value = (void *) 0x22ff58 New value = (void *) 0x22ff78 0x00401317 in func2 () at twatch.c:2 2 void func2(){int i = 0; i++;} (gdb) c Continuing. Watchpoint 2: $ebp Old value = (void *) 0x22ff78 New value = (void *) 0x22ffb0 0x0040134d in main () at twatch.c:3 3 int main(){func1(); func2();} (gdb) c Continuing. Watchpoint 2: $ebp Old value = (void *) 0x22ffb0 New value = (void *) 0x22ff68 0x77c39de0 in msvcrt!_initterm () from C:\WINDOWS\system32\msvcrt.dll (gdb)