diff --git a/CHANGELOG.md b/CHANGELOG.md index fb48142..3ed2811 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 1.80.0 - Pending +## 1.80.0 - 2024-07-26 ### Versions diff --git a/Cargo.lock b/Cargo.lock index ed2e781..8597f99 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -696,7 +696,7 @@ dependencies = [ [[package]] name = "firedbg-cli" -version = "1.79.0" +version = "1.80.0" dependencies = [ "anstyle", "anyhow", @@ -728,7 +728,7 @@ dependencies = [ [[package]] name = "firedbg-rust-debugger" -version = "1.79.0" +version = "1.80.0" dependencies = [ "anyhow", "dotenvy", @@ -769,7 +769,7 @@ dependencies = [ [[package]] name = "firedbg-stream-indexer" -version = "1.79.0" +version = "1.80.0" dependencies = [ "anyhow", "async-trait", diff --git a/command/Cargo.toml b/command/Cargo.toml index 58673d1..5a5a18a 100644 --- a/command/Cargo.toml +++ b/command/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "firedbg-cli" -version = "1.79.0" +version = "1.80.0" edition = "2021" license = "MIT OR Apache-2.0" authors = [ diff --git a/debugger/Cargo.toml b/debugger/Cargo.toml index 5ad5ccf..7256642 100644 --- a/debugger/Cargo.toml +++ b/debugger/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "firedbg-rust-debugger" -version = "1.79.0" +version = "1.80.0" edition = "2021" license = "MIT OR Apache-2.0" build = "build.rs" diff --git a/debugger/src/debugger/return_value.rs b/debugger/src/debugger/return_value.rs index 6e97855..0338c87 100644 --- a/debugger/src/debugger/return_value.rs +++ b/debugger/src/debugger/return_value.rs @@ -1160,7 +1160,24 @@ pub(super) fn write_return_value( { if left_type.is_float() && right_type.is_float() && left_type != right_type { - // a pair of (f32, f64) will not be passed by register + let (left_value, right_value) = if left_size >= right_size { + ( + get_float_from_xmm0(rwriter, &left_type)?, + get_float_from_xmm1(rwriter, &right_type)?, + ) + } else { + ( + get_float_from_xmm1(rwriter, &left_type)?, + get_float_from_xmm0(rwriter, &right_type)?, + ) + }; + + let value = rwriter.struct_v( + return_type.name(), + [(left_name, left_value), (right_name, right_value)].into_iter(), + ); + event.write_value(rwriter, RETVAL, value.as_bytes()); + return Ok(()); } else { log::trace!("{} rax, rdx", return_type.name()); let left_value = if left_type.is_primitive() { diff --git a/debugger/testcases/return_struct.rs b/debugger/testcases/return_struct.rs index d5efc92..0ec0deb 100644 --- a/debugger/testcases/return_struct.rs +++ b/debugger/testcases/return_struct.rs @@ -11,7 +11,13 @@ struct Vector { y: f64, } #[derive(Debug)] -struct Coeff(f32, f64); +struct Coeff36(f32, f64); +#[derive(Debug)] +struct Coeff63(f64, f32); +#[derive(Debug)] +struct Coeff32(f32, f32); +#[derive(Debug)] +struct Coeff64(f64, f64); #[derive(Debug)] struct Mixed { x: i32, @@ -40,10 +46,13 @@ fn ret_2() -> (Point, i32) { bb((Point { x: 1, y: 2 }, 3)) } fn ret_3() -> Vector { bb(Vector { x: 1.1, y: 2.1 }) } fn ret_4() -> Mixed { bb(Mixed { x: 4, y: 0.1 }) } fn ret_5() -> Wrapper { bb(Wrapper{ i: Point { x: 3, y: 4 } }) } -fn ret_6() -> Coeff { bb(Coeff(1.1, 2.2)) } -fn ret_7() -> MapPoint { bb(MapPoint { u: Anchor(-22), v: Anchor(44) }) } -fn ret_8() -> Label { bb(Label { s: "hello" }) } -fn ret_9() -> Long { bb(Long(22_222_222_222_222_222_222)) } +fn ret_6() -> Coeff36 { bb(Coeff36(1.1, 2.2)) } +fn ret_7() -> Coeff63 { bb(Coeff63(64.1, 32.2)) } +fn ret_8() -> Coeff32 { bb(Coeff32(32.1, 32.2)) } +fn ret_9() -> Coeff64 { bb(Coeff64(64.1, 64.2)) } +fn ret_10() -> MapPoint { bb(MapPoint { u: Anchor(-22), v: Anchor(44) }) } +fn ret_11() -> Label { bb(Label { s: "hello" }) } +fn ret_12() -> Long { bb(Long(22_222_222_222_222_222_222)) } fn main() { let r = ret_1(); dbg!(r); @@ -55,5 +64,8 @@ fn main() { let r = ret_7(); dbg!(r); let r = ret_8(); dbg!(r); let r = ret_9(); dbg!(r); + let r = ret_10(); dbg!(r); + let r = ret_11(); dbg!(r); + let r = ret_12(); dbg!(r); println!(); } diff --git a/debugger/tests/return_struct.rs b/debugger/tests/return_struct.rs index 890db77..aa3b710 100644 --- a/debugger/tests/return_struct.rs +++ b/debugger/tests/return_struct.rs @@ -18,7 +18,7 @@ async fn main() -> Result<()> { producer.end().await?; - for i in 0..20 { + for i in 0..26 { let payload = consumer.next().await?.message().into_bytes(); let event = EventStream::read_from(Bytes::from(payload)); // println!("#{i} {:?}", event); @@ -44,14 +44,20 @@ async fn main() -> Result<()> { 10 => r#"{"type":"Struct","typename":"return_struct::Wrapper","fields":{"x":{"type":"Prim","typename":"i32","value":3},"y":{"type":"Prim","typename":"i32","value":4}}}"#, 12 => - r#"{"type":"Struct","typename":"return_struct::Coeff","fields":{"0":{"type":"Prim","typename":"f32","value":1.1},"1":{"type":"Prim","typename":"f64","value":2.2}}}"#, + r#"{"type":"Struct","typename":"return_struct::Coeff36","fields":{"0":{"type":"Prim","typename":"f32","value":1.1},"1":{"type":"Prim","typename":"f64","value":2.2}}}"#, 14 => - r#"{"type":"Struct","typename":"return_struct::MapPoint","fields":{"u":{"type":"Prim","typename":"i64","value":"-22"},"v":{"type":"Prim","typename":"i64","value":"44"}}}"#, + r#"{"type":"Struct","typename":"return_struct::Coeff63","fields":{"0":{"type":"Prim","typename":"f64","value":64.1},"1":{"type":"Prim","typename":"f32","value":32.2}}}"#, 16 => - r#"{"type":"Struct","typename":"return_struct::Label","fields":{"s":{"type":"String","typename":"&str","value":"hello"}}}"#, + r#"{"type":"Struct","typename":"return_struct::Coeff32","fields":{"0":{"type":"Prim","typename":"f32","value":32.1},"1":{"type":"Prim","typename":"f32","value":32.2}}}"#, 18 => + r#"{"type":"Struct","typename":"return_struct::Coeff64","fields":{"0":{"type":"Prim","typename":"f64","value":64.1},"1":{"type":"Prim","typename":"f64","value":64.2}}}"#, + 20 => + r#"{"type":"Struct","typename":"return_struct::MapPoint","fields":{"u":{"type":"Prim","typename":"i64","value":"-22"},"v":{"type":"Prim","typename":"i64","value":"44"}}}"#, + 22 => + r#"{"type":"Struct","typename":"return_struct::Label","fields":{"s":{"type":"String","typename":"&str","value":"hello"}}}"#, + 24 => r#"{"type":"Struct","typename":"return_struct::Long","fields":{"0":{"type":"Prim","typename":"i128","value":"22222222222222222222"}}}"#, - 19 => r#"{"type":"Unit"}"#, + 25 => r#"{"type":"Unit"}"#, i => panic!("Unexpected i {i}"), } ); diff --git a/indexer/Cargo.toml b/indexer/Cargo.toml index 1c9aa4b..a780b20 100644 --- a/indexer/Cargo.toml +++ b/indexer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "firedbg-stream-indexer" -version = "1.79.0" +version = "1.80.0" edition = "2021" license = "MIT OR Apache-2.0" authors = [ @@ -28,7 +28,7 @@ tokio = { version = "1", optional = true } pretty_assertions = { version = "1", optional = true } async-trait = { version = "0.1", optional = true } # workspace -firedbg-rust-debugger = { path = "../debugger", version = "1.79.0", default-features = false } +firedbg-rust-debugger = { path = "../debugger", version = "1.80.0", default-features = false } [features] # The base feature only exports the sea-orm entities