Temporary println to help with debugging
@@ -2431,21 +2431,22 @@ impl<'debuginfo> UnitInfo<'debuginfo> {
// Recursively process a child types.
child_variable =
self.process_tree(node, child_variable, core, stack_frame_registers, cache)?;
- if child_variable.debug_error.is_none() {
+ if parent_variable.debug_error.is_none() && child_variable.debug_error.is_none() {
let enumerator_values =
cache.get_children(Some(child_variable.variable_key))?;
// NOTE: hard-coding value of variable.byte_size to 1 ... replace with code if necessary.
let mut buff = [0u8; 1];
- core.read(child_variable.memory_location as u32, &mut buff)?;
+ match core.read(child_variable.memory_location as u32, &mut buff) {
+ Ok(_) => {
let this_enum_const_value = u8::from_le_bytes(buff).to_string();
let enumumerator_value =
match enumerator_values.into_iter().find(|enumerator_variable| {
enumerator_variable.get_value(cache) == this_enum_const_value
}) {
Some(this_enum) => this_enum.name,
- None => {
- VariableName::Named("<ERROR: Unresolved enum value>".to_string())
- }
+ None => VariableName::Named(
+ "<ERROR: Unresolved enum value>".to_string(),
+ ),
};
child_variable.set_value(format!(
"{}::{}",
@@ -2454,6 +2455,17 @@ impl<'debuginfo> UnitInfo<'debuginfo> {
// We don't need to keep these children.
cache.remove_cache_entry_children(child_variable.variable_key)?;
}
+ Err(error) => {
+ println!("Error reading memory for enumeration value: {:?}", error);
+ println!("\tParent: {:?}", parent_variable);
+ println!("\tParent: {:?}", child_variable);
+ }
+ }
+ } else {
+ println!("Failed to resolve enumeration value ...");
+ println!("\tParent: {:?}", parent_variable);
+ println!("\tParent: {:?}", child_variable);
+ }
}
gimli::DW_TAG_array_type => {
// This node is a pointer to the type of data stored in the array, with a direct child that contains the range information.
