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

Rewrite system_calls.pl in Ruby #27

Merged
merged 16 commits into from
May 10, 2015

Conversation

perlun
Copy link
Contributor

@perlun perlun commented May 10, 2015

The idea is to get rid of an unnecessary Perl dependency. Since we already rely on Ruby & Rake for the build process, we might as well use it here. It is after all a very nice dynamic/scripting language.

create_wrapper_c system_calls
create_include_storm_system_calls_h system_calls
create_system_calls_auto_c system_calls
create_include_storm_ia32_wrapper_h system_calls
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could arguably be done even cleaner and nicer using ERB syntax. I would be very glad to incorporate changes in that direction; PR:s are welcome. However, for now I just did a pretty much 1-to-1 conversion (but changing to more Rubish syntax (.each etc), and using a hash instead of an plan array etc). But changing to ERB would be even nicer. I consider this "good enough" for now though.


"popl %edi\n"
"popl %esi\n"
"popl %ebp\n"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The indentation was "off by one" in the output that the old script used to create, so I fixed that while I was at it.

@perlun perlun changed the title WIP: Rewrite system_calls.pl in ruby Rewrite system_calls.pl in ruby May 10, 2015
@perlun
Copy link
Contributor Author

perlun commented May 10, 2015

@CaspecoHenrik and/or @johannesl, are you happy with merging? I've tested this and I get the same behavior as before (i.e. the bug noted in #21. 😉) So I think we're safe from a "functionality equivalence" POV)

@johannesl
Copy link
Contributor

Nice! Can you confirm this works on the standard Ruby version in the latest OS X? Which is:
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]

@perlun
Copy link
Contributor Author

perlun commented May 10, 2015

Nice!

Thanks. 😄

Can you confirm this works on the standard Ruby version in the latest OS X? Which is: ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]

It was actually the one I used when developing it, so yes, it works. I also fixed now so that it works with Ruby 1.9.3 (so it can run in the Vagrant-provided VM, for instance).

Taking your comment as approval, so merging now. 😄 Thanks!

perlun added a commit that referenced this pull request May 10, 2015
…l-in-ruby

Rewrite system_calls.pl in ruby
@perlun perlun merged commit 75d40a0 into master May 10, 2015
@perlun perlun deleted the feature/rewrite-system-calls.pl-in-ruby branch May 10, 2015 11:27
@perlun perlun changed the title Rewrite system_calls.pl in ruby Rewrite system_calls.pl in Ruby May 10, 2015
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.

2 participants