diff options
author | Rainer Schuetze <r.sagitario@gmx.de> | 2023-04-02 09:41:41 (GMT) |
---|---|---|
committer | Rainer Schuetze <r.sagitario@gmx.de> | 2023-04-02 09:41:41 (GMT) |
commit | da6546c45efdbf53f796192d1b65c5557d1f1882 (patch) | |
tree | 0cb68146fffe1667996e666b2f9c3576afe80098 | |
parent | 4d9596ce98097f817700948a90daa3e8b150ed9b (diff) | |
download | cv2pdb-da6546c45efdbf53f796192d1b65c5557d1f1882.zip cv2pdb-da6546c45efdbf53f796192d1b65c5557d1f1882.tar.gz cv2pdb-da6546c45efdbf53f796192d1b65c5557d1f1882.tar.bz2 |
move mergeAbstractOrigin() and mergeSpecification() from readDwarf.cpp to dwarf2pdb.cpp, so they don't create a dependency for dumplines.exe
-rw-r--r-- | src/dwarf2pdb.cpp | 50 | ||||
-rw-r--r-- | src/readDwarf.cpp | 48 | ||||
-rw-r--r-- | src/readDwarf.h | 3 |
3 files changed, 50 insertions, 51 deletions
diff --git a/src/dwarf2pdb.cpp b/src/dwarf2pdb.cpp index b65d73d..c46ab32 100644 --- a/src/dwarf2pdb.cpp +++ b/src/dwarf2pdb.cpp @@ -786,6 +786,56 @@ void CV2PDB::formatFullyQualifiedName(const DWARF_InfoData* node, char* buf, siz }
}
+void mergeSpecification(DWARF_InfoData& id, const CV2PDB& context);
+
+// Find the source of an inlined function by following its 'abstract_origin'
+// attribute references and recursively merge it into 'id'.
+// TODO: this description isn't quite right. See section 3.3.8.1 in DWARF 4 spec.
+void mergeAbstractOrigin(DWARF_InfoData& id, const CV2PDB& context)
+{
+ DWARF_InfoData* abstractOrigin = context.findEntryByPtr(id.abstract_origin);
+ if (!abstractOrigin) {
+ // Could not find abstract origin. Why not?
+ assert(false);
+ return;
+ }
+
+ // assert seems invalid, combination DW_TAG_member and DW_TAG_variable found
+ // in the wild.
+ //
+ // assert(id.tag == idspec.tag);
+
+ if (abstractOrigin->abstract_origin)
+ mergeAbstractOrigin(*abstractOrigin, context);
+ if (abstractOrigin->specification)
+ mergeSpecification(*abstractOrigin, context);
+ id.merge(*abstractOrigin);
+}
+
+// Find the declaration entry for a definition by following its 'specification'
+// attribute references and merge it into 'id'.
+void mergeSpecification(DWARF_InfoData& id, const CV2PDB& context)
+{
+ DWARF_InfoData* idspec = context.findEntryByPtr(id.specification);
+ if (!idspec) {
+ // Could not find decl for this definition. Why not?
+ assert(false);
+ return;
+ }
+
+ // assert seems invalid, combination DW_TAG_member and DW_TAG_variable found
+ // in the wild.
+ //
+ // assert(id.tag == idspec.tag);
+
+ if (idspec->abstract_origin)
+ mergeAbstractOrigin(*idspec, context);
+ if (idspec->specification) {
+ mergeSpecification(*idspec, context);
+ }
+ id.merge(*idspec);
+}
+
bool CV2PDB::addDWARFProc(DWARF_InfoData& procid, const std::vector<RangeEntry> &ranges, DIECursor cursor)
{
unsigned int pclo = ranges.front().pclo - codeSegOff;
diff --git a/src/readDwarf.cpp b/src/readDwarf.cpp index 6562980..e6f187c 100644 --- a/src/readDwarf.cpp +++ b/src/readDwarf.cpp @@ -363,54 +363,6 @@ Location decodeLocation(const DWARF_Attribute& attr, const Location* frameBase, return stack[0];
}
-// Find the source of an inlined function by following its 'abstract_origin'
-// attribute references and recursively merge it into 'id'.
-// TODO: this description isn't quite right. See section 3.3.8.1 in DWARF 4 spec.
-void mergeAbstractOrigin(DWARF_InfoData& id, const CV2PDB& context)
-{
- DWARF_InfoData* abstractOrigin = context.findEntryByPtr(id.abstract_origin);
- if (!abstractOrigin) {
- // Could not find abstract origin. Why not?
- assert(false);
- return;
- }
-
- // assert seems invalid, combination DW_TAG_member and DW_TAG_variable found
- // in the wild.
- //
- // assert(id.tag == idspec.tag);
-
- if (abstractOrigin->abstract_origin)
- mergeAbstractOrigin(*abstractOrigin, context);
- if (abstractOrigin->specification)
- mergeSpecification(*abstractOrigin, context);
- id.merge(*abstractOrigin);
-}
-
-// Find the declaration entry for a definition by following its 'specification'
-// attribute references and merge it into 'id'.
-void mergeSpecification(DWARF_InfoData& id, const CV2PDB& context)
-{
- DWARF_InfoData* idspec = context.findEntryByPtr(id.specification);
- if (!idspec) {
- // Could not find decl for this definition. Why not?
- assert(false);
- return;
- }
-
- // assert seems invalid, combination DW_TAG_member and DW_TAG_variable found
- // in the wild.
- //
- // assert(id.tag == idspec.tag);
-
- if (idspec->abstract_origin)
- mergeAbstractOrigin(*idspec, context);
- if (idspec->specification) {
- mergeSpecification(*idspec, context);
- }
- id.merge(*idspec);
-}
-
LOCCursor::LOCCursor(const DIECursor& parent, unsigned long off)
: parent(parent)
{
diff --git a/src/readDwarf.h b/src/readDwarf.h index 4b0ac98..b4f2f85 100644 --- a/src/readDwarf.h +++ b/src/readDwarf.h @@ -547,9 +547,6 @@ typedef std::unordered_map<std::pair<unsigned, unsigned>, byte*> abbrevMap_t; // as either an absolute value, a register, or a register-relative address.
Location decodeLocation(const DWARF_Attribute& attr, const Location* frameBase = 0, int at = 0);
-void mergeAbstractOrigin(DWARF_InfoData& id, const CV2PDB& context);
-void mergeSpecification(DWARF_InfoData& id, const CV2PDB& context);
-
// Debug Information Entry Cursor
class DIECursor
{
|