Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Should a DW_OP_implicit_value be taken from the left end?
@ 2016-12-21 19:42 Andreas Arnez
  2016-12-21 21:39 ` Jan Kratochvil
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Arnez @ 2016-12-21 19:42 UTC (permalink / raw)
  To: GDB Development; +Cc: Tom Tromey, Jan Kratochvil

The following patch changed how sub-values of a DW_OP_implicit_value are
extracted on big-endian platforms:

  https://sourceware.org/ml/gdb-patches/2011-08/msg00123.html

The patch seems to assume that the placement rule is similar as for
DW_OP_stack_value.  I think that's wrong; DW_OP_implicit_value should
always be taken from the left end.  (See rationale below for an
explanation.)  And I'd like to know whether anyone objects.

I'm in the process of preparing a patch series for fixing various
problems with DWARF piece handling, and the series currently contains a
patch for reverting the above patch's effect on DW_OP_implicit_value.

Rationale:

Since DW_OP_implicit_value can express arbitrary amounts of structured
or unstructured data, the notion of a "least significant byte" is
meaningless.  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.

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.

Any objections?

--
Andreas


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-01 20:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-21 19:42 Should a DW_OP_implicit_value be taken from the left end? Andreas Arnez
2016-12-21 21:39 ` Jan Kratochvil
2016-12-23 18:18   ` Andreas Arnez
2017-01-01 20:13     ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox