@@ -424,7 +424,7 @@ internal static ulong FindVariableAddress(DkmNativeModuleInstance nativeModuleIn
424
424
return 0 ;
425
425
}
426
426
427
- internal static Guid ? CreateTargetFunctionBreakpointAtAddress ( DkmProcess process , DkmNativeModuleInstance moduleWithLoadedLua , string name , string desc , ulong address )
427
+ internal static DkmRuntimeInstructionBreakpoint CreateTargetFunctionBreakpointObjectAtAddress ( DkmProcess process , DkmNativeModuleInstance moduleWithLoadedLua , string name , string desc , ulong address , bool enabled )
428
428
{
429
429
if ( address != 0 )
430
430
{
@@ -434,9 +434,10 @@ internal static ulong FindVariableAddress(DkmNativeModuleInstance nativeModuleIn
434
434
435
435
var breakpoint = DkmRuntimeInstructionBreakpoint . Create ( Guids . luaSupportBreakpointGuid , null , nativeAddress , false , null ) ;
436
436
437
- breakpoint . Enable ( ) ;
437
+ if ( enabled )
438
+ breakpoint . Enable ( ) ;
438
439
439
- return breakpoint . UniqueId ;
440
+ return breakpoint ;
440
441
}
441
442
else
442
443
{
@@ -446,7 +447,17 @@ internal static ulong FindVariableAddress(DkmNativeModuleInstance nativeModuleIn
446
447
return null ;
447
448
}
448
449
449
- internal static Guid ? CreateTargetFunctionBreakpointAtDebugStart ( DkmProcess process , DkmNativeModuleInstance moduleWithLoadedLua , string name , string desc , out ulong breakAddress )
450
+ internal static Guid ? CreateTargetFunctionBreakpointAtAddress ( DkmProcess process , DkmNativeModuleInstance moduleWithLoadedLua , string name , string desc , ulong address )
451
+ {
452
+ DkmRuntimeInstructionBreakpoint breakpoint = CreateTargetFunctionBreakpointObjectAtAddress ( process , moduleWithLoadedLua , name , desc , address , true ) ;
453
+
454
+ if ( breakpoint != null )
455
+ return breakpoint . UniqueId ;
456
+
457
+ return null ;
458
+ }
459
+
460
+ internal static DkmRuntimeInstructionBreakpoint CreateTargetFunctionBreakpointObjectAtDebugStart ( DkmProcess process , DkmNativeModuleInstance moduleWithLoadedLua , string name , string desc , out ulong breakAddress , bool enabled )
450
461
{
451
462
var address = TryGetFunctionAddressAtDebugStart ( moduleWithLoadedLua , name , out string error ) ;
452
463
@@ -458,10 +469,11 @@ internal static ulong FindVariableAddress(DkmNativeModuleInstance nativeModuleIn
458
469
459
470
var breakpoint = DkmRuntimeInstructionBreakpoint . Create ( Guids . luaSupportBreakpointGuid , null , nativeAddress , false , null ) ;
460
471
461
- breakpoint . Enable ( ) ;
472
+ if ( enabled )
473
+ breakpoint . Enable ( ) ;
462
474
463
475
breakAddress = address . Value ;
464
- return breakpoint . UniqueId ;
476
+ return breakpoint ;
465
477
}
466
478
else
467
479
{
@@ -472,6 +484,16 @@ internal static ulong FindVariableAddress(DkmNativeModuleInstance nativeModuleIn
472
484
return null ;
473
485
}
474
486
487
+ internal static Guid ? CreateTargetFunctionBreakpointAtDebugStart ( DkmProcess process , DkmNativeModuleInstance moduleWithLoadedLua , string name , string desc , out ulong breakAddress )
488
+ {
489
+ DkmRuntimeInstructionBreakpoint breakpoint = CreateTargetFunctionBreakpointObjectAtDebugStart ( process , moduleWithLoadedLua , name , desc , out breakAddress , true ) ;
490
+
491
+ if ( breakpoint != null )
492
+ return breakpoint . UniqueId ;
493
+
494
+ return null ;
495
+ }
496
+
475
497
internal static Guid ? CreateTargetFunctionBreakpointAtDebugEnd ( DkmProcess process , DkmNativeModuleInstance moduleWithLoadedLua , string name , string desc , out ulong breakAddress )
476
498
{
477
499
var address = TryGetFunctionAddressAtDebugEnd ( moduleWithLoadedLua , name , out string error ) ;
0 commit comments