From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7456 invoked by alias); 21 Aug 2008 12:24:44 -0000 Received: (qmail 7446 invoked by uid 22791); 21 Aug 2008 12:24:44 -0000 X-Spam-Check-By: sourceware.org Received: from cantor.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 21 Aug 2008 12:24:05 +0000 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 8A8A841DC7; Thu, 21 Aug 2008 14:24:02 +0200 (CEST) From: Andreas Schwab To: "Seong-Kook Shin" Cc: gdb@sourceware.org Subject: Re: signal 0 command References: <991f3a0a0808210503y3c2c9218h5fcfb7bf544215da@mail.gmail.com> X-Yow: Edwin Meese made me wear CORDOVANS!! Date: Thu, 21 Aug 2008 21:25:00 -0000 In-Reply-To: <991f3a0a0808210503y3c2c9218h5fcfb7bf544215da@mail.gmail.com> (Seong-Kook Shin's message of "Thu, 21 Aug 2008 21:03:23 +0900") Message-ID: User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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: 2008-08/txt/msg00242.txt.bz2 "Seong-Kook Shin" writes: > 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. Modifying the variable does not necessarily mean that the current instruction can see the change. The value may be been loaded into a register which is used instead by the insn. You may have to modify the program counter to move back to where the variable's value is loaded. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."