Skip to content

Commit 8ec84f8

Browse files
committed
Merge pull request #41 from rainers/master
Visual D 0.3.41 beta3
2 parents 3d7a1a0 + 2719b02 commit 8ec84f8

38 files changed

+898
-314
lines changed

CHANGES

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,10 +717,13 @@ unreleased Version 0.3.41
717717
* cv2pdb:
718718
- improvements for DWARF conversion
719719
* dparser updated to cf26dbe426b10957f6364313cc7121e41083bebe with support for new
720-
language features in dmd 2.067
720+
language features in dmd 2.067 and fixing a number of exceptions
721721
* some initial support for finding symbol references
722722
* new linker option "build and use local phobos library" to get a COFF32 version (dmd 2.067+)
723723
or add missing debug info (dmd 2.065+)
724724
* renaming project configuration did not change respective config on all platforms
725725
* workaround for link response file with spaces, but disabled short names on NTFS volume
726-
* profiler window: non-D symbols (e.g. C++ mangled functions) are no longer displayed empty
726+
* profiler window: non-D symbols (e.g. C++ mangled functions) are no longer displayed empty
727+
* new command "Compile and Disassemble" to show the disassembly of the current file in
728+
the code context window that is automatically synchronized with editor movements
729+

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ mago:
155155
cv2pdb:
156156
cd ..\..\cv2pdb\trunk && devenv /Project "cv2pdb" /Build "Release|Win32" src\cv2pdb_vs12.sln
157157
cd ..\..\cv2pdb\trunk && devenv /Project "dviewhelper" /Build "Release|Win32" src\cv2pdb_vs12.sln
158+
cd ..\..\cv2pdb\trunk && devenv /Project "dumplines" /Build "Release|Win32" src\cv2pdb_vs12.sln
158159

159160
##################################
160161
# create installer

TODO

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Project:
4040
- VS2013: property pages don't follow resize
4141
- custom command: writes build batch to source folder
4242
- VS2013: possible to copy a project item with DnD into the same project again
43+
- saving file while it is being compiled/linked does not force a recompilation
4344

4445
Language service:
4546
-----------------

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
#define VERSION_MINOR 3
33
#define VERSION_REVISION 41
44
#define VERSION_BETA -beta
5-
#define VERSION_BUILD 2
5+
#define VERSION_BUILD 3

doc/CompileCommands.dd

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
Ddoc
2+
3+
$(P There are a number of commands in the Visual D menu that allow you to work with
4+
a single D source file without creating a project.)
5+
6+
$(IMG_CENTER images/compilemenu.png)
7+
8+
$(H2 Compile and Run)
9+
10+
$(P This command will compile the current text window that has the edit focus. Compile options
11+
are taken from the active project configuration if the file is part of a project in the current solution.
12+
In addition options given in the $(LINK2 GlobalOptions.html, global settings) are added to the command
13+
line. Instead of building the full project, $(LINK2 http://dlang.org/rdmd.html, rdmd) is used
14+
to just add the minimal dependent modules. In order to build a runnable exectuable, you might have to add
15+
a $(D main) function to the source file or add $(D -main) to the global options.
16+
)
17+
18+
$(P One use case for this feature is to run unittests of a single module. Compilation errors, program output
19+
and exception trace will be visible in the output window and can be double clicked to jump to the shown
20+
code locations.
21+
)
22+
23+
$(P When used on a source file not found in any of the projects in the solution, default options
24+
from the ConsoleApp project template are used to build the executable with rdmd. This allows script
25+
like usage of D files from within the IDE, though there is currently no way to specify execution
26+
arguments.
27+
)
28+
29+
$(H2 Compile and Debug)
30+
31+
$(P This command is similar to "Compile and Run", but instead of running the compiled executable
32+
immediately, the debugger is started to allow further inspection. If you want to trace execution from
33+
the very beginning of the program, you should set a breakpoint at the start of $(D main) before
34+
issuing this command.
35+
)
36+
37+
$(H2 Compile and Disassemble)
38+
39+
$(P While optimizing code, it is often useful to take a look at the assembly generated by the
40+
compiler. This is usually done by compiling a program, starting it in a debugger until it
41+
hits an appropriate breakpoint. The disassembly view will then show the desired machine
42+
instructions.
43+
)
44+
45+
$(P This can be a tedious and time consuming process, when all you want to look at is the
46+
disassembly of the currently written lines of code. The "Compile and Disassemble" command
47+
can take the pain out of this workflow, as it will just compile (not link) the current module
48+
with the command line options of the active project configuration and then show a
49+
disassembly dump in the Code Definition Window. It automatically synchronizes the instructions
50+
shown in the disassembly with the current caret location in the editor.
51+
)
52+
53+
$(IMG_CENTER images/compiledisasm.png)
54+
55+
$(P Dumping the assembly of an object file is done by an external command line tool that can
56+
be configured for each tool chain in the $(LINK2 GlobalOptions.html, global settings).
57+
For Win32, the generated object file format is rather dated OMF that is not very well
58+
supported anymore. The commercial version of the Digital Mars C++ compiler contains
59+
the command line tool $(LINK2 http://www.digitalmars.com/ctg/obj2asm.html, obj2asm),
60+
but you can also use $(LINK2 http://www.agner.org/optimize/#objconv, objconv) by Agner Fog.
61+
For any other target or compiler platform, the generated object file format is COFF, that
62+
can be disassembled with the Microsoft tool $(D dumpbin) that comes with Visual Studio. In
63+
case you use Visual D to cross compile for other architectures with LDC or GDC, you might
64+
have to run the appropriate tools from these compiler suites instead.
65+
)
66+
67+
$(P These are working settings for the "Disassemble Command" option, but you might want to
68+
tweak these for different output, e.g. switch between AT&T and Intel style assembly.
69+
Make sure that instruction offsets are displayed so synchronization with the
70+
editor works with the help of debug line number information.
71+
)
72+
73+
$(H3 DMD/Win32)
74+
75+
$(PRE obj2asm -x "$(DOLLAR)(InputFile)" >"$(DOLLAR)(TargetPath)")
76+
77+
This assumes obj2asm can be found in through PATH. If this is not the case, please add
78+
the full path to it. The same replacement macros can be used as in the project
79+
configurations.
80+
81+
For objconv, this command is
82+
83+
$(PRE obj2conv -fasm "$(DOLLAR)(InputFile)" "$(DOLLAR)(TargetPath)")
84+
85+
$(H3 DMD/Win64)
86+
87+
$(PRE "$(DOLLAR)(VCInstallDir)\bin\amd64\dumpbin" /disasm "$(DOLLAR)(InputPath)" >"$(DOLLAR)(TargetPath)" )
88+
89+
$(H3 DMD/Win32-COFF)
90+
91+
dumpbin executables can be used for both architectures x86 and AMD64, no matter
92+
what architecture might be running on, so you can use the same setting as Win64,
93+
but in case you are restricted to a 32-bit OS, the respective executable can be
94+
found in the bin folder of the VC installation:
95+
96+
$(PRE "$(DOLLAR)(VCInstallDir)\bin\dumpbin" /disasm "$(DOLLAR)(InputPath)" >"$(DOLLAR)(TargetPath)" )
97+
98+
There is one gotcha: dumpbin needs a DLL for doing the disassembly that is installed
99+
to $(VSInstallDir)\Common7\IDE (in VS 2013), so make sure you have this directory
100+
listed in the "Executable Paths".
101+
102+
$(H3 LDC)
103+
104+
dumpbin works here, too, for the x64/AMD64 architecture, but in case you want to
105+
use LLVM tools for other architectures, you'll have to change the default setting:
106+
107+
$(PRE llvm-objdump -disassemble "$(DOLLAR)(InputPath)" >"$(DOLLAR)(TargetPath)" )
108+
109+
You'll have to add the path the LLVM tools to the "Executable Paths" or to the
110+
llvm-objdump command.
111+
112+
$(H3 GDC)
113+
114+
Similar to LDC, the alternative command is
115+
116+
$(PRE objdump --disassemble "$(DOLLAR)(InputPath)" >"$(DOLLAR)(TargetPath)" )
117+
118+
Macros:
119+
TITLE=Compile Commands
120+

doc/build_doc.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ set SRC=%SRC% GlobalOptions.dd
2222
set SRC=%SRC% Features.dd
2323
set SRC=%SRC% VersionHistory.dd
2424
set SRC=%SRC% News36.dd
25+
set SRC=%SRC% CompileCommands.dd
2526

2627
set DDOC=macros.ddoc html.ddoc visuald.ddoc dlang.org.ddoc
2728

doc/images/compiledisasm.png

63 KB
Loading

doc/images/compilemenu.png

4.16 KB
Loading

nsis/visuald.nsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ ${MementoSection} "cv2pdb" SecCv2pdb
395395
${File} ..\..\..\cv2pdb\trunk\ autoexp.visualizer
396396
${File} ..\..\..\cv2pdb\trunk\bin\Release\ cv2pdb.exe
397397
${File} ..\..\..\cv2pdb\trunk\bin\Release\ dviewhelper.dll
398+
${File} ..\..\..\cv2pdb\trunk\bin\Release\ dumplines.exe
398399
${File} ..\..\..\cv2pdb\trunk\ README
399400
${File} ..\..\..\cv2pdb\trunk\ LICENSE
400401
${File} ..\..\..\cv2pdb\trunk\ CHANGES

sdk/port/vsi.d

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@ public import sdk.port.base;
44
public import sdk.win32.unknwn;
55

66
// VSI specifics
7-
__gshared IUnknown DOCDATAEXISTING_UNKNOWN;
7+
@property IUnknown DOCDATAEXISTING_UNKNOWN()
8+
{
9+
IUnknown unk;
10+
*cast(size_t*)&unk = -1;
11+
return unk;
12+
}
813

9-
shared static this() { *cast(int*)&DOCDATAEXISTING_UNKNOWN = -1; }
14+
//shared static this() { *cast(int*)&DOCDATAEXISTING_UNKNOWN = -1; }
1015

1116
const GUID GUID_COMPlusNativeEng = { 0x92EF0900, 0x2251, 0x11D2, [ 0xB7, 0x2E, 0x00, 0x00, 0xF8, 0x75, 0x72, 0xEF ] };
1217
const GUID GUID_COMPlusOnlyEnd = uuid("{449EC4CC-30D2-4032-9256-EE18EB41B62B}");

0 commit comments

Comments
 (0)