From f9c54374f07264f0320eab3dca2d8764813ad8c5 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Wed, 22 Mar 2017 15:49:09 +0100 Subject: CV2PDB: keep track of the default lower bound for the curret unit --- src/cv2pdb.h | 4 ++++ src/dwarf2pdb.cpp | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/cv2pdb.h b/src/cv2pdb.h index a0af159..46f9459 100644 --- a/src/cv2pdb.h +++ b/src/cv2pdb.h @@ -268,6 +268,10 @@ public: int codeSegOff; std::unordered_map mapOffsetToType; + // Default lower bound for the current compilation unit. This depends on + // the language of the current unit. + unsigned currentDefaultLowerBound; + // Value of the DW_AT_low_pc attribute for the current compilation unit. // Specify the default base address for use in location lists and range // lists. diff --git a/src/dwarf2pdb.cpp b/src/dwarf2pdb.cpp index abc7ee0..221e8af 100644 --- a/src/dwarf2pdb.cpp +++ b/src/dwarf2pdb.cpp @@ -1275,6 +1275,24 @@ bool CV2PDB::createTypes() case DW_TAG_compile_unit: currentBaseAddress = id.pclo; + switch (id.language) + { + case DW_LANG_Ada83: + case DW_LANG_Cobol74: + case DW_LANG_Cobol85: + case DW_LANG_Fortran77: + case DW_LANG_Fortran90: + case DW_LANG_Pascal83: + case DW_LANG_Modula2: + case DW_LANG_Ada95: + case DW_LANG_Fortran95: + case DW_LANG_PLI: + currentDefaultLowerBound = 1; + break; + + default: + currentDefaultLowerBound = 0; + } #if !FULL_CONTRIB if (id.dir && id.name) { -- cgit v0.12