Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions src/MIDebugEngine/Engine.Impl/DebuggedProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ private List<LaunchCommand> GetInitializeCommands()
{
commands.Add(new LaunchCommand("-exec-arguments " + _launchOptions.ExeArguments));
}

Func<string, Task> breakMainSuccessHandler = (string bkptResult) =>
{
int index = bkptResult.IndexOf("number=", StringComparison.Ordinal);
Expand All @@ -749,7 +749,7 @@ private List<LaunchCommand> GetInitializeCommands()
};

commands.Add(new LaunchCommand("-break-insert main", ignoreFailures: true, successHandler: breakMainSuccessHandler));

if (null != localLaunchOptions)
{
string destination = localLaunchOptions.MIDebuggerServerAddress;
Expand Down Expand Up @@ -1064,7 +1064,7 @@ private async Task HandleBreakModeEvent(ResultEventArgs results, BreakRequest br
TupleValue frame = results.Results.TryFind<TupleValue>("frame");
AD7BoundBreakpoint[] bkpt = _breakpointManager.FindHitBreakpoints(bkptno, addr, frame, out fContinue);

if (bkpt != null)
if (bkpt != null)
{
if (frame != null && addr != 0)
{
Expand Down Expand Up @@ -1229,7 +1229,7 @@ private async void OnEntrypointHit()
await ConsoleCmdAsync("process handle --pass true --stop false --notify false SIGHUP", true);
}

if(this._deleteEntryPointBreakpoint && !String.IsNullOrWhiteSpace(this._entryPointBreakpoint))
if (this._deleteEntryPointBreakpoint && !String.IsNullOrWhiteSpace(this._entryPointBreakpoint))
{
await MICommandFactory.BreakDelete(this._entryPointBreakpoint);
this._deleteEntryPointBreakpoint = false;
Expand Down Expand Up @@ -1747,7 +1747,8 @@ public async Task<List<SimpleVariableInformation>> GetParameterInfoOnly(AD7Threa
//NOTE: eval is not called
public async Task<List<ArgumentList>> GetParameterInfoOnly(AD7Thread thread, bool values, bool types, uint low, uint high)
{
var frames = await MICommandFactory.StackListArguments(values || types ? PrintValues.SimpleValues : PrintValues.NoValues, thread.Id, low, high);
// If values are requested, request simple values, otherwise we'll use -var-create to get the type of argument it is.
var frames = await MICommandFactory.StackListArguments(values ? PrintValues.SimpleValues : PrintValues.NoValues, thread.Id, low, high);
List<ArgumentList> parameters = new List<ArgumentList>();

foreach (var f in frames)
Expand All @@ -1771,13 +1772,31 @@ public async Task<List<ArgumentList>> GetParameterInfoOnly(AD7Thread thread, boo
string[] names = ((ResultListValue)argList).FindAllStrings("name");
foreach (var n in names)
{
args.Add(new SimpleVariableInformation(n, /*isParam*/ true, null, null));
// If the types of the arguments are requested, get that from a call to -var-create
if (types)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this do both costly things now if I specify values && types? If we asked for values, don't we already have the type data here?

Copy link
Collaborator Author

@pieandcakes pieandcakes Dec 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chuckries @gregg-miskelly No, because you would not be in this block if you had both. Line 1762 would be true as if you went through the "simple values" your argList would be a ValueTypeValue and it would run through that if block and not this else block.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it helps, without the value, its a NamedResultValue so it falls into the else block.

{
Debug.Assert(!values, "GetParameterInfoOnly should not reach here if values is true");
Results results = await MICommandFactory.VarCreate(n, thread.Id, (uint)level, 0);

string type = results.FindString("type");
args.Add(new SimpleVariableInformation(n, /*isParam*/ true, null, String.IsNullOrWhiteSpace(type) ? null : type));

string varName = results.TryFindString("name");
if (!String.IsNullOrWhiteSpace(varName))
{
// Remove the variable we created as we don't track it.
await MICommandFactory.VarDelete(varName);
}
}
else
{
args.Add(new SimpleVariableInformation(n, /*isParam*/ true, null, null));
}
}
}
}
parameters.Add(new ArgumentList(level, args));
}

return parameters;
}

Expand Down