-
Notifications
You must be signed in to change notification settings - Fork 279
Frontend Config + One grammar system + -p command line option #512
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
Frontend Config + One grammar system + -p command line option #512
Conversation
This basically ensures that the complete name of argument shows up everywhere, rather than stripped with plugin name (for example, `--taint-ptr` shows up now, rather than `--ptr`). This will help when moving to the one-grammar approach. This also adds the `is_plugin` boolean which makes checking for plugin or not simple, and makes sure that things are set up correctly (for example, at deprecation, for front ends). WARNING! This breaks help pages (i.e. plugins `--<plugin>-help` no longer works). This will be fixed in a commit soon.
This basically allows frontends to be written in the exact same way as plugins while still making sure that the grammar is evaluated correctly
Also improve error handling
|
||
type action = Keep | Drop | ||
|
||
let filter_option options prefix = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we still need this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the filter_option
function exists to get rid of --no-PLUGIN
type of arguments. If we remove it, then we'll need to add in --no-taint
, --no-propagate-taint
, --no-ida
, etc (i.e. for every plugin). While this would be an easy change to make, it'd cause further bloat to the man page. Are we sure we want to do this? If so, then I can make that change, and remove this completely.
Some observed bugs:
|
As for Printing format choosing - I'm going to have to look into it again. I am unable to reproduce the bug on my system. I'll try getting on a completely clean build soon, to see if that ends up reproducing the bug. Manpage - didn't we decide not to put it in the main manpage (since the manpage explanations can be seen with |
One of the reasons why it was made on a frontend side is because, this command must be evaluated only when all plugins are loaded. At the time of adding this option, there were no such mechanism, that why I added this option, that naturally belongs to the
It might be because, you have a different order of loading... or you forgot to push some fixes ;)
Did we? Maybe this indeed would be a good idea. As we still have all possible options (so we satisfy the greppable requirement). And we can get an extended information by querying specific plugin for the help, e.g., |
Conflicts: src/bap_cmdline_terms.ml src/bap_main.ml src/bap_mc.ml
@gitoleg, you're the new owner of this PR, so make sure that it is merged, or at least the necessary parts of it are merged. We still have the configuration system broken, and we need it fixed. |
Let's admit we won't merge it and it anyway bitrotten beyond repair. We will be inspired with this code when we will release BAP 2.0. |
The master branch is already restricted from pushes so the code can reach the master branch only through a pull requested. We don't want to the same work twice. Also removes (the commented) windows line, we will return it back, once we will have time for that, see also BinaryAnalysisPlatform#512
* Try to use GitHub Actions * Fix LLVM installation for Homebrew * Disable install for now * MacOS fixes * Disable Windows for now * Fix CI * fixes CI, build on ubuntu only * launch unit tests after bap installed * try set cache home dir via env * wip * wip * Grammar eye-candy. * Try MacOS again * switches to a non-alternate llvm, removes the LLVM_CONFIG step First of all, `/usr/local/opt/llvm/bin/llvm-config` is llvm-config of LLVM that is shipped with MacOS and which is stripped from any non-native targets so we can't use it. The requested llvm@9 is installed at `/usr/local/opt/llvm@9` and is not symlinked to `/usr/local` because it is keg-only: ``` llvm@9 is keg-only, which means it was not symlinked into /usr/local, because this is an alternate version of another formula. If you need to have llvm@9 first in your PATH run: echo 'export PATH="/usr/local/opt/llvm@9/bin:$PATH"' >> /Users/runner/.bash_profile For compilers to find llvm@9 you may need to set: export LDFLAGS="-L/usr/local/opt/llvm@9/lib" export CPPFLAGS="-I/usr/local/opt/llvm@9/include" ``` llvm@10 aka llvm is also keg-only so it will be installed only into the cellar. I have to guess whether the llvm-config binary will be named llvm-config or llvm-config-9, but I bet for the former. * sets TMPDIR env var to pass tests on mac os * updates testsuite * do not run on each push The master branch is already restricted from pushes so the code can reach the master branch only through a pull requested. We don't want to the same work twice. Also removes (the commented) windows line, we will return it back, once we will have time for that, see also #512 Co-authored-by: oleg <forown@yandex.ru> Co-authored-by: ivg <ivg@ieee.org>
This PR makes a lot of changes.
--PASS
, but instead must be called using-p PASS
. This concludes the discussion Discussion: Change to command line arguments #503.bap --help
. Note that--PLUGIN-help
also works, and lists only arguments specific to that plugin, along with its own manpage.Config
is now moved completely out of theSelf()
. In a future PR,Self()
will be completely phased out and plugin developers will no longer have to do the "magic"include Self()
anymore.Config
, but since they would useFrontend.Config
, they are allowed to also set up special commands (similar to the waystatus
andadd
are commands forgit
). This allows a lot of versatality for frontends.FILE
used inbap
).--rooter
etc very early, even though it depends on the plugins finishing off their registrations.-l
,-L
etc. options), but is done in advance, and still works perfectly from the grammar.Note: Some more minor changes and fixes might need to be done, but I am making this PR so that the review process can start off faster. Also, a refactor of the implemntation of
Config
needs to be done (for minor cleanups) and would be done in a future PR.Sorry for the noise but this PR is same as #511 but re-opened since Travis could not detect that PR at all.