From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28710 invoked by alias); 25 Jun 2013 04:11:35 -0000 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 Received: (qmail 28671 invoked by uid 89); 25 Jun 2013 04:11:30 -0000 X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-wg0-f44.google.com (HELO mail-wg0-f44.google.com) (74.125.82.44) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 25 Jun 2013 04:11:29 +0000 Received: by mail-wg0-f44.google.com with SMTP id m15so8784056wgh.11 for ; Mon, 24 Jun 2013 21:11:26 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.184.12 with SMTP id eq12mr7769549wic.8.1372133486676; Mon, 24 Jun 2013 21:11:26 -0700 (PDT) Received: by 10.227.48.201 with HTTP; Mon, 24 Jun 2013 21:11:26 -0700 (PDT) Date: Tue, 25 Jun 2013 04:11:00 -0000 Message-ID: Subject: gdb cannot call help function in replay mode From: jian shen To: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-06/txt/msg00055.txt.bz2 In below example, when I try to call function getA1() in replay mode, gdb give warning that it will write memory and make the execution log unusable, although this function does not write memory, only read memory. (here, read the global variable "_a1") In real project, I have some helper function to dump what a handle is. But in replay mode, I could not call such functions. This limitation makes the replay mode almost unusable to me. Any suggestion? ----- a.c ----- 1 int _a1; 2 int getA1() 3 { 4 return _a1; 5 } 6 7 int main() 8 { 9 _a1 = 3; 10 _a1 ++; 11 _a1 ++; 12 return 0; 13 } 14 ----- a.c end ----- GNU gdb (GDB) 7.6 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /home/jianshen/t1/t1...done. (gdb) b main Breakpoint 1 at 0x80483f9: file a.c, line 9. (gdb) r Starting program: /home/jianshen/t1/t1 Breakpoint 1, main () at a.c:9 9 _a1 = 3; (gdb) record (gdb) n 10 _a1 ++; (gdb) n 11 _a1 ++; (gdb) rn 10 _a1 ++; (gdb) p getA1() Because GDB is in replay mode, writing to memory will make the execution log unusable from this point onward. Write memory at address 0xbffff64f?(y or n) y $1 = 3 (gdb) rs 10 _a1 ++; (gdb) rs 10 _a1 ++; (gdb) rs 10 _a1 ++; (gdb) rs 10 _a1 ++; (gdb) rs getA1 () at a.c:5 5 } Thanks, Jian