1111using System . Globalization ;
1212using System . IO ;
1313using System . Linq ;
14- using System . Reflection ;
1514using System . Text ;
1615using System . Threading ;
1716using System . Threading . Tasks ;
@@ -31,6 +30,7 @@ internal class DebuggedProcess : MICore.Debugger
3130 public Disassembly Disassembly { get ; private set ; }
3231 public ExceptionManager ExceptionManager { get ; private set ; }
3332 public CygwinFilePathMapper CygwinFilePathMapper { get ; private set ; }
33+ public string [ ] TargetFeatures { get ; private set ; }
3434
3535 private List < DebuggedModule > _moduleList ;
3636 private ISampleEngineCallback _callback ;
@@ -618,6 +618,8 @@ public async Task Initialize(HostWaitLoop waitLoop, CancellationToken token)
618618 }
619619 }
620620 }
621+ // now the exe is loaded and we can check target features
622+ TargetFeatures = await MICommandFactory . GetTargetFeatures ( ) ;
621623
622624 success = true ;
623625 }
@@ -1597,10 +1599,16 @@ protected override void ScheduleResultProcessing(Action func)
15971599 _worker . PostOperation ( ( ) => { func ( ) ; } ) ;
15981600 }
15991601
1600- public async Task Execute ( DebuggedThread thread )
1602+ public async Task Execute ( DebuggedThread thread , ExecuteDirection executionDirection = ExecuteDirection . ExecuteDirection_Forward )
16011603 {
16021604 await ExceptionManager . EnsureSettingsUpdated ( ) ;
16031605
1606+ if ( executionDirection == ExecuteDirection . ExecuteDirection_Reverse )
1607+ {
1608+ await MICommandFactory . ExecContinue ( false ) ;
1609+ return ;
1610+ }
1611+
16041612 // Should clear stepping state
16051613 if ( _worker . IsPollThread ( ) )
16061614 {
@@ -1612,30 +1620,32 @@ public async Task Execute(DebuggedThread thread)
16121620 }
16131621 }
16141622
1615- public Task Continue ( DebuggedThread thread )
1623+ public Task Continue ( DebuggedThread thread , ExecuteDirection executionDirection = ExecuteDirection . ExecuteDirection_Forward )
16161624 {
16171625 // Called after Stopping event
1618- return Execute ( thread ) ;
1626+ return Execute ( thread , executionDirection ) ;
16191627 }
16201628
1621- public async Task Step ( int threadId , enum_STEPKIND kind , enum_STEPUNIT unit )
1629+ public async Task Step ( int threadId , enum_STEPKIND kind , enum_STEPUNIT unit , ExecuteDirection direction = ExecuteDirection . ExecuteDirection_Forward )
16221630 {
16231631 this . VerifyNotDebuggingCoreDump ( ) ;
16241632
16251633 await ExceptionManager . EnsureSettingsUpdated ( ) ;
16261634
1635+ // STEP_BACKWARDS is deprecated, use direction
1636+ bool isForwardStep = direction == ExecuteDirection . ExecuteDirection_Forward ;
16271637 if ( ( unit == enum_STEPUNIT . STEP_LINE ) || ( unit == enum_STEPUNIT . STEP_STATEMENT ) )
16281638 {
16291639 switch ( kind )
16301640 {
16311641 case enum_STEPKIND . STEP_INTO :
1632- await MICommandFactory . ExecStep ( threadId ) ;
1642+ await MICommandFactory . ExecStep ( threadId , isForwardStep ) ;
16331643 break ;
16341644 case enum_STEPKIND . STEP_OVER :
1635- await MICommandFactory . ExecNext ( threadId ) ;
1645+ await MICommandFactory . ExecNext ( threadId , isForwardStep ) ;
16361646 break ;
16371647 case enum_STEPKIND . STEP_OUT :
1638- await MICommandFactory . ExecFinish ( threadId ) ;
1648+ await MICommandFactory . ExecFinish ( threadId , isForwardStep ) ;
16391649 break ;
16401650 default :
16411651 throw new NotImplementedException ( ) ;
@@ -1646,13 +1656,13 @@ public async Task Step(int threadId, enum_STEPKIND kind, enum_STEPUNIT unit)
16461656 switch ( kind )
16471657 {
16481658 case enum_STEPKIND . STEP_INTO :
1649- await MICommandFactory . ExecStepInstruction ( threadId ) ;
1659+ await MICommandFactory . ExecStepInstruction ( threadId , isForwardStep ) ;
16501660 break ;
16511661 case enum_STEPKIND . STEP_OVER :
1652- await MICommandFactory . ExecNextInstruction ( threadId ) ;
1662+ await MICommandFactory . ExecNextInstruction ( threadId , isForwardStep ) ;
16531663 break ;
16541664 case enum_STEPKIND . STEP_OUT :
1655- await MICommandFactory . ExecFinish ( threadId ) ;
1665+ await MICommandFactory . ExecFinish ( threadId , isForwardStep ) ;
16561666 break ;
16571667 default :
16581668 throw new NotImplementedException ( ) ;
0 commit comments