Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Andrew Burgess <aburgess@broadcom.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: PATCH: error reading variable: value has been optimized out
Date: Mon, 03 Sep 2012 15:17:00 -0000	[thread overview]
Message-ID: <20120903151626.GB16315@host2.jankratochvil.net> (raw)
In-Reply-To: <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


  parent reply	other threads:[~2012-09-03 15:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-24 12:11 Andrew Burgess
2012-08-26 18:22 ` Jan Kratochvil
2012-08-27 15:46   ` Tom Tromey
2012-08-31  9:59     ` Eli Zaretskii
2012-09-03 15:07     ` Jan Kratochvil
2012-08-31 10:33   ` Andrew Burgess
2012-09-01  8:17     ` Eli Zaretskii
2012-09-03  8:32       ` Andrew Burgess
2012-09-03 11:24       ` Jan Kratochvil
2012-09-03 15:38         ` Eli Zaretskii
2012-09-03 15:17     ` Jan Kratochvil [this message]
2012-09-04 16:58       ` Andrew Burgess
2012-09-05 18:54         ` Jan Kratochvil
2012-09-12 17:30     ` Tom Tromey
2012-09-13 12:34       ` Andrew Burgess
2012-09-14 19:02         ` Tom Tromey
2012-09-14 21:39           ` Andrew Burgess
2012-09-17 16:57             ` Jan Kratochvil
2012-09-19 14:29               ` Andrew Burgess
2012-09-20 13:28                 ` Jan Kratochvil
2012-09-21 17:19                   ` Andrew Burgess

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=20120903151626.GB16315@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=aburgess@broadcom.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