Windows: explicitly cast constants to `DWORD`

STATUS_SINGLE_STEP and STATUS_BREAKPOINT are defined as 0x8------ which
is negative and thus can't be implicitly narrowed to a DWORD which is
unsigned.  The value is defined differently across winnt.h and ntstatus.h.

Patch by Gwen Mittertreiner!

llvm-svn: 369788
This commit is contained in:
Saleem Abdulrasool 2019-08-23 17:58:53 +00:00
parent 05f56a1ddd
commit e7823a5316
1 changed files with 2 additions and 2 deletions

View File

@ -430,7 +430,7 @@ NativeProcessWindows::OnDebugException(bool first_chance,
ExceptionResult result = ExceptionResult::SendToApplication;
switch (record.GetExceptionCode()) {
case STATUS_SINGLE_STEP:
case DWORD(STATUS_SINGLE_STEP):
case STATUS_WX86_SINGLE_STEP:
StopThread(record.GetThreadID(), StopReason::eStopReasonTrace);
SetState(eStateStopped, true);
@ -438,7 +438,7 @@ NativeProcessWindows::OnDebugException(bool first_chance,
// Continue the debugger.
return ExceptionResult::MaskException;
case STATUS_BREAKPOINT:
case DWORD(STATUS_BREAKPOINT):
case STATUS_WX86_BREAKPOINT:
if (FindSoftwareBreakpoint(record.GetExceptionAddress())) {
LLDB_LOG(log, "Hit non-loader breakpoint at address {0:x}.",