From 96e74de0219c7d559d8f5706e88e30f37c2a2cf8 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Tue, 25 Apr 2017 15:10:36 +0200 Subject: Fix handling of discontinuous address ranges on X64 --- src/dwarf2pdb.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/dwarf2pdb.cpp b/src/dwarf2pdb.cpp index 65f9803..b2c5afa 100644 --- a/src/dwarf2pdb.cpp +++ b/src/dwarf2pdb.cpp @@ -789,10 +789,21 @@ bool CV2PDB::addDWARFProc(DWARF_InfoData& procid, DWARF_CompilationUnit* cu, DIE // TODO: handle base address selection byte *r = (byte *)img.debug_ranges + id.ranges; byte *rend = (byte *)img.debug_ranges + img.debug_ranges_length; + bool is_= img.isX64() ? 8 : 4; while (r < rend) { - uint32_t pclo = RD4(r); - uint32_t pchi = RD4(r); + uint64_t pclo, pchi; + + if (img.isX64()) + { + pclo = RD8(r); + pchi = RD8(r); + } + else + { + pclo = RD4(r); + pchi = RD4(r); + } if (pclo == 0 && pchi == 0) break; if (pclo >= pchi) -- cgit v0.12