Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

output! macro in console_output.rs uses writeln! instead of intended write! #41

Closed
DrChat opened this issue Mar 6, 2021 · 5 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@DrChat
Copy link
Contributor

DrChat commented Mar 6, 2021

#[macro_export]
macro_rules! output {
($console_output:expr, $($args:tt)*) => {{
use std::fmt::Write;
let _ = writeln!($console_output, $($args)*);
}};
}

This causes newlines to be printed to the GDB console when using the output! macro.

@daniel5151
Copy link
Owner

daniel5151 commented Mar 6, 2021

Good catch!

I'll try to find some time this weekend to publish gdbstub 0.4.4 that fixes this issue.

In the meantime, you can work around this by bypassing the macro and calling write! directly.

Thanks for reporting it!

@daniel5151 daniel5151 self-assigned this Mar 6, 2021
@daniel5151 daniel5151 added the bug Something isn't working label Mar 6, 2021
@DrChat
Copy link
Contributor Author

DrChat commented Mar 6, 2021

Sounds good - appreciate it!

@daniel5151
Copy link
Owner

The fix is in, and included in the just-published gdbstub 0.4.4!

@DrChat
Copy link
Contributor Author

DrChat commented Mar 7, 2021

Appreciate the quick turnaround!

@daniel5151
Copy link
Owner

daniel5151 commented Mar 7, 2021

Yeah, no problem!
It's not like the project is active and popular enough to require rolling releases, so I may as well push out fixes as they come in 😄


By the way, if you get the chance, let me know what you think about gdbstub by dropping a comment on #31! I know the library's structure is a bit... unorthadox compared to other Rust libraries, so any and all feedback about the API would be much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants