@@ -6319,11 +6319,6 @@ class Breakpoints
6319
6319
#ifdef FEATURE_PAL
6320
6320
if (m_breakpoints == NULL )
6321
6321
{
6322
- ULONG32 flags = 0 ;
6323
- g_clrData->GetOtherNotificationFlags (&flags);
6324
- flags &= ~(CLRDATA_NOTIFY_ON_MODULE_LOAD | CLRDATA_NOTIFY_ON_MODULE_UNLOAD);
6325
- g_clrData->SetOtherNotificationFlags (flags);
6326
-
6327
6322
g_ExtServices->ClearExceptionCallback ();
6328
6323
}
6329
6324
#endif
@@ -6652,6 +6647,7 @@ class Breakpoints
6652
6647
6653
6648
ToRelease<IXCLRDataMethodDefinition> pMeth = NULL ;
6654
6649
mod->GetMethodDefinitionByToken (pCur->methodToken , &pMeth);
6650
+
6655
6651
// We may not need the code notification. Maybe it was ngen'd and we
6656
6652
// already have the method?
6657
6653
// We can delete the current entry if ResolveMethodInstances() set all BPs
@@ -6865,8 +6861,12 @@ class CNotification : public IXCLRDataExceptionNotification4
6865
6861
if (method->GetRepresentativeEntryAddress (&startAddr) == S_OK)
6866
6862
{
6867
6863
CHAR buffer[100 ];
6864
+ #ifndef FEATURE_PAL
6868
6865
sprintf_s (buffer, _countof (buffer), " bp /1 %p" , (void *) (size_t ) (startAddr+catcherNativeOffset));
6869
- g_ExtControl->Execute (DEBUG_EXECUTE_NOT_LOGGED, buffer ,0 );
6866
+ #else
6867
+ sprintf_s (buffer, _countof (buffer), " breakpoint set --one-shot --address 0x%p" , (void *) (size_t ) (startAddr+catcherNativeOffset));
6868
+ #endif
6869
+ g_ExtControl->Execute (DEBUG_EXECUTE_NOT_LOGGED, buffer, 0 );
6870
6870
}
6871
6871
g_stopOnNextCatch = FALSE ;
6872
6872
}
@@ -7020,7 +7020,7 @@ HRESULT HandleExceptionNotification(ILLDBServices *client)
7020
7020
7021
7021
DECLARE_API (bpmd)
7022
7022
{
7023
- INIT_API ();
7023
+ INIT_API_NOEE ();
7024
7024
MINIDUMP_NOT_SUPPORTED ();
7025
7025
int i;
7026
7026
char buffer[1024 ];
@@ -7169,9 +7169,6 @@ DECLARE_API(bpmd)
7169
7169
LPWSTR Filename = (LPWSTR)alloca (MAX_LONGPATH * sizeof (WCHAR));
7170
7170
7171
7171
BOOL bNeedNotificationExceptions = FALSE ;
7172
- #ifdef FEATURE_PAL
7173
- BOOL bNeedModuleNotificationExceptions = FALSE ;
7174
- #endif
7175
7172
7176
7173
if (pMD == NULL )
7177
7174
{
@@ -7190,7 +7187,7 @@ DECLARE_API(bpmd)
7190
7187
MultiByteToWideChar (CP_ACP, 0 , DllName.data , -1 , Filename, MAX_LONGPATH);
7191
7188
}
7192
7189
7193
- // get modules that may need a breakpoint bound
7190
+ // Get modules that may need a breakpoint bound
7194
7191
if ((Status = CheckEEDll ()) == S_OK)
7195
7192
{
7196
7193
if ((Status = LoadClrDebugDll ()) != S_OK)
@@ -7199,23 +7196,25 @@ DECLARE_API(bpmd)
7199
7196
DACMessage (Status);
7200
7197
return Status;
7201
7198
}
7202
- else
7203
- {
7204
- // get the module list
7205
- moduleList = ModuleFromName (fIsFilename ? NULL : DllName.data , &numModule);
7206
-
7207
- // Its OK if moduleList is NULL
7208
- // There is a very normal case when checking for modules after clr is loaded
7209
- // but before any AppDomains or assemblies are created
7210
- // for example:
7211
- // >sxe ld:clr
7212
- // >g
7213
- // ...
7214
- // ModLoad: clr.dll
7215
- // >!bpmd Foo.dll Foo.Bar
7216
- }
7217
- }
7218
-
7199
+ g_bDacBroken = FALSE ; \
7200
+
7201
+ // Get the module list
7202
+ moduleList = ModuleFromName (fIsFilename ? NULL : DllName.data , &numModule);
7203
+
7204
+ // Its OK if moduleList is NULL
7205
+ // There is a very normal case when checking for modules after clr is loaded
7206
+ // but before any AppDomains or assemblies are created
7207
+ // for example:
7208
+ // >sxe ld:clr
7209
+ // >g
7210
+ // ...
7211
+ // ModLoad: clr.dll
7212
+ // >!bpmd Foo.dll Foo.Bar
7213
+ }
7214
+ // If LoadClrDebugDll() succeeded make sure we release g_clrData
7215
+ ToRelease<IXCLRDataProcess> spIDP (g_clrData);
7216
+ ToRelease<ISOSDacInterface> spISD (g_sos);
7217
+ ResetGlobals ();
7219
7218
7220
7219
// we can get here with EE not loaded => 0 modules
7221
7220
// EE is loaded => 0 or more modules
@@ -7308,24 +7307,13 @@ DECLARE_API(bpmd)
7308
7307
g_bpoints.Add (Filename, lineNumber, NULL );
7309
7308
}
7310
7309
bNeedNotificationExceptions = TRUE ;
7311
- #ifdef FEATURE_PAL
7312
- bNeedModuleNotificationExceptions = TRUE ;
7313
- #endif
7314
7310
}
7315
7311
}
7316
7312
else /* We were given a MethodDesc already */
7317
7313
{
7318
7314
// if we've got an explicit MD, then we better have CLR and mscordacwks loaded
7319
- if ((Status = CheckEEDll ()) != S_OK)
7320
- {
7321
- EENotLoadedMessage (Status);
7322
- return Status;
7323
- }
7324
- if ((Status = LoadClrDebugDll ()) != S_OK)
7325
- {
7326
- DACMessage (Status);
7327
- return Status;
7328
- }
7315
+ INIT_API_EE ()
7316
+ INIT_API_DAC ();
7329
7317
7330
7318
DacpMethodDescData MethodDescData;
7331
7319
ExtOut (" MethodDesc = %p\n " , (ULONG64) pMD);
@@ -7371,7 +7359,6 @@ DECLARE_API(bpmd)
7371
7359
else
7372
7360
{
7373
7361
// Must issue a pending breakpoint.
7374
-
7375
7362
if (g_sos->GetMethodDescName (pMD, mdNameLen, FunctionName, NULL ) != S_OK)
7376
7363
{
7377
7364
ExtOut (" Unable to get method name for MethodDesc %p\n " , (ULONG64)pMD);
@@ -7394,13 +7381,6 @@ DECLARE_API(bpmd)
7394
7381
sprintf_s (buffer, _countof (buffer), " sxe -c \" !HandleCLRN\" clrn" );
7395
7382
Status = g_ExtControl->Execute (DEBUG_EXECUTE_NOT_LOGGED, buffer, 0 );
7396
7383
#else
7397
- if (bNeedModuleNotificationExceptions)
7398
- {
7399
- ULONG32 flags = 0 ;
7400
- g_clrData->GetOtherNotificationFlags (&flags);
7401
- flags |= (CLRDATA_NOTIFY_ON_MODULE_LOAD | CLRDATA_NOTIFY_ON_MODULE_UNLOAD);
7402
- g_clrData->SetOtherNotificationFlags (flags);
7403
- }
7404
7384
Status = g_ExtServices->SetExceptionCallback (HandleExceptionNotification);
7405
7385
#endif // FEATURE_PAL
7406
7386
}
@@ -14099,9 +14079,7 @@ HRESULT SetNGENCompilerFlags(DWORD flags)
14099
14079
}
14100
14080
14101
14081
14102
-
14103
14082
// This is an internal-only Apollo extension to save breakpoint/watch state
14104
- #ifndef FEATURE_PAL
14105
14083
DECLARE_API (SaveState)
14106
14084
{
14107
14085
INIT_API_NOEE ();
@@ -14138,16 +14116,14 @@ DECLARE_API(SaveState)
14138
14116
ExtOut (" Session breakpoints and watch expressions saved to %s\n " , filePath.data );
14139
14117
return S_OK;
14140
14118
}
14141
- #endif
14142
14119
14120
+ #endif // FEATURE_PAL
14143
14121
14144
14122
DECLARE_API (StopOnCatch)
14145
14123
{
14146
14124
INIT_API ();
14147
14125
MINIDUMP_NOT_SUPPORTED ();
14148
14126
14149
- CHAR buffer[100 ];
14150
- sprintf_s (buffer, _countof (buffer), " sxe -c \" !HandleCLRN\" clrn" );
14151
14127
g_stopOnNextCatch = TRUE ;
14152
14128
ULONG32 flags = 0 ;
14153
14129
g_clrData->GetOtherNotificationFlags (&flags);
@@ -14157,7 +14133,6 @@ DECLARE_API(StopOnCatch)
14157
14133
return S_OK;
14158
14134
}
14159
14135
14160
-
14161
14136
// This is an undocumented SOS extension command intended to help test SOS
14162
14137
// It causes the Dml output to be printed to the console uninterpretted so
14163
14138
// that a test script can read the commands which are hidden in the markup
@@ -14167,8 +14142,6 @@ DECLARE_API(ExposeDML)
14167
14142
return S_OK;
14168
14143
}
14169
14144
14170
- #endif // FEATURE_PAL
14171
-
14172
14145
// According to kksharma the Windows debuggers always sign-extend
14173
14146
// arguments when calling externally, therefore StackObjAddr
14174
14147
// conforms to CLRDATA_ADDRESS contract.
0 commit comments