Skip to content

Commit

Permalink
Add lldb engine to attach on SSH (#1166)
Browse files Browse the repository at this point in the history
* Add lldb engine to attach on SSH

* No data breakpoints

* add comment
  • Loading branch information
paulmaybee authored Jul 14, 2021
1 parent 6951239 commit 5739661
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/MIDebugEngine/AD7.Impl/AD7Engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,12 @@ private LaunchOptions CreateAttachLaunchOptions(uint processId, IDebugPort2 port
{
miMode = MIMode.Gdb;
}
else if (_engineGuid == EngineConstants.LldbEngine)
{
miMode = MIMode.Lldb;
}
else
{
// TODO: LLDB support
throw new NotImplementedException();
}

Expand Down
2 changes: 2 additions & 0 deletions src/MIDebugEngine/AD7.Impl/EngineConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ static public class EngineConstants
public static readonly Guid EngineId = new Guid("{ea6637c6-17df-45b5-a183-0951c54243bc}");

public static readonly Guid GdbEngine = new Guid("{91744D97-430F-42C1-9779-A5813EBD6AB2}");

public static readonly Guid LldbEngine = new Guid("{5D630903-189D-4837-9785-699B05BEC2A9}");
}
}
31 changes: 31 additions & 0 deletions src/MIDebugEngine/Microsoft.MIDebugEngine.pkgdef
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,37 @@
; WSL Port supplier
"2"="{267B1341-AC92-44DC-94DF-2EE4205DD17E}"

; Registration to use lldb with the port suppliers
[$RootKey$\AD7Metrics\Engine\{5D630903-189D-4837-9785-699B05BEC2A9}]
@="MI Debug Engine - lldb"
"Attach"=dword:00000001
; "AddressBP"=dword:00000001
"AlwaysLoadLocal"=dword:00000001
; "CallStackBP"=dword:00000001
; "ConditionalBP"=dword:00000001
"DataBP"=dword:00000000
"Disassembly"=dword:00000001
"EnginePriority"=dword:00000050
"Exceptions"=dword:00000001
; "FunctionBP"=dword:00000001
; "HitCountBP"=dword:00000000
; "JustMyCodeStepping"=dword:00000001
"Name"="Native (LLDB)"
"SetNextStatement"=dword:00000001
; "SuspendThread"=dword:00000001
"CLSID"="{0fc2f352-2fc1-4f80-8736-51cd1ab28f16}"
"GlobalVisualizersDirectory"="$PackageFolder$"
"BreakWhenValueChanges"=dword:00000000
"DataBPAsString"=dword:00000000

[$RootKey$\AD7Metrics\Engine\{5D630903-189D-4837-9785-699B05BEC2A9}\PortSupplier]
; SSH Port Supplier
"0"="{3FDDF14E-E758-4695-BE0C-7509920432C9}"

[$RootKey$\AD7Metrics\Engine\{5D630903-189D-4837-9785-699B05BEC2A9}\IncompatibleList]
"MI Debug Engine - gdb"="{91744D97-430F-42C1-9779-A5813EBD6AB2}"
"vsdbg"="{EF9CD3BB-2C0E-41AD-B54C-63006BC09D19}"

[$RootKey$\OpenFolder\Settings\VSWorkspaceSettings\{EA6637C6-17DF-45B5-A183-0951C54243BC}]
@="$PackageFolder$\OpenFolderSchema.json"

Expand Down
5 changes: 3 additions & 2 deletions src/SSHDebugPS/AD7/AD7UnixAsyncShellCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ protected override void OnOutputReceived(object sender, string e)

if (_startCommand != null)
{
if (line.EndsWith(_startCommand, StringComparison.Ordinal))
if (line.Contains(_startCommand))
{
// When logged in as root, shell sends a copy of stdin to stdout.
// When logged in as root, shell sends a copy of stdin to stdout. On MacOS
// trailing control characters appear on the line.
// This ignores the shell command that was used to launch the debugger.
continue;
}
Expand Down

0 comments on commit 5739661

Please sign in to comment.