1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-19 13:08:14 +00:00

WIP - better debug output

This commit is contained in:
grdddj 2023-01-18 11:57:43 +01:00
parent d6ef1d0f8c
commit a86c29cfe5
5 changed files with 13 additions and 6 deletions

View File

@ -169,8 +169,6 @@ where
}
}
// DEBUG-ONLY SECTION BELOW
#[cfg(feature = "ui_debug")]
impl<T> crate::trace::Trace for ScrollableFrame<T>
where
@ -179,7 +177,7 @@ where
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
t.open("ScrollableFrame");
t.field("title", &self.title);
t.field("scrollbar", &self.title);
t.field("scrollbar", &self.scrollbar);
t.field("content", &self.content);
t.close();
}

View File

@ -132,8 +132,6 @@ impl Component for Lockscreen {
impl crate::trace::Trace for Homescreen {
fn trace(&self, d: &mut dyn crate::trace::Tracer) {
d.open("Homescreen");
d.kw_pair("active_page", "0");
d.kw_pair("page_count", "1");
d.field("label", &self.label.as_ref());
d.close();
}

View File

@ -244,6 +244,7 @@ impl crate::trace::Trace for PinEntry {
t.open("PinEntry");
// NOTE: `show_real_pin` was not able to be transferred,
// as it is true only for a very small amount of time
t.title(self.prompt.as_ref());
t.kw_pair("textbox", self.textbox.content());
self.report_btn_actions(t);
t.field("choice_page", &self.choice_page);

View File

@ -242,3 +242,13 @@ impl Component for ScrollBar {
self.paint_horizontal();
}
}
#[cfg(feature = "ui_debug")]
impl crate::trace::Trace for ScrollBar {
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
t.open("ScrollBar");
t.field("page_count", &self.page_count);
t.field("active_page", &self.active_page);
t.close();
}
}

View File

@ -37,7 +37,7 @@ B = messages.ButtonRequestType
class InputFlowBase:
def __init__(self, client: Client):
self.client = client
self.debug = client.debug
self.debug: DebugLink = client.debug
self.layout = client.debug.wait_layout
def model(self) -> Optional[str]: