Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,23 @@ unreleased Version 0.3.41
- module list now shows x64 addresses correctly
- verboser output for DLL load/unload
- implement "set next statement"
- callstack: parameter list alo showed locals
- callstack: parameter list also showed locals
- disassembly: show symbols, address labels
- fix dstring display
- can list associative array members (needs
https://github.com/D-Programming-Language/dmd/pull/4473 for Win64)
- show exception number for Win32 exceptions
- can now load PDB symbols from Microsoft Symbol Server or local
cache folders
- now support lexical scope blocks (helps C++ and D with
https://github.com/D-Programming-Language/dmd/pull/2867)
* cv2pdb:
- improvements for DWARF conversion
* dparser updated to c89aa45334b8c768559bc243da73b87c518a9a58 with support for new
* dparser updated to cf26dbe426b10957f6364313cc7121e41083bebe with support for new
language features in dmd 2.067
* some initial support for finding symbol references
* new linker option "build and use local phobos library" to get a COFF32 version (dmd 2.067+)
or add missing debug info (dmd 2.065+)
* renaming project configuration did not change respective config on all platforms
* workaround for link response file with spaces, but disabled short names on NTFS volume
* profiler window: non-D symbols (e.g. C++ mangled functions) are no longer displayed empty
11 changes: 7 additions & 4 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,15 @@ Debugger:
---------------
Any/dmd:
- stepping through function call jumps to default assignment
- bad line info for scope(exit), for increment expression, constants
- arguments to local functions treated as locals
- local functions/delegates should have debug info for closure vars ("this" exists)
- extern(D) function arguments shown in the wrong order
- support GDC+mago
- bugzilla 14286: x64: no type information for dAssocArray
+ bugzilla 14286: x64: no type information for dAssocArray
- bugzilla 4014: no debug info from libraries


Mago:
- show derived class
- step after exception
Expand All @@ -150,14 +152,15 @@ Mago:
- identically named locals show the same value
+ dstring shows as uint[] without string representation
- string/wstring shown as char/wchar[], but with correct string representation
- AA indexing
- AA preview/expand
+ AA indexing
+ AA preview/expand
- Array preview
- delegate value/type
- struct preview
+ verboser output when loading/unloading DLLs
- attach to process
- hardware breakpoints
+ does not work with variable scope

VS:
- VS2012: autoexp.dat does not work? depends on debug engine => edit and continue
Expand Down Expand Up @@ -200,7 +203,7 @@ Unsorted
- configuration of dependent project not read from configuration manager
+ jump to assertion error
+ import std.container: jump to package
- renaming configuration does not change project config
+ renaming configuration does not change project config
+ win32coff support
- file search: replace . with \ in path search?
+ run cv2pdb disabled for GDC/x64
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#define VERSION_MINOR 3
#define VERSION_REVISION 41
#define VERSION_BETA -beta
#define VERSION_BUILD 1
#define VERSION_BUILD 2
11 changes: 7 additions & 4 deletions doc/CppConversion.dd
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ class C {
static int x;
DECL *foo(int flags = 0);
};
int C::x = 3;
// moved with the implementation
DECL *C::foo(int flags) { return NULL; }
,
struct C {
// comments are usually kept
Expand Down Expand Up @@ -144,7 +147,7 @@ int foo() {
Ident id = (op == kEnum) ? 0 : 1;
}
,
enum unnamed_1 { e1$_j e2 }alias unnamed_1 EX;
enum unnamed_1 { e1$(_j) e2 }alias unnamed_1 EX;
enum ENUM { kEnum };
int foo() {
Ident id = (op == ENUM.kEnum) ? 0 : 1;
Expand All @@ -157,14 +160,14 @@ template<typename TYPE>
struct ArrayBase : Array {
TYPE* data;
};
template<typename S$_j class T>
double foo(S s$_j T t) { return s+t; }
template<typename S$(_j) class T>
double foo(S s$(_j) T t) { return s+t; }
,
class ArrayBase( TYPE) : Array {
TYPE* data;
};

double foo( S$_j T)(S s$_j T t) { return s+t; }
double foo( S$(_j) T)(S s$(_j) T t) { return s+t; }
)

Preprocessor macros are converted to enum, alias or templates
Expand Down
2 changes: 1 addition & 1 deletion vdc/abothe/Parser
Submodule Parser updated 42 files
+2 −2 DParser2/Completion/CodeCompletion.cs
+10 −3 DParser2/Completion/MemberCompletionEnumeration.cs
+1 −1 DParser2/Completion/ParameterInsightResolution.cs
+1 −1 DParser2/Completion/Providers/ImportStatementCompletionProvider.cs
+1 −1 DParser2/Completion/Providers/SelectiveImportCompletionProvider.cs
+1 −0 DParser2/DParser2.csproj
+4 −55 DParser2/Dom/ModulePackage.cs
+11 −15 DParser2/Dom/Visitors/AstElementHashingVisitor.cs
+5 −0 DParser2/Misc/CompletionOptions.cs
+0 −1 DParser2/Misc/GlobalParseCache.cs
+25 −89 DParser2/Misc/ParseCacheView.cs
+10 −24 DParser2/Refactoring/ReferencesFinder.cs
+1 −1 DParser2/Refactoring/TypeReferenceFinder.cs
+88 −72 DParser2/Resolver/ASTScanner/AbstractVisitor.cs
+2 −2 DParser2/Resolver/ASTScanner/NameScan.cs
+7 −1 DParser2/Resolver/Caching/ResolutionCache.cs
+4 −3 DParser2/Resolver/DTypeToCodeVisitor.cs
+0 −1 DParser2/Resolver/DTypeToTypeDeclVisitor.cs
+1 −0 DParser2/Resolver/ExpressionSemantics/CTFE/FunctionEvaluation.cs
+0 −2 DParser2/Resolver/ExpressionSemantics/Evaluation.Identifiers.cs
+14 −25 DParser2/Resolver/ExpressionSemantics/Evaluation.OperandExpressions.cs
+0 −1 DParser2/Resolver/ExpressionSemantics/Evaluation.PostfixExpressions.cs
+2 −2 DParser2/Resolver/ExpressionSemantics/Evaluation.PrimaryExpression.cs
+25 −4 DParser2/Resolver/ExpressionSemantics/Evaluation.cs
+17 −13 DParser2/Resolver/ExpressionSemantics/ExpressionTypeEvaluation.cs
+3 −6 DParser2/Resolver/ExpressionSemantics/ISymbolValueProvider.cs
+5 −8 DParser2/Resolver/ExpressionSemantics/LeftValues.cs
+6 −0 DParser2/Resolver/ResolutionContext.cs
+10 −0 DParser2/Resolver/ResolutionError.cs
+242 −0 DParser2/Resolver/TypeResolution/LooseResolution.cs
+20 −188 DParser2/Resolver/TypeResolution/Resolver.cs
+17 −10 DParser2/Resolver/TypeResolution/TypeDeclarationResolver.cs
+1 −1 DParser2/Resolver/TypeResolution/UFCSResolver.cs
+3 −3 ExaustiveCompletionTester/CompletionFacilities.cs
+2 −2 TestTool/BotanProfil.cs
+6 −2 TestTool/Program.cs
+16 −12 Tests/CompletionTests.cs
+9 −9 Tests/EvaluationTests.cs
+4 −4 Tests/ImplicitConversionTests.cs
+5 −5 Tests/ParseTests.cs
+4 −3 Tests/ReferenceFinding.cs
+206 −78 Tests/ResolutionTests.cs
150 changes: 117 additions & 33 deletions vdc/abothe/comserver/VDServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,47 @@ protected override void AppendFormat (string content, StringBuilder sb, FormatFl
sb.Append (content);
//base.AppendFormat (content, sb, flags, r, g, b);
}
}
}

public class VDserverParseCacheView : ParseCacheView
{
#region Properties
readonly List<RootPackage> packs;
#endregion

#region Constructors
public VDserverParseCacheView(IEnumerable<string> packageRoots)
{
this.packs = new List<RootPackage>();
Add(packageRoots);
}

public VDserverParseCacheView(IEnumerable<RootPackage> packages)
{
this.packs = new List<RootPackage>(packages);
}
#endregion

public override IEnumerable<RootPackage> EnumRootPackagesSurroundingModule(DModule module)
{
return packs;
}

public void Add(RootPackage pack)
{
if (pack != null && !packs.Contains(pack))
packs.Add(pack);
}

public void Add(IEnumerable<string> roots)
{
RootPackage rp;
foreach (var r in roots)
if ((rp = GlobalParseCache.GetRootPackage(r)) != null && !packs.Contains(rp))
packs.Add(rp);
}
}



[ComVisible(true), Guid(IID.VDServer)]
[ClassInterface(ClassInterfaceType.None)]
Expand Down Expand Up @@ -100,14 +138,52 @@ public DModule GetModule(string fileName)
public VDServer()
{
// MessageBox.Show("VDServer()");
}

public void ConfigureSemanticProject(string filename, string imp, string stringImp, string versionids, string debugids, uint flags)
}

