From patchwork Tue Nov 12 11:47:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Konstantin Kharlamov X-Patchwork-Id: 1193482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-513094-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Br4/pJ81"; dkim=pass (1024-bit key; unprotected) header.d=yandex.ru header.i=@yandex.ru header.b="fnXNWDKZ"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47C5by6n4zz9sNT for ; Tue, 12 Nov 2019 22:48:29 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=oDr cNP0iaTGfOaqR4lqvXk2WzvJPwv1gWcYcK/md6hKJJvohwP1tZrC3xH3P56WunnG uJU6JFcbjdRrylX5sW+Gl+9CJr7hKGUrjh6UUIgIyEaokOr6/j3Fcc9FINs2PIdi ITdOA9Jb6GiEkuIf4i9JjmcJ9sQS/Np3HoftHHI4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=lE5lBCmel fnGg6s/8Iq3nC4nutg=; b=Br4/pJ81j74ujbM6Mfo+g2oPA1ieI2Eqk+8HVkhrk jEUDWLj9aIzzPHXhUldUPtgThU9L7eXLMhv3XVYg2TM24So9+QXgvLAl/WU2XTPa VCb/fbs6LD3P602ptPXU+LUPGgrDPGb0XIXOpuaGQ+ZgPXsT5CWWbUQV7jHlWKnG rY= Received: (qmail 101092 invoked by alias); 12 Nov 2019 11:47:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 101041 invoked by uid 89); 12 Nov 2019 11:47:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=debug_tree, H*F:D*ru, UD:ru X-HELO: forward102j.mail.yandex.net Received: from forward102j.mail.yandex.net (HELO forward102j.mail.yandex.net) (5.45.198.243) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 Nov 2019 11:47:45 +0000 Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward102j.mail.yandex.net (Yandex) with ESMTP id D021BF21BCF for ; Tue, 12 Nov 2019 14:47:42 +0300 (MSK) Received: from myt5-e8d19f59bd21.qloud-c.yandex.net (myt5-e8d19f59bd21.qloud-c.yandex.net [2a02:6b8:c12:3e24:0:640:e8d1:9f59]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id cGMIlbvEX8-lgNiG1PQ; Tue, 12 Nov 2019 14:47:42 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1573559262; bh=mFfFk5m42pdoB4I+PKM1EzFHeXxDbGtmIfl2zqdtydo=; h=In-Reply-To:Subject:To:From:References:Date:Message-Id; b=fnXNWDKZPLC3NyGoDf1vPEY2ajn6CnTWATeIzzsNPBl7mOBux7L06c7tFJqP4sXyw /KdUqE9QScZK/kgkVT6A3GlAWpVSsIGGxDC4T6JLmtIphjgyBkjj26sKkOU5Na0sr6 jlekpiLAzOI2RcjI0t2IsYW8cWCjeonsrPYg7+bE= Authentication-Results: mxback9g.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by myt5-e8d19f59bd21.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id D0Lzq8NrDN-lf0KwkmN; Tue, 12 Nov 2019 14:47:41 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) From: Konstantin Kharlamov To: gcc-patches@gcc.gnu.org Subject: [PATCH 2/2] gdbinit.in: fix wrong reference to function argument Date: Tue, 12 Nov 2019 14:47:34 +0300 Message-Id: <20191112114734.890813-3-Hi-Angel@yandex.ru> In-Reply-To: <20191112114734.890813-1-Hi-Angel@yandex.ru> References: <20191112114734.890813-1-Hi-Angel@yandex.ru> MIME-Version: 1.0 X-IsSubscribed: yes Gdb documentation says that gdb-defined functions refer to their args as $arg0…$argN. The just "$" that gdbinit is using here refers to something else, which results in gdb errors, or even crashes of debuggee. Let's fix that. * (debug,debug_rtx,pr,prl,pt,pct,pgg,pgq,pgq,pgs,pge,pmz,ptc, pdn,ptn,pdd,prc,pi,pbs,pbm,pel,pcfun,trt): replace $ with $arg0 --- gcc/gdbinit.in | 82 +++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/gcc/gdbinit.in b/gcc/gdbinit.in index a933ddc6141..71a01edaa71 100644 --- a/gcc/gdbinit.in +++ b/gcc/gdbinit.in @@ -17,153 +17,153 @@ # . define pp -call debug ($) +call debug ($arg0) end document pp -Print a representation of the GCC data structure that is $. +Print a representation of the GCC data structure that is $arg0. Works only when an inferior is executing. end define pr -call debug_rtx ($) +call debug_rtx ($arg0) end document pr -Print the full structure of the rtx that is $. +Print the full structure of the rtx that is $arg0. Works only when an inferior is executing. end define prl -call debug_rtx_list ($, debug_rtx_count) +call debug_rtx_list ($arg0, debug_rtx_count) end document prl -Print the full structure of all rtx insns beginning at $. +Print the full structure of all rtx insns beginning at $arg0. Works only when an inferior is executing. Uses variable debug_rtx_count to control number of insns printed: - debug_rtx_count > 0: print from $ on. - debug_rtx_count < 0: print a window around $. + debug_rtx_count > 0: print from $arg0 on. + debug_rtx_count < 0: print a window around $arg0. There is also debug_rtx_find (rtx, uid) that will scan a list for UID and print it using debug_rtx_list. Usage example: set $foo=debug_rtx_find(first, 42) end define pt -call debug_tree ($) +call debug_tree ($arg0) end document pt -Print the full structure of the tree that is $. +Print the full structure of the tree that is $arg0. Works only when an inferior is executing. end define pct -call debug_c_tree ($) +call debug_c_tree ($arg0) end document pct -Print the tree that is $ in C syntax. +Print the tree that is $arg0 in C syntax. Works only when an inferior is executing. end define pgg -call debug_gimple_stmt ($) +call debug_gimple_stmt ($arg0) end document pgg -Print the Gimple statement that is $ in C syntax. +Print the Gimple statement that is $arg0 in C syntax. Works only when an inferior is executing. end define pgq -call debug_gimple_seq ($) +call debug_gimple_seq ($arg0) end document pgq -Print the Gimple sequence that is $ in C syntax. +Print the Gimple sequence that is $arg0 in C syntax. Works only when an inferior is executing. end define pgs -call debug_generic_stmt ($) +call debug_generic_stmt ($arg0) end document pgs -Print the statement that is $ in C syntax. +Print the statement that is $arg0 in C syntax. Works only when an inferior is executing. end define pge -call debug_generic_expr ($) +call debug_generic_expr ($arg0) end document pge -Print the expression that is $ in C syntax. +Print the expression that is $arg0 in C syntax. Works only when an inferior is executing. end define pmz -call mpz_out_str(stderr, 10, $) +call mpz_out_str(stderr, 10, $arg0) end document pmz -Print the mpz value that is $ +Print the mpz value that is $arg0 Works only when an inferior is executing. end define ptc -output (enum tree_code) $.base.code +output (enum tree_code) $arg0.base.code echo \n end document ptc -Print the tree-code of the tree node that is $. +Print the tree-code of the tree node that is $arg0. end define pdn -output $.decl_minimal.name->identifier.id.str +output $arg0.decl_minimal.name->identifier.id.str echo \n end document pdn -Print the name of the decl-node that is $. +Print the name of the decl-node that is $arg0. end define ptn -output $.type.name->decl_minimal.name->identifier.id.str +output $arg0.type.name->decl_minimal.name->identifier.id.str echo \n end document ptn -Print the name of the type-node that is $. +Print the name of the type-node that is $arg0. end define pdd -call debug_dwarf_die ($) +call debug_dwarf_die ($arg0) end document pdd -Print the dw_die_ref that is in $. +Print the dw_die_ref that is in $arg0. end define prc -output (enum rtx_code) $.code +output (enum rtx_code) $arg0.code echo \ ( -output $.mode +output $arg0.mode echo )\n end document prc -Print the rtx-code and machine mode of the rtx that is $. +Print the rtx-code and machine mode of the rtx that is $arg0. end define pi -print $.u.fld[0].rt_rtx@7 +print $arg0.u.fld[0].rt_rtx@7 end document pi -Print the fields of an instruction that is $. +Print the fields of an instruction that is $arg0. end define pbs @@ -176,20 +176,20 @@ including the global binding level. end define pbm -call bitmap_print (stderr, $, "", "\n") +call bitmap_print (stderr, $arg0, "", "\n") end document pbm -Dump the bitmap that is in $ as a comma-separated list of numbers. +Dump the bitmap that is in $arg0 as a comma-separated list of numbers. end define pel -output expand_location ($) +output expand_location ($arg0) echo \n end document pel -Print expanded location of $. +Print expanded location of $arg0. end define pcfun @@ -202,11 +202,11 @@ Print current function. end define trt -print ($.typed.type) +print ($arg0.typed.type) end document trt -Print TREE_TYPE of the tree node that is $ +Print TREE_TYPE of the tree node that is $arg0 end define break-on-diagnostic