This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PATCH: error reading variable: value has been optimized out
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Andrew Burgess <aburgess at broadcom dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 3 Sep 2012 17:16:26 +0200
- Subject: Re: PATCH: error reading variable: value has been optimized out
- References: <50376F3B.1080407@broadcom.com> <20120826171840.GA21205@host2.jankratochvil.net> <504092C0.2000602@broadcom.com>
On Fri, 31 Aug 2012 12:32:32 +0200, Andrew Burgess wrote:
> Included a test case (below) that covers 4 different cases, all of which are
> currently broken in different ways. These are,
I would prefer to give arbitrary names suggesting what each test does, instead
of 1, 2, 3 and 4. The same applies to the name of tests in resulting gdb.sum.
Also I had to create same map of the test for myself, it could be given there:
ABI registers order: rdi rsi rdx rcx r8 r9
==amd64_dummy_call_integer_regs
pre-set: rdi rsi rdx rcx rbx
undefined: rdi rsi rcx
used: rdi rsi rdx rcx r8 rbx
operand0 operand1 operand2
test1: rcx rbx rsi
test2: rdx (+rcx) rcx (+r8) rsi (+rdx)
test3: rdx +rcx rcx +rbx rsi +rdi
test4: rdx/4+rcx/4 rcx/4+rbx/4 rsi/4+rdi/4
This shows it tries to print also r8 but r8 is not initialized.
Also I would prefer to initialize each 32-bit part of each register by
a unique value, $0xdeadbeefdeadbeef everywhere may needlessly hide possible
ordering errors. That means some 0xdeadbe00deadbe01, 0xdeadbe02deadbe03 or
anything like that.
> My original patch fixes (1) and (2),
In such case (3) and (4) should be KFAILed with PR number(s) filed and stated
there.
> though as Tom suggested we could do better in case (2) if we used computed
> values to describe partially optimized out values, but as gcc is no longer
> creating examples like this I think we can accept the more limited solution
> I originally suggessted, if that's ok.
Although formally there should be also filed PR and to KFAIL the case 2.
(Unfixed GDB would FAIL and not KFAIL.)
gdb_test "set print frame-arguments all" ""
->
gdb_test_no_output "set print frame-arguments all"
gdb_test "break breakpt" "Breakpoint.*at.*"
->
gdb_breakpoint "breakpt"
Thanks,
Jan