Issue #1:
Thread 3 "bit_extract_kernel" hit Breakpoint 1, bit_extract_kernel ()
(gdb) add-inferior
[New inferior 2]
Added inferior 2 on connection 1 (native)
(gdb) info threads
amd_dbgapi_wave_list failed (rc=-14)
An inferior may not have yet been attached when update_thread_list is
called. The inferior should be skipped if its process_id is null.
Issue #2:
Thread 3 "bit_extract_kernel" hit Breakpoint 1, bit_extract_kernel ()
(gdb) add-inferior -exec /bin/ls
[New inferior 2]
Added inferior 2 on connection 1 (native)
Reading symbols from /bin/ls...
(No debugging symbols found in /bin/ls)
(gdb) inferior 2
[Switching to inferior 2 [<null>] (/bin/ls)]
(gdb) run
Starting program: /bin/ls
Warning:
Cannot insert breakpoint -8.
Cannot access memory at address 0x7fffedaa265b
Internal ROCgdbapi breakpoints should not be re-evaluated for new
inferiors. They are inserted for a specific process_id, and removed
when the process is detached.
gdb/ChangeLog:
* gdb/rocm-tdep.c: Skip inferiors without process_ids. Override
breakpoint_ops::re_set for rocm internal breakpoints to
disable re-evaluation.
Change-Id: Icb0be93b74aae1cf80c7f1657cf6d01e16eb8efb
return get_rocm_inferior_info (inferior)->process_id;
}
return get_rocm_inferior_info (inferior)->process_id;
}
+static void
+rocm_breakpoint_re_set (struct breakpoint *b)
+{
+}
+
static void
rocm_breakpoint_check_status (struct bpstats *bs)
{
static void
rocm_breakpoint_check_status (struct bpstats *bs)
{
{
for (inferior *inf : all_inferiors ())
{
{
for (inferior *inf : all_inferiors ())
{
- amd_dbgapi_process_id_t process_id = get_amd_dbgapi_process_id (inf);
+ amd_dbgapi_process_id_t process_id;
amd_dbgapi_wave_id_t *wave_list;
size_t count;
amd_dbgapi_wave_id_t *wave_list;
size_t count;
+ process_id = get_amd_dbgapi_process_id (inf);
+ if (process_id.handle == AMD_DBGAPI_PROCESS_NONE.handle)
+ {
+ /* The inferior may not be attached yet. */
+ continue;
+ }
+
amd_dbgapi_changed_t changed;
amd_dbgapi_status_t status;
if ((status
= amd_dbgapi_wave_list (process_id, &count, &wave_list, &changed))
!= AMD_DBGAPI_STATUS_SUCCESS)
amd_dbgapi_changed_t changed;
amd_dbgapi_status_t status;
if ((status
= amd_dbgapi_wave_list (process_id, &count, &wave_list, &changed))
!= AMD_DBGAPI_STATUS_SUCCESS)
- error (_ ("amd_dbgapi_wave_list failed (rc=%d"), status);
+ error (_ ("amd_dbgapi_wave_list failed (rc=%d)"), status);
if (changed == AMD_DBGAPI_CHANGED_NO)
continue;
if (changed == AMD_DBGAPI_CHANGED_NO)
continue;
for (auto &&tid : threads)
{
ptid_t wave_ptid (inf->pid, 1, tid);
for (auto &&tid : threads)
{
ptid_t wave_ptid (inf->pid, 1, tid);
+ /* FIXME: is this really needed?
amd_dbgapi_wave_state_t state;
if (amd_dbgapi_wave_get_info (
process_id, get_amd_dbgapi_wave_id (wave_ptid),
AMD_DBGAPI_WAVE_INFO_STATE, sizeof (state), &state)
!= AMD_DBGAPI_STATUS_SUCCESS)
amd_dbgapi_wave_state_t state;
if (amd_dbgapi_wave_get_info (
process_id, get_amd_dbgapi_wave_id (wave_ptid),
AMD_DBGAPI_WAVE_INFO_STATE, sizeof (state), &state)
!= AMD_DBGAPI_STATUS_SUCCESS)
add_thread_silent (inf->process_target (), wave_ptid);
set_running (inf->process_target (), wave_ptid, 1);
add_thread_silent (inf->process_target (), wave_ptid);
set_running (inf->process_target (), wave_ptid, 1);
{
rocm_breakpoint_ops = bkpt_breakpoint_ops;
rocm_breakpoint_ops.check_status = rocm_breakpoint_check_status;
{
rocm_breakpoint_ops = bkpt_breakpoint_ops;
rocm_breakpoint_ops.check_status = rocm_breakpoint_check_status;
+ rocm_breakpoint_ops.re_set = rocm_breakpoint_re_set;
}
auto it = info->breakpoint_map.find (breakpoint_id.handle);
}
auto it = info->breakpoint_map.find (breakpoint_id.handle);