This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch 00/12] entryval: Fix x86_64 <optimized out> parameters, virtual tail call frames


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]