Skip to content

Commit 44822af

Browse files
committed
Add HandleManager debug statements.
Object memory management is a very important aspect of TPM programming, and can lead to hard to diagnose errors. This adds debug statements for the addition and removal of object handles to assist in tracing when an object is added or removed. Signed-off-by: William Brown <[email protected]>
1 parent 104587c commit 44822af

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tss-esapi/src/context/handle_manager.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ impl HandleManager {
4848
}
4949
}
5050

51+
log::trace!("add handle {:#010X}", handle.value());
5152
let _ = self.open_handles.insert(handle, handle_drop_action);
5253
Ok(())
5354
}
@@ -58,6 +59,7 @@ impl HandleManager {
5859
/// If the handle was not set to be flushed then this will cause an
5960
/// error but the handle will still be removed from the handler.
6061
pub fn set_as_flushed(&mut self, handle: ObjectHandle) -> Result<()> {
62+
log::trace!("set as flushed handle {:#010X}", handle.value());
6163
self.open_handles
6264
.remove(&handle)
6365
.ok_or_else(|| {
@@ -83,6 +85,7 @@ impl HandleManager {
8385
/// If the handle was set to be flushed then this will cause an
8486
/// error but the handle will still be removed from the handler.
8587
pub fn set_as_closed(&mut self, handle: ObjectHandle) -> Result<()> {
88+
log::trace!("set as closed handle {:#010X}", handle.value());
8689
self.open_handles
8790
.remove(&handle)
8891
.ok_or_else(|| {

0 commit comments

Comments
 (0)