Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Andreas Arnez <arnez@linux.vnet.ibm.com>
Cc: GDB Development <gdb@sourceware.org>, Tom Tromey <tom@tromey.com>
Subject: Re: Should a DW_OP_implicit_value be taken from the left end?
Date: Wed, 21 Dec 2016 21:39:00 -0000	[thread overview]
Message-ID: <20161221213927.GA2306@host1.jankratochvil.net> (raw)
In-Reply-To: <m3y3z95ase.fsf@oc1027705133.ibm.com>

On Wed, 21 Dec 2016 20:42:25 +0100, Andreas Arnez wrote:
> Since DW_OP_implicit_value can express arbitrary amounts of structured
> or unstructured data, the notion of a "least significant byte" is
> meaningless.

That depends on what the compiler-debugger negotiate together, as specified by
the DWARF standard which is ambiguous in this case IIUC.


> The patch above makes it impossible for a
> DW_OP_implicit_pointer operation to refer to any sub-value within a
> DW_OP_implicit_value on big-endian targets.

When looking at the patch I think the patch may be wrong, I think the
endianity should affect at least also the lines:

        case DWARF_VALUE_LITERAL:
...
            ldata = ctx.data + byte_offset;
            n -= byte_offset;


> E.g., consider this code snippet:
> 
>   const char foo[] = "Hello, world!";
>   char *a = &foo[0];
>   char *b = &foo[7];
> 
> IMHO the compiler should be able to describe `foo' with a single
> DW_OP_implicit_value operation and `a' and `b' as DW_OP_implicit_pointer
> operations pointing into that value.

I would need a compilable + compiled code + DWARF output + GDB output to say
more.


> Any objections?

I really do not mind reverting the patch if you think so, that is up to the
maintainers.

But when you ask me I miss here stating what the current GCC version does
produce.  Is GDB behavior fixed with current GCC by your proposed patch
revert?  If it breaks do you plan to change/fix also GCC?  Does the GDB
testsuite (particulerly the entryval testcases) have no regressions on s390*?

From my mail you reference I understand it as that my patch did fix some
entryval testcases with GCC that time.  Unfortunately the entryval testcases
are provided as .S files prebuilt by GCC that time and they are difficult to
reproduce with newer GCC as -O2 -g code changes too much with different GCC
version, breaking various compiled code assumptions of the .exp file.

My feeling is that my patch did fix some entryval testcases on bigendian but
I also guess my patch was wrong - it only accidentally fixed them, the right
fix for big endian should look differently.


Jan


  reply	other threads:[~2016-12-21 21:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21 19:42 Andreas Arnez
2016-12-21 21:39 ` Jan Kratochvil [this message]
2016-12-23 18:18   ` Andreas Arnez
2017-01-01 20:13     ` 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=20161221213927.GA2306@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=arnez@linux.vnet.ibm.com \
    --cc=gdb@sourceware.org \
    --cc=tom@tromey.com \
    /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