From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 762 invoked by alias); 21 Aug 2008 12:04:42 -0000 Received: (qmail 722 invoked by uid 22791); 21 Aug 2008 12:04:40 -0000 X-Spam-Check-By: sourceware.org Received: from fg-out-1718.google.com (HELO fg-out-1718.google.com) (72.14.220.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 21 Aug 2008 12:03:26 +0000 Received: by fg-out-1718.google.com with SMTP id e12so560266fga.0 for ; Thu, 21 Aug 2008 05:03:23 -0700 (PDT) Received: by 10.86.83.2 with SMTP id g2mr1054263fgb.54.1219320203192; Thu, 21 Aug 2008 05:03:23 -0700 (PDT) Received: by 10.86.68.18 with HTTP; Thu, 21 Aug 2008 05:03:23 -0700 (PDT) Message-ID: <991f3a0a0808210503y3c2c9218h5fcfb7bf544215da@mail.gmail.com> Date: Thu, 21 Aug 2008 20:11:00 -0000 From: "Seong-Kook Shin" To: gdb@sourceware.org Subject: signal 0 command MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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: 2008-08/txt/msg00241.txt.bz2 Hi. While reading the gdb info manual, I found the paragraph saying: Alternatively, if SIGNAL is zero, continue execution without giving a signal. This is useful when your program stopped on account of a signal and would ordinary see the signal when resumed with the `continue' command; `signal 0' causes it to resume without a signal. If I understand correctly, I can issue "signal 0" to ignore the current signal GDB caught, right? So I made a simple program to raise SIGSEGV: void foo(const char *str) { char *p = 0; /* This should be "char *p = str" */ while (*p != '\0') { /* do something */ p++; } } After reading the manual, I thought that it is possible to undo the generation of SIGSEGV after modifying the value `p'. But when I set the value of `p' corrently, and execute "signal 0", I can still see the SIGSEGV is generated. $ gdb -q a.out Using host libthread_db library "/lib/libthread_db.so.1". (gdb) r Starting program: /home/cinsk/pesticide/a.out Program received signal SIGSEGV, Segmentation fault. 0x08048399 in foo (str=0x80484b8 "hello, world") at segv.c:8 8 while (*p != '\0') { (gdb) p p $1 = 0x0 (gdb) p p = str $2 = 0x80484b8 "hello, world" (gdb) signal 0 Continuing with no signal. Program received signal SIGSEGV, Segmentation fault. 0x08048399 in foo (str=0x80484b8 "hello, world") at segv.c:8 8 while (*p != '\0') { (gdb) _ Am I missing something? If I misunderstand the meaning of "signal 0" command, please let me know. (A short example session would be great!!) Thanks in advance. -- C FAQs: http://www.eskimo.com/~scs/C-faq/top.html Korean: http://pcrc.hongik.ac.kr/~cinsk/cfaqs/