class InheritancePath

Defined at line 29 of file ../../src/developer/debug/zxdb/symbols/inheritance_path.h

Represents a path of inheritance from one class to another.

When one class derives from another, the base classes become effectively a member of the derived

class. This represents a chain of such inheritance.

Virtual inheritance makes things more complicated. When there is virtual inheritance, a base

class doesn't live at a predefined offset but rather the compiler stores some way to find the

base class. This allows the offset to vary according to what the current object hierarchy looks

like. In this case, there is a DWARF express that must be evaluated that reads class memory to

compute the offset.

Virtual inheritance is uncommon so most hierarchies can be represented by a simple offset of one

class within another.

Public Members

vector path_
static const size_t kToEnd

Public Methods

void InheritancePath (fxl::RefPtr<Collection> derived, fxl::RefPtr<InheritedFrom> from, fxl::RefPtr<Collection> base)

Encodes a single level of inheritance from "derived" to "base".

Defined at line 11 of file ../../src/developer/debug/zxdb/symbols/inheritance_path.cc

std::optional<uint32_t> BaseOffsetInDerived ()

If possible, returns the offset of the oldest base class "path().back()" from the derived class

"path()[0]". As described in the class-level comment above, this will work as long as there is

no virtual inheritance. If there is virtual inheritance, this will return nullopt.

Defined at line 17 of file ../../src/developer/debug/zxdb/symbols/inheritance_path.cc

InheritancePath SubPath (size_t begin_index, size_t len)

Defined at line 30 of file ../../src/developer/debug/zxdb/symbols/inheritance_path.cc

void InheritancePath ()

Defined at line 54 of file ../../src/developer/debug/zxdb/symbols/inheritance_path.h

void InheritancePath (fxl::RefPtr<Collection> collection)

To just supply one class and not inhertance information.

Defined at line 57 of file ../../src/developer/debug/zxdb/symbols/inheritance_path.h

void InheritancePath (std::initializer_list<Step> steps)

For a full path.

Defined at line 64 of file ../../src/developer/debug/zxdb/symbols/inheritance_path.h

PathVector & path ()

The inheritance path. The derived class will be at path().front() and the base class will be

at path().back(). The intermediate classes to get from one to the other will be sequenced

in-between:

( Derived class = path[0].collection ) ----( path[1].from )----

( Intermediate class = path[1].collection ) ----( path[2].from )----

( Base class = path[2].collection )

Defined at line 78 of file ../../src/developer/debug/zxdb/symbols/inheritance_path.h

const PathVector & path ()

Defined at line 79 of file ../../src/developer/debug/zxdb/symbols/inheritance_path.h

const Collection * derived ()

The "derived" is the more specific end (the one deriving from the other classes).

Defined at line 86 of file ../../src/developer/debug/zxdb/symbols/inheritance_path.h

const fxl::RefPtr<Collection> derived_ref ()

Defined at line 87 of file ../../src/developer/debug/zxdb/symbols/inheritance_path.h

const Collection * base ()

The "base" is the base class of derived that this path represents.

Note that in some cases that may not be a concrete type and you will have to convert it to one

before using.

Defined at line 93 of file ../../src/developer/debug/zxdb/symbols/inheritance_path.h

const fxl::RefPtr<Collection> base_ref ()

Defined at line 94 of file ../../src/developer/debug/zxdb/symbols/inheritance_path.h

bool operator== (const InheritancePath & other)

Defined at line 96 of file ../../src/developer/debug/zxdb/symbols/inheritance_path.h

bool operator!= (const InheritancePath & other)

Defined at line 97 of file ../../src/developer/debug/zxdb/symbols/inheritance_path.h

Records