summaryrefslogtreecommitdiffstats
path: root/src/dwarflines.cpp
diff options
context:
space:
mode:
authorRainer Schuetze <r.sagitario@gmx.de>2022-05-11 16:48:20 (GMT)
committerRainer Schuetze <r.sagitario@gmx.de>2022-05-11 16:48:20 (GMT)
commitf390ed4c0aef0f0acd3f880c82564558bc2e0786 (patch)
tree0f841ecca8a8e8d112db27af808476053c285630 /src/dwarflines.cpp
parentfa6f0ac076a42dfda3a78a7da3be4f004f862dd3 (diff)
downloadcv2pdb-f390ed4c0aef0f0acd3f880c82564558bc2e0786.zip
cv2pdb-f390ed4c0aef0f0acd3f880c82564558bc2e0786.tar.gz
cv2pdb-f390ed4c0aef0f0acd3f880c82564558bc2e0786.tar.bz2
fix issue #76: Invalid form=11 for directory index
support DW_FORM_data1 and DW_FORM_data2 in DW_LNCT_directory_index
Diffstat (limited to 'src/dwarflines.cpp')
-rw-r--r--src/dwarflines.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/dwarflines.cpp b/src/dwarflines.cpp
index 11380ae..4f904ec 100644
--- a/src/dwarflines.cpp
+++ b/src/dwarflines.cpp
@@ -307,7 +307,6 @@ bool interpretDWARFLines(const PEImage& img, mspdb::Mod* mod, DebugLevel debug_)
default:
fprintf(stderr, "%s:%d: ERROR: invalid form=%d for path lineHdrOffs=%x\n", __FUNCTION__, __LINE__,
typeForm.form, off);
-
return false;
}
@@ -327,7 +326,6 @@ bool interpretDWARFLines(const PEImage& img, mspdb::Mod* mod, DebugLevel debug_)
default:
fprintf(stderr, "%s:%d: ERROR: unexpected type=%d form=%d for directory path lineHdrOffs=%x\n", __FUNCTION__, __LINE__,
typeForm.type, typeForm.form, off);
-
return false;
}
}
@@ -367,8 +365,6 @@ bool interpretDWARFLines(const PEImage& img, mspdb::Mod* mod, DebugLevel debug_)
default:
fprintf(stderr, "%s:%d: ERROR: invalid form=%d for path lineHdrOffs=%x\n", __FUNCTION__, __LINE__,
typeForm.form, off);
-
-
assert(false, "invalid path form");
return false;
}
@@ -377,15 +373,20 @@ bool interpretDWARFLines(const PEImage& img, mspdb::Mod* mod, DebugLevel debug_)
// bias the directory index by 1 since _flushDWARFLines
// will check for 0 and subtract one (which is
// useful for DWARF4).
- if (typeForm.form == DW_FORM_udata)
+ switch (typeForm.form)
{
+ case DW_FORM_data1:
+ fname.dir_index = *p++ + 1;
+ break;
+ case DW_FORM_data2:
+ fname.dir_index = RD2(p) + 1;
+ break;
+ case DW_FORM_udata:
fname.dir_index = LEB128(p) + 1;
- }
- else
- {
+ break;
+ default:
fprintf(stderr, "%s:%d: ERROR: invalid form=%d for directory index lineHdrOffs=%x\n", __FUNCTION__, __LINE__,
typeForm.form, off);
-
return false;
}
break;
@@ -394,7 +395,6 @@ bool interpretDWARFLines(const PEImage& img, mspdb::Mod* mod, DebugLevel debug_)
default:
fprintf(stderr, "%s:%d: ERROR: unexpected type=%d form=%d for file path lineHdrOffs=%x\n", __FUNCTION__, __LINE__,
typeForm.type, typeForm.form, off);
-
return false;
}
}