MCPcopy Create free account
hub / github.com/SeaQL/FireDBG.for.Rust / read_array

Function read_array

debugger/src/value/writer.rs:595–609  ·  view source on GitHub ↗
(ptr: &SBValue, len: u64)

Source from the content-addressed store, hash-verified

593}
594
595fn read_array(ptr: &SBValue, len: u64) -> Result<SBValue> {
596 if !ptr.is_valid() {
597 return Err(WriteErr);
598 }
599 let arr_t = ptr.type_().pointee_type().array_type(len);
600 let addr = ptr.dereference().address().ok_or(WriteErr)?;
601 let value = ptr
602 .target()
603 .create_value_from_address("<arr>", &addr, &arr_t);
604 if value.is_valid() {
605 Ok(value)
606 } else {
607 Err(WriteErr)
608 }
609}
610
611pub(crate) fn read_str(v: &SBValue) -> Result<Vec<u8>> {
612 let ptr = v.child_at_index(0);

Callers 1

write_valueFunction · 0.85

Calls 8

array_typeMethod · 0.80
pointee_typeMethod · 0.80
dereferenceMethod · 0.80
is_validMethod · 0.45
type_Method · 0.45
addressMethod · 0.45
targetMethod · 0.45

Tested by

no test coverage detected