diff --git a/windows/src/buildtools/sentrytool/Keyman.System.MapToSym.pas b/windows/src/buildtools/sentrytool/Keyman.System.MapToSym.pas
index 1e67d40540..e64d159cbc 100644
--- a/windows/src/buildtools/sentrytool/Keyman.System.MapToSym.pas
+++ b/windows/src/buildtools/sentrytool/Keyman.System.MapToSym.pas
@@ -116,16 +116,28 @@ begin
if i < procCount - 1
then procLen := s.FProcNames[i+1].VA - s.FProcNames[i].VA
- else procLen := 0;
+ else procLen := 0; // TODO: look at module size for maximum here?
procName := MapStringCacheToStr(s.FProcNames[i].ProcName);
r.Add(Format('FUNC %x %x 0 %s', [s.FProcNames[i].VA + $1000 {constant entry point}, procLen, procName]));
+ if (lineIndex >= lineCount) or (s.FLineNumbers[lineIndex].VA >= s.FProcNames[i].VA + Cardinal(procLen)) then
+ begin
+ // No line numbers, let's add an artificial line, otherwise Sentry does
+ // not use it for symbolication
+ r.Add(Format('%x %x %d %d', [s.FProcNames[i].VA + $1000, procLen, 1, UnitIndexFromVA(s.FProcNames[i].VA)+1]));
+ end;
+
while (lineIndex < lineCount) and (s.FLineNumbers[lineIndex].VA < s.FProcNames[i].VA + Cardinal(procLen)) do
begin
if lineIndex < lineCount - 1
then lineLen := s.FLineNumbers[lineIndex+1].VA - s.FLineNumbers[lineIndex].VA
- else lineLen := 0;
+ else lineLen := 0; // TODO: look at module size for maximum here?
+
+ // We never want the range to go outside the bounds of the function -- if there are no
+ // line numbers for the next function, then we ensure we end at the function boundary
+ if s.FLineNumbers[lineIndex].VA + Cardinal(lineLen) > s.FProcNames[i].VA + Cardinal(procLen) then
+ lineLen := s.FProcNames[i].VA + Cardinal(procLen) - s.FLineNumbers[lineIndex].VA;
r.Add(Format('%x %x %d %d', [s.FLineNumbers[lineIndex].VA + $1000 {constant entry point},
lineLen, s.FLineNumbers[lineIndex].LineNumber, UnitIndexFromVA(s.FLineNumbers[lineIndex].VA)+1]));
diff --git a/windows/src/developer/TIKE/main/KeymanDeveloperUtils.pas b/windows/src/developer/TIKE/main/KeymanDeveloperUtils.pas
index 727973fa93..121b53462e 100644
--- a/windows/src/developer/TIKE/main/KeymanDeveloperUtils.pas
+++ b/windows/src/developer/TIKE/main/KeymanDeveloperUtils.pas
@@ -48,12 +48,14 @@ interface
uses
System.UITypes,
- Windows,
- Messages,
- ComObj,
- Graphics,
+ System.Win.ComObj,
+ Vcl.Graphics,
+ Winapi.Messages,
+ Winapi.Windows,
+
KeymanPaths,
keymanapi_TLB,
+ Sentry.Client,
UserMessages;
const
@@ -84,6 +86,8 @@ function GetCurrentDateTime: string;
function GetKMShellPath(var ps: string): Boolean; // I3655
function WaitForElevatedConfiguration(WindowHandle: THandle; const Parameters: WideString; FWait: Boolean): Cardinal; // I3655
+procedure TestSentry;
+
var
kmcom: IKeyman = nil;
@@ -664,5 +668,10 @@ begin
ShowMessage(SysErrorMessage(GetLastError));
end;
+procedure TestSentry;
+begin
+ raise ESentryTest.Create('Just testing Sentry integration');
+end;
+
end.
diff --git a/windows/src/developer/TIKE/main/UfrmMain.pas b/windows/src/developer/TIKE/main/UfrmMain.pas
index de9e430319..7c7cc5bc52 100644
--- a/windows/src/developer/TIKE/main/UfrmMain.pas
+++ b/windows/src/developer/TIKE/main/UfrmMain.pas
@@ -444,6 +444,7 @@ uses
RedistFiles,
ErrorControlledRegistry,
RegistryKeys,
+ Sentry.Client,
TikeUnicodeData,
UfrmCharacterMapDock,
UfrmMessages,
@@ -1413,11 +1414,8 @@ begin
end;
procedure TfrmKeymanDeveloper.crash1Click(Sender: TObject);
-var
- p: PChar;
begin
- p := nil;
- p^ := #0;
+ raise ESentryTest.Create('Just testing Sentry');
end;
procedure TfrmKeymanDeveloper.SetActiveChild(const Value: TfrmTikeChild);
diff --git a/windows/src/ext/sentry/Sentry.Client.pas b/windows/src/ext/sentry/Sentry.Client.pas
index 458faba567..8c26a1469a 100644
--- a/windows/src/ext/sentry/Sentry.Client.pas
+++ b/windows/src/ext/sentry/Sentry.Client.pas
@@ -67,6 +67,11 @@ type
TSentryClientClass = class of TSentryClient;
+ // When testing Sentry integration, ESentryTest is an appropriate exception to
+ // raise.
+ ESentryTest = class(Exception)
+ end;
+
procedure SentryHandleException(E: Exception; AExceptAddr: Pointer = nil);
implementation
diff --git a/windows/src/ext/tds2dbg/tds2dbg.sln b/windows/src/ext/tds2dbg/tds2dbg.sln
new file mode 100644
index 0000000000..eed6a4bb0a
--- /dev/null
+++ b/windows/src/ext/tds2dbg/tds2dbg.sln
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.28307.1000
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tds2dbg", "tds2dbg.vcxproj", "{40BFECE3-7FC0-4649-A3DC-E017FF84C75B}"
+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
+ {40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Debug|x64.ActiveCfg = Debug|x64
+ {40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Debug|x64.Build.0 = Debug|x64
+ {40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Debug|x86.ActiveCfg = Debug|Win32
+ {40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Debug|x86.Build.0 = Debug|Win32
+ {40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Release|x64.ActiveCfg = Release|x64
+ {40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Release|x64.Build.0 = Release|x64
+ {40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Release|x86.ActiveCfg = Release|Win32
+ {40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {50FB6E2C-4FEF-4828-A315-1017276BF47A}
+ EndGlobalSection
+EndGlobal
diff --git a/windows/src/ext/tds2dbg/tds2dbg.vcxproj b/windows/src/ext/tds2dbg/tds2dbg.vcxproj
new file mode 100644
index 0000000000..2b5f0931c3
--- /dev/null
+++ b/windows/src/ext/tds2dbg/tds2dbg.vcxproj
@@ -0,0 +1,118 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 15.0
+ {40BFECE3-7FC0-4649-A3DC-E017FF84C75B}
+ Win32Proj
+
+
+
+ Application
+ true
+ v141
+
+
+ Application
+ false
+ v141
+
+
+ Application
+ true
+ v141
+
+
+ Application
+ false
+ v141
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ true
+
+
+
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ MultiThreadedDebugDLL
+ Level3
+ ProgramDatabase
+ Disabled
+
+
+ MachineX86
+ true
+ Console
+
+
+
+
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ MultiThreadedDLL
+ Level3
+ ProgramDatabase
+
+
+ MachineX86
+ true
+ Console
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/windows/src/ext/tds2dbg/tds2dbg.vcxproj.filters b/windows/src/ext/tds2dbg/tds2dbg.vcxproj.filters
new file mode 100644
index 0000000000..a74a66814b
--- /dev/null
+++ b/windows/src/ext/tds2dbg/tds2dbg.vcxproj.filters
@@ -0,0 +1,50 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;hm;inl;inc;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+
+
+ Resource Files
+
+
+
\ No newline at end of file
diff --git a/windows/src/global/delphi/general/Keyman.System.KeymanSentryClient.pas b/windows/src/global/delphi/general/Keyman.System.KeymanSentryClient.pas
index 87b8c143f2..dbe73e5142 100644
--- a/windows/src/global/delphi/general/Keyman.System.KeymanSentryClient.pas
+++ b/windows/src/global/delphi/general/Keyman.System.KeymanSentryClient.pas
@@ -115,7 +115,7 @@ begin
then o.DSN := SENTRY_DSN_DESKTOP
else o.DSN := SENTRY_DSN_DEVELOPER;
- {$MESSAGE HINT 'Support proxies'}
+ // Note: system proxy is used automatically if no proxy is defined
o.Release := 'release-'+CKeymanVersionInfo.VersionWithTag;