Skip to content

Comments

Refine type#130

Draft
woodard wants to merge 5 commits intoccoutant:mainfrom
woodard:refine-type
Draft

Refine type#130
woodard wants to merge 5 commits intoccoutant:mainfrom
woodard:refine-type

Conversation

@woodard
Copy link
Contributor

@woodard woodard commented Jan 22, 2026

No description provided.

Signed-off-by: Ben Woodard <woodard@redhat.com>
This is a novel approach to fixing the refined type problem. Basically
rather than changing the behavior of location lists, or adding a
secondarly location list which specifies which provides the type for a
location, this addresses at least the most critical problems by
removing a restriction on DW_OP_reinterpret.

Signed-off-by: Ben Woodard <woodard@redhat.com>
Locations on the stack didn't address what DW_OP_reinterpret does when
the top of the stack is a location. This further modifies the
description of the operator to clarify how it handles a location on
the stack.

It also fixes a couple of typos.

Signed-off-by: Ben Woodard <woodard@redhat.com>
* Add a couple more use cases from Baris's original proposal.
* Remove the restriction on DW_OP_reinterpret that it can only be used
    on base types. This was alwasys the intent but I accidently left
    that verbiage in the proposal.
* Add an example

Signed-off-by: Ben Woodard <woodard@redhat.com>
@woodard woodard marked this pull request as draft January 22, 2026 22:33
Comment on lines +13 to +14
number. However, if due to optimization that variable is moved into a
80b extended precision register for a block of PCs. If a consumer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sentence sounds broken. How about this:
"However, due to optimization, the variable may be moved into an 80b extended precision register for a range of PCs."

manually. A programmer may not know to do this or know how to do
this. It also is a very cumbersome work around.

A better option is to address this situation is to have the producer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"is to" -> "to"

Comment on lines +79 to +80
having the actual known type which is known by the producer makes this
simpler.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, vtable may not always exist (e.g. for POD classes).

### Derived types

One example could be when a compiler knows the type more precisely
than the variable's type natively idicates. For eample: `BaseV *bv2 =
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: idicates

simpler.

It also allows a consumer handle situations which are currently not
handled such as `(gdb) p func( *bv2)` when `int func(Derived arg);`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No space needed in ( *bv2).

### void pointers with known types

Another potential use is to give the objects pointed to by void
pointers their type. For example given `int x;void *generic=&x` the
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after int x;.

moved from system memory to GPU memory by an optimization, the
consumer will need to know that the size of the pointer has changed
from 8 bytes to 4 bytes when accessing it.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another interesting example is the function type change described here:
https://lists.dwarfstd.org/pipermail/dwarf-discuss/2026-January/002789.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant