summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES6
-rw-r--r--Makefile7
-rw-r--r--VERSION2
-rw-r--r--src/cv2pdb.cpp8
-rw-r--r--test/cvtest.d83
5 files changed, 80 insertions, 26 deletions
diff --git a/CHANGES b/CHANGES
index f43678d..f194f15 100644
--- a/CHANGES
+++ b/CHANGES
@@ -238,5 +238,9 @@ unreleased Version 0.22
* allow anonymous typedefs
* cv2pdb now builds as x64 application
* truncate symbols that are to long
- * do not uncompress names in field lists
+ * better support for symbols that contain non-ascii characters: do not uncompress names in field lists
* copy symbol unmodified if uncompression fails
+
+2017-01-20 Version 0.39
+
+ * do not assume sorted line numbers per segment
diff --git a/Makefile b/Makefile
index 28b068b..8703ae4 100644
--- a/Makefile
+++ b/Makefile
@@ -81,3 +81,10 @@ IDEDIR = $(VSINSTALLDIR)\Common7\IDE
$(BIN): $(SRC) $(ADD) $(TEST) VERSION
if exist "$(IDEDIR)\VCExpress.exe" "$(IDEDIR)\VCExpress.exe" /Build Release src\cv2pdb.sln
if not exist "$(IDEDIR)\VCExpress.exe" "$(IDEDIR)\devenv.exe" /Build Release src\cv2pdb.sln
+
+###############################
+cv2pdb_exe:
+ devenv /Project "cv2pdb" /Build "Release|Win32" src\cv2pdb_vs12.sln
+
+test: cv2pdb_exe
+ cd ..\test && nmake test
diff --git a/VERSION b/VERSION
index 8e95da0..14c67f2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-VERSION = 0.38
+VERSION = 0.39
diff --git a/src/cv2pdb.cpp b/src/cv2pdb.cpp
index 4208f3f..c95d409 100644
--- a/src/cv2pdb.cpp
+++ b/src/cv2pdb.cpp
@@ -2659,13 +2659,17 @@ bool CV2PDB::addSrcLines()
int segend = getNextSrcLine(seg, sourceLine->offset[cnt-1]);
int seglength = (segend >= 0 ? segend - 1 - segoff : lnSegStartEnd[2*s + 1] - segoff);
+ int lineMin = lineNo[0];
+ for (int ln = 1; ln < cnt; ln++)
+ if (lineMin > lineNo[ln])
+ lineMin = lineNo[ln];
mspdb::LineInfoEntry* lineInfo = new mspdb::LineInfoEntry[cnt];
for (int ln = 0; ln < cnt; ln++)
{
lineInfo[ln].offset = sourceLine->offset[ln] - segoff;
- lineInfo[ln].line = lineNo[ln] - lineNo[0];
+ lineInfo[ln].line = lineNo[ln] - lineMin;
}
- int rc = mod->AddLines(name, seg, segoff, seglength, segoff, lineNo[0],
+ int rc = mod->AddLines(name, seg, segoff, seglength, segoff, lineMin,
(unsigned char*) lineInfo, cnt * sizeof(*lineInfo));
if (rc <= 0)
return setError("cannot add line number info to module");
diff --git a/test/cvtest.d b/test/cvtest.d
index f99e3e0..f1bd9f5 100644
--- a/test/cvtest.d
+++ b/test/cvtest.d
@@ -21,6 +21,7 @@ version(none)
version(all):
import std.string;
import std.stdio;
+import std.range;
///////////////// field types ////////////////////////
// field type LF_ENUMERATE_V1
@@ -80,9 +81,9 @@ class class_method
{
int member = 3;
static int stmember = 2;
- int method()
- {
- return member + stmember + this.member;
+ int method()
+ {
+ return member + stmember + this.member;
}
};
@@ -129,9 +130,9 @@ struct struct_name
int member;
static int static_member;
- int method()
- {
- return member + static_member + this.member;
+ int method()
+ {
+ return member + static_member + this.member;
}
}
@@ -147,7 +148,7 @@ class this_is_a_rather_long_classname_to_test_what_happens_if_the_classname_gets
{
int member;
};
-
+
int longfoo(this_is_a_rather_long_classname_to_test_what_happens_if_the_classname_gets_longer_than_the_limit_imposed_by_the_old_codeview_format_which_limits_the_length_of_names_to_tw0_hundred_and_fifty_five_characters_because_it_uses_pascal_strings_with_a_length_byte_and_chars_appended x)
{
return 1;
@@ -271,12 +272,12 @@ size_t arrays()
{
int[] iarr;
iarr ~= 4;
-
+
void[] varr;
varr = new char[102];
-
+
const void[] cvarr;
-
+
int[7] xarr = [ 1, 2, 3, 4, 5, 6, 7 ];
string[7] sarr = [ "a", "b", "c", "d", "e", "f", "g" ];
wstring[7] wsarr = [ "a", "b", "c", "d", "e", "f", "g" ];
@@ -286,18 +287,56 @@ size_t arrays()
}
size_t lexical_scope()
+/*in
+{
+ int i = 13;
+ int j = 5;
+}*/
+out
+{
+ int i = 42;
+ i++;
+}
+body
{
int[10] arr1;
- for(int i = 0; i < 10; i++)
+ for(int i = 0; i < 5; i++)
arr1[i] = i;
- for(int i = 0; i < 10; i++)
+ foreach(int i; 0..4)
+ arr1[i] += i;
+
+ foreach(int i; iota(0,3))
arr1[i] += i;
foreach(i; "hello")
if(i == 'e')
break;
+ {
+ long i = 7;
+ i = i + 1;
+ }
+
+ while(arr1[5] != 9)
+ {
+ int i = 9;
+ arr1[5] = i;
+ }
+ do
+ {
+ int i = 6;
+ arr1[5] = i;
+ }
+ while(arr1[5] != 6);
+
+ Object obj;
+ with(obj)
+ {
+ int i = 3;
+ i = i + 4;
+ }
+
return arr1.length;
}
@@ -313,7 +352,7 @@ Action convertEnum()
int main2(string[]argv)
{
convertEnum();
-
+
enum_name inst_enum = enum_name.kEnum2;
class_member inst_member = new class_member;
base_class inst_base = new base_class;
@@ -330,29 +369,29 @@ int main2(string[]argv)
this_is_a_rather_long_classname_to_test_what_happens_if_the_classname_gets_longer_than_the_limit_imposed_by_the_old_codeview_format_which_limits_the_length_of_names_to_tw0_hundred_and_fifty_five_characters_because_it_uses_pascal_strings_with_a_length_byte_and_chars_appended long_class_name;
int this_is_a_rather_long_varname_to_test_what_happens_if_the_classname_gets_longer_than_the_limit_imposed_by_the_old_codeview_format_which_limits_the_length_of_names_to_tw0_hundred_and_fifty_five_characters_because_it_uses_pascal_strings_with_a_length_byte_and_chars_appended = 1;
int *plongname = &this_is_a_rather_long_varname_to_test_what_happens_if_the_classname_gets_longer_than_the_limit_imposed_by_the_old_codeview_format_which_limits_the_length_of_names_to_tw0_hundred_and_fifty_five_characters_because_it_uses_pascal_strings_with_a_length_byte_and_chars_appended;
-
+
iface_impl impl = new iface_impl;
iface face = impl;
iface_impl nimpl = cast(iface_impl) face;
-
+
CUnknown unkn = new CUnknown;
IUnknown iunkn = unkn;
// CUnknown nunkn = cast(CUnknown) iunkn;
-
+
FILE stdfile;
inst_member.member1 = 2;
union_name inst_union;
inst_union.float_member = 1;
-
+
int* pointer_int = null;
struct_name* pointer_struct_name = &inst_struct;
class_member* pointer_class_member = &inst_member;
-
+
alias_int_array int_array;
-
+
int[] int_oem_long_dynarray; int_oem_long_dynarray ~= 12;
- int[int] local_oem_int_assoc_array;
+ int[int] local_oem_int_assoc_array;
for (int i = 0; i < 1024; i++)
local_oem_int_assoc_array[i] = 2*i;
@@ -412,7 +451,7 @@ int main(string[]argv)
if(d == f)
d = 0;
assert(2.4 == 2.4f);
-
+
struct ab {
int a;
int b;
@@ -426,7 +465,7 @@ int main(string[]argv)
struc_arr[ab3] = 7;
struc s = { 2, null };
-
+
Templ!(int) templ = new Templ!(int);
int y = templ.foo(3);
version(D2)