Skip to content

Commit

Permalink
GTK USB debugger: Added missing items for one xHCI TRB dialog.
Browse files Browse the repository at this point in the history
TODO: Add remaining items for the last dialog.
Windows USB debugger: Fixed set handling for two items in a TRB dialog.
  • Loading branch information
vruppert committed Jan 20, 2025
1 parent 5960579 commit f2b0ad0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
12 changes: 11 additions & 1 deletion bochs/gui/gtk_usb_debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,17 @@ void xhci_view_trb_dialog(Bit8u type, struct TRB *trb)
entry[e_num] = usbdlg_create_entry_with_label(grid, "New TR Dequeue Pointer", 0, row++);
sprintf(str, "0x" FMT_ADDRX64, (Bit64u)(trb->parameter & ~BX_CONST64(0x0F)));
gtk_entry_set_text(GTK_ENTRY(entry[e_num++]), str);
entry[e_num] = usbdlg_create_entry_with_label(grid, "Stream Context Type", 0, row++);
sprintf(str, "%i", (Bit8u)(trb->parameter >> 1) & 0x07);
gtk_entry_set_text(GTK_ENTRY(entry[e_num++]), str);
checkbox[c_num] = gtk_check_button_new_with_label("Dequeue Cycle Bit");
if (trb->parameter & 1) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox[c_num]), TRUE);
}
gtk_grid_attach(GTK_GRID(grid), checkbox[c_num++], 1, row++, 1, 1);
entry[e_num] = usbdlg_create_entry_with_label(grid, "Stream ID", 0, row++);
sprintf(str, "%i", TRB_GET_STREAM(trb->status));
gtk_entry_set_text(GTK_ENTRY(entry[e_num++]), str);
break;
case FORCE_EVENT:
entry[e_num] = usbdlg_create_entry_with_label(grid, "Event TRB Pointer", 0, row++);
Expand Down Expand Up @@ -1510,7 +1521,6 @@ void xhci_view_trb_dialog(Bit8u type, struct TRB *trb)
// TODO list (missing items before TRB type)
switch (type) {
case SETUP_STAGE: // (6)
case SET_TR_DEQUEUE: // (3)
gtk_grid_attach(GTK_GRID(grid), gtk_label_new("Dialog under construction"), 0, row, 2, 1);
break;
}
Expand Down
6 changes: 5 additions & 1 deletion bochs/gui/win32usb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2130,6 +2130,9 @@ INT_PTR CALLBACK hc_xhci_callback_trb_settrptr(HWND hDlg, UINT msg, WPARAM wPara
sprintf(str, "0x" FMT_ADDRX64, g_trb.parameter & ~BX_CONST64(0x0F));
SetDlgItemText(hDlg, IDC_TRB_DATA_PTR, str);

sprintf(str, "%i", (Bit8u)(g_trb.parameter >> 1) & 0x07);
SetDlgItemText(hDlg, IDC_TRB_SCT, str);

sprintf(str, "%i", TRB_GET_STREAM(g_trb.status));
SetDlgItemText(hDlg, IDC_TRB_STREAMID, str);

Expand All @@ -2140,7 +2143,8 @@ INT_PTR CALLBACK hc_xhci_callback_trb_settrptr(HWND hDlg, UINT msg, WPARAM wPara
sprintf(str, "%i", TRB_GET_TYPE(g_trb.command));
SetDlgItemText(hDlg, IDC_TRB_TYPE, str);

CheckDlgButton(hDlg, IDC_TRB_C, (g_trb.command & 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg, IDC_TRB_DCS, (g_trb.parameter & 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg, IDC_TRB_C, (g_trb.command & 1) ? BST_CHECKED : BST_UNCHECKED);

SetFocus(GetDlgItem(hDlg, IDOK));
return TRUE;
Expand Down

0 comments on commit f2b0ad0

Please sign in to comment.