Skip to content
Open
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
31 changes: 9 additions & 22 deletions DbgProvider/public/Commands/SetDbgBreakpointCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

namespace MS.Dbg.Commands
{
[Cmdlet( VerbsCommon.Set, "DbgBreakpoint",
DefaultParameterSetName = c_Expression_ScriptBlockCommand_ParamSet )]
[Cmdlet( VerbsCommon.Set, "DbgBreakpoint")]
[OutputType( typeof( DbgBreakpointInfo ) )]
public class SetDbgBreakpointCommand : DbgBaseCommand
{
Expand All @@ -26,32 +25,24 @@ public class SetDbgBreakpointCommand : DbgBaseCommand
// originally typed, to set as the breakpoint's expression.
//

private const string c_Expression_ScriptBlockCommand_ParamSet = "Expression_ScriptBlockCommand_ParamSet";
private const string c_Address_ScriptBlockCommand_ParamSet = "Address_ScriptBlockCommand_ParamSet";
private const string c_Expression_DbgEngCommand_ParamSet = "Expression_DbgEngCommand_ParamSet";
private const string c_Address_DbgEngCommand_ParamSet = "Address_DbgEngCommand_ParamSet";
private const string c_Expression_ParamSet = "Expression_ParamSet";
private const string c_Address_ParamSet = "Address_ParamSet";


[Parameter( Mandatory = true,
Position = 0,
ValueFromPipeline = true,
ParameterSetName = c_Expression_ScriptBlockCommand_ParamSet )]
[Parameter( Mandatory = true,
Position = 0,
ValueFromPipeline = true,
ParameterSetName = c_Expression_DbgEngCommand_ParamSet )]
ParameterSetName = c_Expression_ParamSet
)]
[ValidateNotNullOrEmpty]
public string Expression { get; set; }


[Parameter( Mandatory = true,
Position = 0,
ValueFromPipeline = true,
ParameterSetName = c_Address_ScriptBlockCommand_ParamSet )]
[Parameter( Mandatory = true,
Position = 0,
ValueFromPipeline = true,
ParameterSetName = c_Address_DbgEngCommand_ParamSet )]
ParameterSetName = c_Address_ParamSet
)]
public ulong Address { get; set; }


Expand All @@ -63,12 +54,10 @@ public class SetDbgBreakpointCommand : DbgBaseCommand
[Alias( "Passes" )]
public uint PassCount { get; set; }

[Parameter( Mandatory = false, ParameterSetName = c_Expression_ScriptBlockCommand_ParamSet )]
[Parameter( Mandatory = false, ParameterSetName = c_Address_ScriptBlockCommand_ParamSet )]
[Parameter( Mandatory = false )]
public ScriptBlock Command { get; set; }

[Parameter( Mandatory = false, ParameterSetName = c_Expression_DbgEngCommand_ParamSet )]
[Parameter( Mandatory = false, ParameterSetName = c_Address_DbgEngCommand_ParamSet )]
[Parameter( Mandatory = false )]
public string DbgEngCommand { get; set; }


Expand Down Expand Up @@ -129,8 +118,6 @@ protected override void ProcessRecord()
if( 0 != Address )
{
addr = Address;
Util.Assert( (c_Address_ScriptBlockCommand_ParamSet == this.ParameterSetName) ||
(c_Address_DbgEngCommand_ParamSet == this.ParameterSetName) );
Expression = DbgProvider.FormatAddress( Address, Debugger.TargetIs32Bit, true ).ToString( false );
}
else
Expand Down