From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72742 invoked by alias); 12 Nov 2019 12:58:30 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 72731 invoked by uid 89); 12 Nov 2019 12:58:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=Who, H*i:sk:mvmr22d, H*f:message, H*f:2019 X-HELO: forward104o.mail.yandex.net Received: from forward104o.mail.yandex.net (HELO forward104o.mail.yandex.net) (37.140.190.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 Nov 2019 12:58:27 +0000 Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward104o.mail.yandex.net (Yandex) with ESMTP id C3435941CF2; Tue, 12 Nov 2019 15:58:23 +0300 (MSK) Received: from iva7-f08b2a8dca2b.qloud-c.yandex.net (iva7-f08b2a8dca2b.qloud-c.yandex.net [2a02:6b8:c0c:6e00:0:640:f08b:2a8d]) by mxback7o.mail.yandex.net (mxback/Yandex) with ESMTP id zAT81MLgcW-wN8C5FR3; Tue, 12 Nov 2019 15:58:23 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1573563503; bh=DMNIzmIO8T/koVRor4ZxCL+UgUPfGrZzWLSD8ozc4EQ=; h=In-Reply-To:Cc:To:Subject:From:References:Date:Message-Id; b=O6IMq3LyvSAQmAVVYR7aiSywpNM1A2rgjZKq2WIj5QH+Disur2Gbh5VafkIsTR0kI fnajgPO4Uyt7DFYvrEUto7sWVwBHY4qYqI2YU5kCjxgzgLIua8SBIxKL3HFLdjBmqv WMFLWAU4ov6uFKpneKre5uDTeZRqB+YlUvx7+3zA= Authentication-Results: mxback7o.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by iva7-f08b2a8dca2b.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id n3RH0S82Sl-wM0K5vuk; Tue, 12 Nov 2019 15:58:22 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Date: Tue, 12 Nov 2019 13:03:00 -0000 From: Konstantin Kharlamov Subject: Re: [PATCH 2/2] gdbinit.in: fix wrong reference to function argument To: Andreas Schwab Cc: gcc-patches@gcc.gnu.org Message-Id: <1573563502.2541.5@yandex.ru> In-Reply-To: References: <20191112114734.890813-1-Hi-Angel@yandex.ru> <20191112114734.890813-3-Hi-Angel@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251; format=flowed Content-Transfer-Encoding: quoted-printable X-SW-Source: 2019-11/txt/msg00897.txt.bz2 On =C2=F2, =ED=EE=FF 12, 2019 at 13:50, Andreas Schwab =20 wrote: > On Nov 12 2019, Konstantin Kharlamov wrote: >=20 >> Gdb documentation says that gdb-defined functions refer to their=20 >> args as >> $arg0=85$argN. The just "$" that gdbinit is using here refers to=20 >> something >> else, >=20 > That's the last thing printed. Hmm, okay=85 Am I missing something=85? As I'm reading, this looks=20 definitely wrong, because the "last thing printed" is just a random=20 value. To illustrate: I can do a calculation, like `p 2 + 2`, and then=20 I execute, say, `pgg stmt`, and debuggee crashes because it calls=20 `debug_gimple_stmt(4)`. That's what happened to me a lot of times until=20 I figured the problem is in gdbinit. >> which results in gdb errors, or even crashes of debuggee. Let's >> fix that. >=20 > That breaks all users of these macros, since you are now required to > pass an argument. I'm definitely missing something. Who are these users, and how can they=20 make anything useful of these functions if they don't even pass an=20 argument? > Andreas. >=20 > -- > Andreas Schwab, SUSE Labs, schwab@suse.de > GPG Key fingerprint =3D 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA=20 > B9D7 > "And now for something completely different."