Fix stop_reason reporting
authorLaurent Morichetti <laurent.morichetti@amd.com>
Tue, 28 Apr 2020 21:34:18 +0000 (14:34 -0700)
committerLaurent Morichetti <laurent.morichetti@amd.com>
Wed, 6 May 2020 20:50:56 +0000 (13:50 -0700)
If the dbgapi stop_reason has both exceptions and a breakpoint or
single-step, we should report the exceptions. Also, add debug_trap,
assert_trap, and other_trap as reasons to report a SIGTRAP.

Change-Id: I1b3c18aff894cea0818f35f76b66de10724ebc24

gdb/rocm-tdep.c

index 4cd14a6b15dd1f7e7ea9c5dd54f263cfc3ea0922..817320a5d7de449296a07bc783523eec4ae44871 100644 (file)
@@ -857,11 +857,7 @@ rocm_target_ops::wait (ptid_t ptid, struct target_waitstatus *ws,
     }
   ws->kind = TARGET_WAITKIND_STOPPED;
 
-  if (stop_reason
-      & (AMD_DBGAPI_WAVE_STOP_REASON_BREAKPOINT
-         | AMD_DBGAPI_WAVE_STOP_REASON_SINGLE_STEP))
-    ws->value.sig = GDB_SIGNAL_TRAP;
-  else if (stop_reason & AMD_DBGAPI_WAVE_STOP_REASON_MEMORY_VIOLATION)
+  if (stop_reason & AMD_DBGAPI_WAVE_STOP_REASON_MEMORY_VIOLATION)
     ws->value.sig = GDB_SIGNAL_SEGV;
   else if (stop_reason
            & (AMD_DBGAPI_WAVE_STOP_REASON_FP_INPUT_DENORMAL
@@ -872,6 +868,13 @@ rocm_target_ops::wait (ptid_t ptid, struct target_waitstatus *ws,
               | AMD_DBGAPI_WAVE_STOP_REASON_FP_INVALID_OPERATION
               | AMD_DBGAPI_WAVE_STOP_REASON_INT_DIVIDE_BY_0))
     ws->value.sig = GDB_SIGNAL_FPE;
+  else if (stop_reason
+      & (AMD_DBGAPI_WAVE_STOP_REASON_BREAKPOINT
+         | AMD_DBGAPI_WAVE_STOP_REASON_SINGLE_STEP
+         | AMD_DBGAPI_WAVE_STOP_REASON_DEBUG_TRAP
+         | AMD_DBGAPI_WAVE_STOP_REASON_ASSERT_TRAP
+         | AMD_DBGAPI_WAVE_STOP_REASON_TRAP))
+    ws->value.sig = GDB_SIGNAL_TRAP;
   else
     ws->value.sig = GDB_SIGNAL_0;
 
This page took 0.02551 seconds and 4 git commands to generate.