microsoft / microsoft/MIEngine

lldb launch fails due to negative line offsets in frames

Open
#183 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
859
Forks
233
Avg merge
1d 6h
Merged PRs (30d)
3

Description

It appears that lldb produces frames with -1 as the line offset. MITextPosition does not handle negative integers and launch fails.

The test machine was Ubuntu 14.04.

The config file used:
<PipeLaunchOptions xmlns="http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014" PipePath="F:\MIEngineWorkspace\plink.exe" PipeArguments="-i F:\MIEngineWorkspace\private.ppk wiktor@10.127.84.95 -batch -t lldb-mi-3.6 --interpreter mi" ExePath="~/Shared/TargetApp/targetapp" TargetArchitecture="x86_64" MIMode="lldb">

Resulting output
MS_MIDebug: (1439629) ->1005-thread-info MS_MIDebug: (1439629) -> MS_MIDebug: (1439629) ->1005^done,threads=[{id="1",target-id="targetapp",frame={level="0",addr="0x00400df1",func="main",args=[],file="main.cpp",fullname="/home//wiktor/Shared/TargetApp/main.cpp",line="25"},frame={level="1",addr="0x7f7f7079dec5",func="__libc_start_main",args=[],file="??",fullname="??",line="-1"},frame={level="2",addr="0x00400ca9",func="??",args=[],file="??",fullname="??",line="-1"},state="stopped"}]

Resulting exception

    Microsoft.MICore.dll!MICore.Debugger.ParseUint(string str, bool throwOnError) Line 1214 C#
Microsoft.MICore.dll!MICore.ConstValue.ToUint.get() Line 246    C#
Microsoft.MICore.dll!MICore.ResultValue.TryFindUint(string name) Line 110   C#
Microsoft.MIDebugEngine.dll!Microsoft.MIDebugEngine.MITextPosition.TryParse(MICore.TupleValue miTuple) Line 43  C#
Microsoft.MIDebugEngine.dll!Microsoft.MIDebugEngine.ThreadCache.CreateContext(MICore.TupleValue frame) Line 172 C#
Microsoft.MIDebugEngine.dll!Microsoft.MIDebugEngine.ThreadCache.CollectThreadsInfo(int cxtThreadId) Line 239    C#

`

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with MITextPosition.TryParse and the ParseUint call shown in the stack trace, then inspect how ThreadCache.CreateContext consumes the parsed frame. Reproduce the LLDB output containing line="-1" if possible. Done means frames with negative line offsets no longer cause launch parsing to fail.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.