private static string normalizePath(string path)
{
path = Path.GetFullPath(path);
return path.ToLower();
}

private static string normalizeDir(string dir)
{
dir = normalizePath(dir);
if (!dir.EndsWith("\\"))
dir += '\\';
return dir;
}

private string[] uniqueDirectories(string imp)
{
var impDirs = imp.Split('\n');
string[] normDirs = new string[impDirs.Length];
for (int i = 0; i < impDirs.Length; i++)
normDirs[i] = normalizeDir(impDirs[i]);

string[] uniqueDirs = new string[impDirs.Length];
int unique = 0;
for (int i = 0; i < normDirs.Length; i++)
{
int j;
for (j = 0; j < normDirs.Length; j++)
if (i != j && normDirs[i].StartsWith(normDirs[j]))
if (normDirs[i] != normDirs[j] || j < i)
break;
if (j >= normDirs.Length)
uniqueDirs[unique++] = normDirs[i];
}

Array.Resize(ref uniqueDirs, unique);
return uniqueDirs;
}

public void ConfigureSemanticProject(string filename, string imp, string stringImp, string versionids, string debugids, uint flags)
{
if (_imports != imp)
{
var impDirs = imp.Split('\n');
GlobalParseCache.BeginAddOrUpdatePaths(impDirs);
{
string[] uniqueDirs = uniqueDirectories(imp);
GlobalParseCache.BeginAddOrUpdatePaths(uniqueDirs);
}
_imports = imp;
_stringImports = stringImp;
Expand All @@ -124,7 +200,8 @@ public void ClearSemanticProject()
//throw new NotImplementedException();
}
public void UpdateModule(string filename, string srcText, bool verbose)
{
{
filename = normalizePath(filename);
DModule ast;
try
{
Expand Down Expand Up @@ -159,8 +236,9 @@ static int getCodeOffset(string s, CodeLocation loc)
}

public void GetTip(string filename, int startLine, int startIndex, int endLine, int endIndex)
{
var ast = GetModule(filename);
{
filename = normalizePath(filename);
var ast = GetModule(filename);

if (ast == null)
throw new COMException("module not found", 1);
Expand All @@ -176,14 +254,14 @@ public void GetTip(string filename, int startLine, int startIndex, int endLine,
// codeOffset+1 because otherwise it does not work on the first character
_editorData.CaretOffset = getCodeOffset(_editorData.ModuleCode, _tipStart) + 1;

ISyntaxRegion sr;
DResolver.NodeResolutionAttempt attempt;
var types = DResolver.ResolveTypeLoosely(_editorData, out attempt, out sr);
ISyntaxRegion sr = DResolver.GetScopedCodeObject(_editorData);
LooseResolution.NodeResolutionAttempt attempt;
var types = sr != null ? LooseResolution.ResolveTypeLoosely(_editorData, sr, out attempt) : null;

_tipText.Clear();

if (types != null)
{
{
if (sr != null)
{
_tipStart = sr.Location;
Expand Down Expand Up @@ -220,8 +298,9 @@ public void GetTipResult(out int startLine, out int startIndex, out int endLine,
}

public void GetSemanticExpansions(string filename, string tok, uint line, uint idx, string expr)
{
var ast = GetModule(filename);
{
filename = normalizePath(filename);
var ast = GetModule(filename);

if (ast == null)
throw new COMException("module not found", 1);
Expand Down Expand Up @@ -254,8 +333,9 @@ public void GetSemanticExpansionsResult(out string stringList)
}

public void GetParseErrors(string filename, out string errors)
{
var ast = GetModule(filename);
{
filename = normalizePath(filename);
var ast = GetModule(filename);

if (ast == null)
throw new COMException("module not found", 1);
Expand All @@ -276,6 +356,7 @@ public void GetParseErrors(string filename, out string errors)

public void IsBinaryOperator(string filename, uint startLine, uint startIndex, uint endLine, uint endIndex, out bool pIsOp)
{
filename = normalizePath(filename);
var ast = GetModule(filename);

if (ast == null)
Expand All @@ -299,8 +380,9 @@ public void GetLastMessage(out string message)
}

public void GetDefinition(string filename, int startLine, int startIndex, int endLine, int endIndex)
{
var ast = GetModule(filename);
{
filename = normalizePath(filename);
var ast = GetModule(filename);

if (ast == null)
throw new COMException("module not found", 1);
Expand All @@ -314,11 +396,11 @@ public void GetDefinition(string filename, int startLine, int startIndex, int en
_editorData.SyntaxTree = ast as DModule;
_editorData.ModuleCode = _sources[filename];
// codeOffset+1 because otherwise it does not work on the first character
_editorData.CaretOffset = getCodeOffset(_editorData.ModuleCode, _tipStart) + 2;

ISyntaxRegion sr;
DResolver.NodeResolutionAttempt attempt;
var rr = DResolver.ResolveTypeLoosely(_editorData, out attempt, out sr);
_editorData.CaretOffset = getCodeOffset(_editorData.ModuleCode, _tipStart) + 2;
ISyntaxRegion sr = DResolver.GetScopedCodeObject(_editorData);
LooseResolution.NodeResolutionAttempt attempt;
var rr = sr != null ? LooseResolution.ResolveTypeLoosely(_editorData, sr, out attempt) : null;

_tipText.Clear();
if (rr != null)
Expand Down Expand Up @@ -355,6 +437,7 @@ public void GetDefinitionResult(out int startLine, out int startIndex, out int e

public void GetReferences(string filename, string tok, uint line, uint idx, string expr)
{
filename = normalizePath(filename);
var ast = GetModule(filename);

if (ast == null)
Expand All @@ -369,9 +452,9 @@ public void GetReferences(string filename, string tok, uint line, uint idx, stri

_references = null;

ISyntaxRegion sr;
DResolver.NodeResolutionAttempt attempt;
var rr = DResolver.ResolveTypeLoosely(_editorData, out attempt, out sr);
ISyntaxRegion sr = DResolver.GetScopedCodeObject(_editorData);
LooseResolution.NodeResolutionAttempt attempt;
var rr = sr != null ? LooseResolution.ResolveTypeLoosely(_editorData, sr, out attempt) : null;

StringBuilder refs = new StringBuilder();
if (rr != null)
Expand Down Expand Up @@ -399,7 +482,7 @@ public void GetReferences(string filename, string tok, uint line, uint idx, stri

private static void GetReferencesInModule(DModule ast, StringBuilder refs, DNode n, ResolutionContext ctxt)
{
var res = ReferencesFinder.Scan(ast, n, ctxt);
var res = ReferencesFinder.SearchModuleForASTNodeReferences(ast, n, ctxt);

int cnt = res.Count();
foreach (var r in res)
Expand Down Expand Up @@ -439,9 +522,10 @@ void _setupEditorData()
if ((_flags & 64) != 0)
versions += "GNU\n";
else
versions += "DigitalMars\n";

_editorData.ParseCache = new ParseCacheView(_imports.Split('\n'));
versions += "DigitalMars\n";

string[] uniqueDirs = uniqueDirectories(_imports);
_editorData.ParseCache = new VDserverParseCacheView(uniqueDirs);
_editorData.IsDebug = (_flags & 2) != 0;
_editorData.DebugLevel = (_flags >> 16) & 0xff;
_editorData.VersionNumber = (_flags >> 8) & 0xff;
Expand Down
Loading