public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/31427] New: DWARF expression evaluation misconception
@ 2024-02-28 15:56 tromey at sourceware dot org
  2024-02-28 17:33 ` [Bug symtab/31427] " tromey at sourceware dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2024-02-28 15:56 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31427

            Bug ID: 31427
           Summary: DWARF expression evaluation misconception
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: tromey at sourceware dot org
  Target Milestone: ---

This comes from:

https://lists.dwarfstd.org/pipermail/dwarf-discuss/2024-February/002375.html
https://dwarfstd.org/issues/181205.1.html

gdb should reset the DWARF expression stack after a piece operation.
Apparently nobody noticed this text in 2.6.1 "Single Location Descriptions":

Each simple location description that is a DWARF expression is
evaluated independently of any others.

Also an empty first piece is ok.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug symtab/31427] DWARF expression evaluation misconception
  2024-02-28 15:56 [Bug symtab/31427] New: DWARF expression evaluation misconception tromey at sourceware dot org
@ 2024-02-28 17:33 ` tromey at sourceware dot org
  2024-02-28 17:35 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2024-02-28 17:33 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31427

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
I'm not sure there's a valid expression that would give
a different result if values were left on the stack
between pieces.

Maybe it can only be done in the situation where an initial
value must be pushed.  Presumably in the pieced case,
the initial value must be pushed before each piece is
evaluated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug symtab/31427] DWARF expression evaluation misconception
  2024-02-28 15:56 [Bug symtab/31427] New: DWARF expression evaluation misconception tromey at sourceware dot org
  2024-02-28 17:33 ` [Bug symtab/31427] " tromey at sourceware dot org
@ 2024-02-28 17:35 ` tromey at sourceware dot org
  2024-02-28 17:43 ` tromey at sourceware dot org
  2024-02-28 17:44 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2024-02-28 17:35 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31427

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
The empty first piece part works, according to a test
case I wrote:

(gdb) print s1
$1 = {a = <optimized out>, b = 23}

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug symtab/31427] DWARF expression evaluation misconception
  2024-02-28 15:56 [Bug symtab/31427] New: DWARF expression evaluation misconception tromey at sourceware dot org
  2024-02-28 17:33 ` [Bug symtab/31427] " tromey at sourceware dot org
  2024-02-28 17:35 ` tromey at sourceware dot org
@ 2024-02-28 17:43 ` tromey at sourceware dot org
  2024-02-28 17:44 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2024-02-28 17:43 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31427

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Tom Tromey from comment #1)

> Maybe it can only be done in the situation where an initial
> value must be pushed.  Presumably in the pieced case,
> the initial value must be pushed before each piece is
> evaluated.

It's hard to imagine this even being useful, as the cases
where a value is pushed on the stack aren't really ones
where a pieced result would be useful or expected.
I'll attach my test case here but I think this bug
is probably only of pedantic interest; and the bug
in the rust support pointed out in those links is,
I think, a problem in rust-lang.c.  I'll file a separate
bug for that.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug symtab/31427] DWARF expression evaluation misconception
  2024-02-28 15:56 [Bug symtab/31427] New: DWARF expression evaluation misconception tromey at sourceware dot org
                   ` (2 preceding siblings ...)
  2024-02-28 17:43 ` tromey at sourceware dot org
@ 2024-02-28 17:44 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2024-02-28 17:44 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31427

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
Created attachment 15382
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15382&action=edit
test case

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2024-02-28 17:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-28 15:56 [Bug symtab/31427] New: DWARF expression evaluation misconception tromey at sourceware dot org
2024-02-28 17:33 ` [Bug symtab/31427] " tromey at sourceware dot org
2024-02-28 17:35 ` tromey at sourceware dot org
2024-02-28 17:43 ` tromey at sourceware dot org
2024-02-28 17:44 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).