Skip to content

Commit

Permalink
1.80.0
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Jul 25, 2024
1 parent bbbfb22 commit 52bc9a3
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 1.80.0 - Pending
## 1.80.0 - 2024-07-26

### Versions

Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion command/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion debugger/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
19 changes: 18 additions & 1 deletion debugger/src/debugger/return_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
22 changes: 17 additions & 5 deletions debugger/testcases/return_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<Point> { 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);
Expand All @@ -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!();
}
16 changes: 11 additions & 5 deletions debugger/tests/return_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -44,14 +44,20 @@ async fn main() -> Result<()> {
10 =>
r#"{"type":"Struct","typename":"return_struct::Wrapper<return_struct::Point>","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}"),
}
);
Expand Down
4 changes: 2 additions & 2 deletions indexer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 52bc9a3

Please sign in to comment.