-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Adding missing structs from linux/user.h #599
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
Conversation
Added equivalents for user_regs_struct and user_struct from linux/user.h for x86 and x86_64.
Thanks for the PR! Looks like there's some style errors though? Could you also back out the version bump? That typically happens through dedicated PRs. |
Fixed trailing whitespace in x86.rs and reverted the minor version number in the Cargo.toml
Done and done. Any thoughts on constants for the EFLAGS register? |
Forgot to update cargo.lock before prior commit.
so there appears to still be some errors, it seems some of the generated tests fail? And also "error: requires |
Ah sorry I missed that! If these are constants in glibc or in standard C headers, sure! Otherwise though I'd recommend a separate crate for now. For the test failures the nightly failures are ok (I'll work around them elsewhere) but for there's a few other non-nightly failures I think? |
@xd009642 To test on your local PC you can run You may need to change the test to include Note that |
Ah okay, thanks @philipc, I probably won't have a chance to do this until Tuesday as I'm away from my home pc. |
Fixed the issues that prevented the libc_tests that are generated from passing. Also, fixed struct names and types to be representative of the linux source files.
Right I've addressed the issues and everything passes on my home machine. Hopefully it should all be good with travis now. Sorry about the delay! |
@bors: r+ Looks great, thanks! |
📌 Commit 6acbf87 has been approved by |
Adding missing structs from linux/user.h Adding structs from linux/user.h (or sys/user.h depending on OS version). This adds the linux user_regs_struct and user struct from sys/user.h into libc for x86 and x86_64. Also, bumping the version number. As an aside, I was wondering if this was also the right place to add the bit offsets for the [EFLAGS register ](https://en.wikibooks.org/wiki/X86_Assembly/X86_Architecture#EFLAGS_Register)? These aren't defined anywhere in the linux system libraries instead the definition seems to just be in the x86 and x86_64 documentation but they are useful for anyone looking to interpret eflags. If libc is the right place for these constants I'd like the opportunity to add them before it's merged in. :)
☀️ Test successful - status-appveyor, status-travis |
Copy structs from bits/user.h for musl x86_64 While statically compiling a binary with `musl`, I ran into the following error regarding a missing struct: ``` error[E0412]: cannot find type `user_regs_struct` in crate `libc` --> src/debug.rs:37:32 | 37 | fn show_user_regs(regs: &libc::user_regs_struct) -> String { | ^^^^^^^^^^^^^^^^ not found in `libc` ``` This struct was previously added for `glibc` in #599, but was never added to `musl`, despite the data format being the same in both. This fix simply copies `user_regs_struct` into the proper location within the `musl` files.
Copy structs from bits/user.h for musl x86_64 While statically compiling a binary with `musl`, I ran into the following error regarding a missing struct: ``` error[E0412]: cannot find type `user_regs_struct` in crate `libc` --> src/debug.rs:37:32 | 37 | fn show_user_regs(regs: &libc::user_regs_struct) -> String { | ^^^^^^^^^^^^^^^^ not found in `libc` ``` This struct was previously added for `glibc` in #599, but was never added to `musl`, despite the data format being the same in both. This fix simply copies `user_regs_struct` into the proper location within the `musl` files.
Adding structs from linux/user.h (or sys/user.h depending on OS version). This adds the linux user_regs_struct and user struct from sys/user.h into libc for x86 and x86_64. Also, bumping the version number.
As an aside, I was wondering if this was also the right place to add the bit offsets for the EFLAGS register ? These aren't defined anywhere in the linux system libraries instead the definition seems to just be in the x86 and x86_64 documentation but they are useful for anyone looking to interpret eflags. If libc is the right place for these constants I'd like the opportunity to add them before it's merged in. :)