Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: [patch 00/12] entryval: Fix x86_64 <optimized out> parameters, virtual tail call frames
Date: Mon, 18 Jul 2011 20:16:00 -0000	[thread overview]
Message-ID: <20110718201344.GA30496@host1.jankratochvil.net> (raw)

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 <optimized out> 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=<value optimized out>, throwflag=<value optimized out>) 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


             reply	other threads:[~2011-07-18 20:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-18 20:16 Jan Kratochvil [this message]
2011-07-19 16:39 ` Tom Tromey
2011-07-19 16:40   ` Jan Kratochvil
2011-07-19 18:17     ` Tom Tromey
2011-07-19 18:27       ` Jan Kratochvil
2011-07-19 18:44         ` Tom Tromey
2011-09-13 19:54 ` obsolete: " Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110718201344.GA30496@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox