Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/HJLebbink/asm-dude
Browse files Browse the repository at this point in the history
  • Loading branch information
HJLebbink committed Jun 9, 2017
2 parents 1cd43f6 + 17a7362 commit 0bb1a69
Show file tree
Hide file tree
Showing 10 changed files with 273 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ VS/CSHARP/asm-dude-vsix-2/packages/*
*.dropbox.attr
VS/CSHARP/asm-sim-lib/libs/*
VS/CSHARP/asm-dude-vsix/Resources/Performance/instruction_tables.ods
*.ipch
*.VC.db
28 changes: 28 additions & 0 deletions VS/CPP/ConsoleTest/ConsoleTest.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleTest", "ConsoleTest\ConsoleTest.vcxproj", "{3999DC4F-3A96-4B9B-805E-6BBDF0B101E1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3999DC4F-3A96-4B9B-805E-6BBDF0B101E1}.Debug|x64.ActiveCfg = Debug|x64
{3999DC4F-3A96-4B9B-805E-6BBDF0B101E1}.Debug|x64.Build.0 = Debug|x64
{3999DC4F-3A96-4B9B-805E-6BBDF0B101E1}.Debug|x86.ActiveCfg = Debug|Win32
{3999DC4F-3A96-4B9B-805E-6BBDF0B101E1}.Debug|x86.Build.0 = Debug|Win32
{3999DC4F-3A96-4B9B-805E-6BBDF0B101E1}.Release|x64.ActiveCfg = Release|x64
{3999DC4F-3A96-4B9B-805E-6BBDF0B101E1}.Release|x64.Build.0 = Release|x64
{3999DC4F-3A96-4B9B-805E-6BBDF0B101E1}.Release|x86.ActiveCfg = Release|Win32
{3999DC4F-3A96-4B9B-805E-6BBDF0B101E1}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
147 changes: 147 additions & 0 deletions VS/CPP/ConsoleTest/ConsoleTest/ConsoleTest.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{3999DC4F-3A96-4B9B-805E-6BBDF0B101E1}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ConsoleTest</RootNamespace>
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Main.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
22 changes: 22 additions & 0 deletions VS/CPP/ConsoleTest/ConsoleTest/ConsoleTest.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
11 changes: 11 additions & 0 deletions VS/CPP/ConsoleTest/ConsoleTest/Main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// 'Hello World!' program

#include <iostream>

int main()
{
std::cout << "Hello World!" << std::endl;
std::cout << "Press any key to exit" << std::endl;
int c = getchar();
return 0;
}
1 change: 1 addition & 0 deletions VS/CSHARP/asm-dude-vsix/AsmDudePackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public sealed class AsmDudePackage : Package {
public const string PackageGuidString = "27e0e7ef-ecaf-4b87-a574-6a909383f99f";

internal const string AsmDudeContentType = "asm!";
internal const string DisassemblyContentType = "Disassembly";
internal const double slowWarningThresholdSec = 0.4; // threshold to warn that actions are considered slow
internal const double slowShutdownThresholdSec = 4.0; // threshold to switch of components
internal const int maxNumberOfCharsInToolTips = 150;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ namespace AsmDude.QuickInfo
{
[Export(typeof(IIntellisenseControllerProvider))]
[ContentType(AsmDudePackage.AsmDudeContentType)]
//[ContentType("code")] // use contenttype "code" to use quickinfo controller in disassembly window
[Name("QuickInfo Controller")]
[Name("QuickInfo AsmDude Controller")]
[TextViewRole(PredefinedTextViewRoles.Debuggable)]
internal sealed class AsmQuickInfoControllerProvider : IIntellisenseControllerProvider
{
Expand All @@ -45,4 +44,19 @@ public IIntellisenseController TryCreateIntellisenseController(ITextView textVie
return new AsmQuickInfoController(textView, subjectBuffers, this._quickInfoBroker);
}
}

[Export(typeof(IIntellisenseControllerProvider))]
[ContentType(AsmDudePackage.DisassemblyContentType)]
[Name("QuickInfo AsmDude Disassembly Controller")]
[TextViewRole(PredefinedTextViewRoles.Debuggable)]
internal sealed class AsmDisassemblyQuickInfoControllerProvider : IIntellisenseControllerProvider
{
[Import]
private IQuickInfoBroker _quickInfoBroker = null;

public IIntellisenseController TryCreateIntellisenseController(ITextView textView, IList<ITextBuffer> subjectBuffers)
{
return new AsmQuickInfoController(textView, subjectBuffers, this._quickInfoBroker);
}
}
}
29 changes: 25 additions & 4 deletions VS/CSHARP/asm-dude-vsix/SyntaxHighlighting/AsmTaggerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ namespace AsmDude.SyntaxHighlighting
{
[Export(typeof(ITaggerProvider))]
[ContentType(AsmDudePackage.AsmDudeContentType)]
//[ContentType("code")]
[TagType(typeof(ClassificationTag))]
[Name("AsmDude-AsmTaggerProvider")]
[Order(After = Priority.High)]
Expand All @@ -110,7 +109,6 @@ internal sealed class AsmTaggerProvider : ITaggerProvider
[Export]
[FileExtension(".asm")]
[ContentType(AsmDudePackage.AsmDudeContentType)]
[Order(After = "default")]
internal static FileExtensionToContentTypeDefinition AsmFileType = null;

[Export]
Expand All @@ -134,11 +132,34 @@ internal sealed class AsmTaggerProvider : ITaggerProvider
[Import]
private IBufferTagAggregatorFactoryService _aggregatorFactory = null;

//[Import]
//private IContentTypeRegistryService _contentTypeRegistryService = null;
public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag
{
Func<ITagger<T>> sc = delegate ()
{
var aggregator = AsmDudeToolsStatic.GetOrCreate_Aggregator(buffer, this._aggregatorFactory);
return new AsmClassifier(buffer, aggregator, this._classificationTypeRegistry) as ITagger<T>;
};
return buffer.Properties.GetOrCreateSingletonProperty(sc);
}
}

[Export(typeof(ITaggerProvider))]
[ContentType(AsmDudePackage.DisassemblyContentType)]
[TagType(typeof(ClassificationTag))]
[Name("AsmDude-DisassemblyAsmTaggerProvider")]
[Order(After = Priority.High)]
internal sealed class AsmDisassemblyTaggerProvider : ITaggerProvider
{
[Import]
private IClassificationTypeRegistryService _classificationTypeRegistry = null;

[Import]
private IBufferTagAggregatorFactoryService _aggregatorFactory = null;

public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag
{
AsmDudeToolsStatic.Output_INFO("AsmDisassemblyTaggerProvider: Creating a TaggerProvider for buffer " + buffer.CurrentSnapshot.GetText());

Func<ITagger<T>> sc = delegate ()
{
var aggregator = AsmDudeToolsStatic.GetOrCreate_Aggregator(buffer, this._aggregatorFactory);
Expand Down
1 change: 0 additions & 1 deletion VS/CSHARP/asm-dude-vsix/SyntaxHighlighting/AsmTokenTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class AsmTokenTag : ITag
{
public static readonly string MISC_KEYWORD_PROTO = "PROTO";


public AsmTokenType Type { get; private set; }
public string Misc { get; private set; }
public AsmTokenTag(AsmTokenType type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ namespace AsmDude
{
[Export(typeof(ITaggerProvider))]
[ContentType(AsmDudePackage.AsmDudeContentType)]
//[ContentType("code")]
[TagType(typeof(AsmTokenTag))]
[Name("Assembly Token Tag Provider")]
[Name("AsmDude Assembly Token Tag Provider")]
[Order(Before = "default")]
internal sealed class AsmTokenTagProvider : ITaggerProvider
{
Expand All @@ -45,25 +44,26 @@ public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag
//AsmDudeToolsStatic.Output_INFO("AsmTokenTagProvider:CreateTagger");
Func<ITagger<T>> sc = delegate ()
{
//string filename = AsmDudeToolsStatic.GetFileName(buffer);
//if ((filename == null) || (filename.Length == 0))
//{
// AsmDudeToolsStatic.Output_INFO("AsmTokenTagProvider:CreateTagger: found a buffer without a filename");
// return new DebugTokenTagger(buffer) as ITagger<T>;
//} else {
if (AsmDudeToolsStatic.Used_Assembler.HasFlag(AssemblerEnum.MASM))
{
return new MasmTokenTagger(buffer) as ITagger<T>;
}
else if (AsmDudeToolsStatic.Used_Assembler.HasFlag(AssemblerEnum.NASM))
{
return new NasmTokenTagger(buffer) as ITagger<T>;
}
else
{
return new MasmTokenTagger(buffer) as ITagger<T>;
}
//}
if (AsmDudeToolsStatic.Used_Assembler.HasFlag(AssemblerEnum.MASM)) return new MasmTokenTagger(buffer) as ITagger<T>;
if (AsmDudeToolsStatic.Used_Assembler.HasFlag(AssemblerEnum.NASM)) return new NasmTokenTagger(buffer) as ITagger<T>;
return new MasmTokenTagger(buffer) as ITagger<T>;
};
return buffer.Properties.GetOrCreateSingletonProperty(sc);
}
}

[Export(typeof(ITaggerProvider))]
[ContentType(AsmDudePackage.DisassemblyContentType)]
[TagType(typeof(AsmTokenTag))]
[Name("AsmDude Disassembly Token Tag Provider")]
internal sealed class AsmDisassemblyTokenTagProvider : ITaggerProvider
{
public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag
{
AsmDudeToolsStatic.Output_INFO("AsmDisassemblyTokenTagProvider:CreateTagger");
Func<ITagger<T>> sc = delegate ()
{
return new DebugTokenTagger(buffer) as ITagger<T>;
};
return buffer.Properties.GetOrCreateSingletonProperty(sc);
}
Expand Down

0 comments on commit 0bb1a69

Please sign in to comment.