From 719dde718303b26e9977cef7df39195cbdf9161d Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 24 Mar 2018 20:21:03 +0100 Subject: [PATCH] feat: Switched over to addr for appropriate interfaces --- Cargo.toml | 1 - src/lib.rs | 2 -- src/protocol/v7.rs | 10 +++++----- tests/test_protocol_v7.rs | 10 +++++----- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 80c97d5e..0a79b1f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,6 @@ url = "1.7.0" serde = "1.0.34" serde_derive = "1.0.34" serde_json = "1.0" -serde_plain = "0.3.0" url_serde = "0.2.0" chrono = { version = "0.4.0", features = ["serde"] } uuid = { version = "0.6.2", features = ["serde", "v4"] } diff --git a/src/lib.rs b/src/lib.rs index 2cf85ff0..5b7eeaa9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,8 +10,6 @@ extern crate serde; #[macro_use] extern crate serde_derive; extern crate serde_json; -#[macro_use] -extern crate serde_plain; extern crate url; extern crate url_serde; extern crate uuid; diff --git a/src/protocol/v7.rs b/src/protocol/v7.rs index 1eb655a8..2fe70f95 100644 --- a/src/protocol/v7.rs +++ b/src/protocol/v7.rs @@ -100,13 +100,13 @@ pub struct FileLocation { pub struct InstructionInfo { /// If known the location of the image. #[serde(skip_serializing_if = "Option::is_none")] - pub image_addr: Option, + pub image_addr: Option, /// If known the location of the instruction. #[serde(skip_serializing_if = "Option::is_none")] - pub instruction_addr: Option, + pub instruction_addr: Option, /// If known the location of symbol. #[serde(skip_serializing_if = "Option::is_none")] - pub symbol_addr: Option, + pub symbol_addr: Option, } /// Represents template debug info. @@ -407,11 +407,11 @@ pub struct AppleDebugImage { /// Alternatively a macho cpu subtype. pub cpu_subtype: Option, /// The starting address of the image. - pub image_addr: u64, + pub image_addr: Addr, /// The size of the image in bytes. pub image_size: u64, /// The address where the image is loaded at runtime. - pub image_vmaddr: u64, + pub image_vmaddr: Addr, /// The unique UUID of the image. pub uuid: Uuid, } diff --git a/tests/test_protocol_v7.rs b/tests/test_protocol_v7.rs index 0b129018..bef3b97e 100644 --- a/tests/test_protocol_v7.rs +++ b/tests/test_protocol_v7.rs @@ -460,9 +460,9 @@ fn test_full_exception_stacktrace() { package: Some("hello.whl".into()), module: Some("hello".into()), instruction_info: v7::InstructionInfo { - image_addr: Some(0), - instruction_addr: Some(0), - symbol_addr: Some(0), + image_addr: Some(v7::Addr(0)), + instruction_addr: Some(v7::Addr(0)), + symbol_addr: Some(v7::Addr(0)), } }, ], @@ -481,8 +481,8 @@ fn test_full_exception_stacktrace() { \"hello.py\",\"abs_path\":\"/app/hello.py\",\"lineno\":7,\"\ colno\":42,\"pre_context\":[\"foo\",\"bar\"],\"context_line\":\ \"hey hey hey\",\"post_context\":[\"foo\",\"bar\"],\"in_app\":true,\ - \"vars\":{\"var\":\"value\"},\"image_addr\":0,\"instruction_addr\":0,\ - \"symbol_addr\":0}],\"frames_omitted\":[1,2]}}]}}" + \"vars\":{\"var\":\"value\"},\"image_addr\":\"0x0\",\"instruction_addr\":\"0x0\",\ + \"symbol_addr\":\"0x0\"}],\"frames_omitted\":[1,2]}}]}}" ); }