DWARFDebugInfo only knows how to resolve references in its own file, but in split dwarf, the index entries will refer to DIEs in the separate (DWO) file. To resolve the DIERef correctly we'd either need to go through the SymbolFileDWARF to get the full logic for resolving a DIERef, or use the fact that ToDIERef already looks up the correct unit while computing its result. This patch does the latter. This bug manifested itself in not being able to find type definitions for types in namespaces, so I've modified one of our type resolving test cases to run with debug_names, and added a namespaced class into it (it originally contained only a top-level class).
37 lines
525 B
C++
37 lines
525 B
C++
#include "base.h"
|
|
|
|
class Foo : public FooBase {
|
|
public:
|
|
Foo();
|
|
|
|
// Deliberately defined by hand.
|
|
Foo &operator=(const Foo &rhs) {
|
|
x = rhs.x; // break1
|
|
a = rhs.a;
|
|
return *this;
|
|
}
|
|
int a;
|
|
};
|
|
|
|
namespace ns {
|
|
class Foo2 : public Foo2Base {
|
|
public:
|
|
Foo2();
|
|
|
|
// Deliberately defined by hand.
|
|
Foo2 &operator=(const Foo2 &rhs) {
|
|
x = rhs.x; // break2
|
|
a = rhs.a;
|
|
return *this;
|
|
}
|
|
|
|
int a;
|
|
};
|
|
} // namespace ns
|
|
|
|
extern Foo foo1;
|
|
extern Foo foo2;
|
|
|
|
extern ns::Foo2 foo2_1;
|
|
extern ns::Foo2 foo2_2;
|