manticore icon indicating copy to clipboard operation
manticore copied to clipboard

Track error conversion locations using #[track_caller]

Open kesyog opened this issue 3 years ago • 1 comments

#123 added a crate-wide Error type and some helper macros to add logs gated by the log feature. One could use the new macros everywhere to provide additional context to errors for debugging. But it might be possible to use #[track_caller] and core::panic::Location to automatically track and log where errors originate and where they get converted to other error types, eliminating a bunch of tedious work. Investigate this and implement if possible.

References

  • https://github.com/rust-lang/rust/issues/87401
  • https://github.com/lowRISC/manticore/pull/123#discussion_r836963963

kesyog avatar Mar 30 '22 17:03 kesyog

I'll take this on

kesyog avatar Mar 30 '22 17:03 kesyog