From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18155 invoked by alias); 18 Jul 2011 20:14:23 -0000 Received: (qmail 18145 invoked by uid 22791); 18 Jul 2011 20:14:21 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Jul 2011 20:13:49 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6IKDmmJ013923 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 18 Jul 2011 16:13:48 -0400 Received: from host1.jankratochvil.net (ovpn-116-20.ams2.redhat.com [10.36.116.20]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p6IKDlV9010033 for ; Mon, 18 Jul 2011 16:13:47 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p6IKDkGL015095 for ; Mon, 18 Jul 2011 22:13:46 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p6IKDjYZ015091 for gdb-patches@sourceware.org; Mon, 18 Jul 2011 22:13:45 +0200 Date: Mon, 18 Jul 2011 20:16:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch 00/12] entryval: Fix x86_64 parameters, virtual tail call frames Message-ID: <20110718201344.GA30496@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-07/txt/msg00432.txt.bz2 Hi, this is GDB side implementation of the DWARF-5.0 `entry values' extension: Improving debug info for optimized away parameters http://gcc.gnu.org/wiki/summit2010?action=AttachFile&do=get&target=jelinek.pdf GCC patch: [PATCH] Debug info extensions to support optimized out parameters http://gcc.gnu.org/ml/gcc-patches/2010-08/msg01475.html currently on trunk (FSF gcc-4.7.0), not in any FSF gcc-4.6.x. For Fedora users it is backported in gcc-4.6.1-1.fc16. It is targeted at improving backtraces of -O2 -g code; it has no effect for -O0 -g code or for code without -g. And the primary target is x86_64 with parameters in registers which get usually lost very soon. i386 with stack passed parameters has them available during the whole function execution. The features for GDB: * Reduce parameters on x86_64 (arches with parameters in registers) [ There was difficulty with Python interactive debugging on x86_64 where the `f' parameter is Python context and it is essential for debugging: #13 in PyEval_EvalFrameEx (f=, throwflag=) at /usr/src/debug/Python-2.7/Python/ceval.c:2552 -> #13 in PyEval_EvalFrameEx (f=0x29aeb70, throwflag=0) at /home/jkratoch/redhat/fedora/python/f14/Python-2.7/Python/ceval.c:2552 ] * Enable displaying paramname@entry - value the parameter had at the function entry [ "" is not much useful to see in `bt full' of GDB itself: #8 in execute_command (p=0x22b573b "", from_tty=1) at top.c:438 p@entry = 0x22b5720 "maintenance internal-error " In this case there is also a local variable which shows the same info; line = 0x22b5720 "maintenance internal-error " in other apps there does not have to be such variable ] * Display virtual tail call frames (jmp instead of call at the end) [ PDF Figure 5 frame #6 is a virtual tail call frame ] Besides the new supported syntax `paramname@entry' no new user interaction is needed, everything just improves the user experience and makes -O2 -g debugging like -O0 -g debugging. In fact better thanks to the @entry values. There are some further extension possibilities at least on the GDB side (such as showing parameters which self tail calls which do not modify them etc.) and I guess there may be more extensions possible also on the GCC side; but this patchset gives at least the initial playground, also good enough for already improving experience of direct debugging of production (-O2 -g) code. Practical deployment should show the next direction of improvements. The patches are available (merged only) in GIT for more convenience at: http://sourceware.org/gdb/wiki/ArcherBranchManagement archer-jankratochvil-entryval No regressions on {x86_64,x86_64-m32,i686}-fedora16pre-linux-gnu. Except for the last patch the intermediate patches do not have pre-compiled testcase and they require gcc-4.7.0 and runtest flag COMPILE=1. Thanks, Jan