Skip to content

NonZero is not debugable in gdb (anonymous fields can't be accessed) #21948

Closed
@Manishearth

Description

@Manishearth

Servo recently switched to NonZero for its smart pointers. This means that our JS structs of the form

struct JSRef<T> {
ptr: *const T,
...
}

became

struct JSRef<T> {
ptr: NonZero<*const T>,
...
}

In the original system, print ref.ptr in gdb would nicely print a typed pointer (something like (struct foo::bar::Baz<Quux>)* 0x12345 IIRC). Now, it gives us simply {0x12345}, and there doesn't seem to be a way to get the inner data out. This is quite annoying since we use these pointers everywhere in the DOM.

The larger issue here I guess is that anonymous fields can't be accessed as an expression in gdb. Perhaps naming them .0, .1 explicitly would work?

cc @michaelwoerister @jdm

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions