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

Syscall one-off refactoring #1310

Merged
merged 8 commits into from Sep 12, 2014

Conversation

froydnj
Copy link
Contributor

@froydnj froydnj commented Sep 11, 2014

This series implements some of @rocallahan's earlier ideas on architecture-neutral replacements for SYS_foo constants. It handles just about everything, except for some SYS_socketcall constants that need some better infrastructure in syscall_defs.h (we need to be able to talk about syscalls defined on x86-64 that aren't defined on x86--right now we only go the other direction) and some weird checks in emufs.cc that I'm not immediately sure how to architecturialize (sp?).

@froydnj
Copy link
Contributor Author

froydnj commented Sep 11, 2014

Updated branch because I failed to rebase on top of roc's recent changes. Also adding some handling for things I missed the first time around.

I'm seeing consistent test failures in my VM for the cpuid tests; I assume that's related to the changes to check for the existence of the geteuid32 syscall. If that's true, that makes developing in a VM very unpleasant.

@rocallahan
Copy link
Collaborator

If that's true, that makes developing in a VM very unpleasant.

What do you mean?

// ${SYSCALL} must exist on the given architecture.

#define HAS_SYSCALL(_name) \
inline bool has_ ## _name(SupportedArch arch) \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, I think this should be has_##_name##_syscall

@rocallahan
Copy link
Collaborator

Generally this looks really good, by the way.

Older systems like x86 had an mmap syscall that took a byte offset for
the sixth argument.  However, doing so meant that large files (> 4GB)
couldn't be mmap'd.  To address this, a replacement mmap2 syscall was
created that took its offset in units of pages, rather than bytes.

x86-64, however, has no problem with using byte offsets, and therefore
has no mmap2 syscall.  So we need to use the appropriate syscall for the
architecture of the process we're tracing when making remote syscalls.
@froydnj froydnj force-pushed the syscall-one-off-refactoring branch 3 times, most recently from 05ba075 to caaebd8 Compare September 12, 2014 21:00
@rocallahan rocallahan merged commit caaebd8 into rr-debugger:master Sep 12, 2014
@froydnj froydnj deleted the syscall-one-off-refactoring branch September 26, 2014 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants