Commit Graph

266 Commits

Author SHA1 Message Date
Alessandro Di Federico c64223a80c mv scripts/{,revng-}compare-yaml 2021-12-17 18:50:49 +01:00
Alessandro Di Federico 7cc2e914d7 compare-yaml: switch to grandiso.find_motifs
We need to use the `interestingness` in order to have good performance.
2021-12-17 18:50:41 +01:00
Alessandro Di Federico 101e7f7e09 compare-yaml: add attribute for references 2021-12-17 18:50:33 +01:00
Alessandro Di Federico fd08154452 compare-yaml: support negation 2021-12-17 18:50:25 +01:00
Alessandro Di Federico 786598d633 compare-yaml: ignore classes upon deserialization 2021-12-17 18:50:16 +01:00
Alessandro Di Federico 8ead934c8e Improve scripts/compare-yaml
* Rename from compare-json.py to compare-yaml
* Handle YAML
* Support certain characteristics of the model
* Use subgraph matching to perform comparisons
* Introduce some testing
* Drop Python 2 support
* Reformat
2021-12-17 18:49:01 +01:00
Qian Matteo Chen 886e58553b Introduce new ABIAnalyses
Architecture-agnostic and ABI-independent data-flow analyses that
traverse the recovered functions in order to detect arguments and
return values registers.
2021-12-15 18:03:30 +01:00
Alessandro Di Federico f4d09bc5ff Improve scripts/compare-yaml
* Rename from compare-json.py to compare-yaml
* Handle YAML
* Support certain characteristics of the model
* Use subgraph matching to perform comparisons
* Introduce some testing
* Drop Python 2 support
* Reformat
2021-12-15 18:03:30 +01:00
Alessandro Di Federico 1d8e274dcd Do not by pass HARD flags 2021-12-15 18:03:28 +01:00
Alessandro Di Federico d3cee7611d revng-dump-model: consider generic MetaAddress too 2021-11-19 10:12:23 +01:00
Alessandro Di Federico 54573608fe revng-dump-model: consume all the input 2021-11-19 10:12:23 +01:00
Alessandro Di Federico e1dadae08d revng-dump-model: ignore YAML tags 2021-11-19 10:12:23 +01:00
Alessandro Di Federico 9b61ad1772 scripts/revng: fix typo in ASan handling 2021-11-08 16:18:27 +01:00
Alessandro Di Federico 93b93a3908 scripts/revng: fix computation of libs dependencies 2021-10-21 15:02:01 +02:00
Andrea Gussoni cd9e4b5df1 check-revng-conventions: improve c files exclusion 2021-10-21 15:02:01 +02:00
Alessandro Di Federico fe2e9427c1 scripts/revng: use gdb -q 2021-10-18 20:44:58 +02:00
Alessandro Di Federico d40c8d4589 scripts/revng: use 4 spaces to indent 2021-10-18 20:44:58 +02:00
Ivan Krysak 5d66973d18 Allow lines to start with .
This rule, even if it prevents weird line-breaks, prevents us to take
full advantage of both designated initializers and method-chaining
idiom.
2021-09-01 16:36:41 +02:00
Alessandro Di Federico 6d10581163 Whitespace and other minor changes 2021-07-15 13:30:25 +02:00
Ivan Krysak bc8c8f82d2 Prevent separation of 'main' headers into group 0
The prevention mechanism uses a dummy suffix:
'_THIS_SEQUENCE_IS_NEVER_GOING_TO_HAPPEN'.
2021-06-09 18:05:20 +02:00
Ivan Krysak 2e214bc661 Add an include category for Qt headers 2021-06-08 17:03:58 +02:00
Alessandro Di Federico 2b9cbb98ec Introduce --invoke-isolated-functions
This commit ensures that FunctionIsolation and EnforceABI do only
thing. This means that they no longer modify `root`.

Instead, we have a new pass, `invoke-isolated-functions` that needs to
be run after them and replaces the entry point of the functions with
invokes to the isolated functions, possibly with the appropriate
arguments.
2021-04-22 14:45:52 +02:00
Alessandro Di Federico c11065c7fd scripts/revng: handle same library multiple times
The `revng` script looks in several paths for analysis
libraries. However, before this commit, in case multiple versions of the
same library were available, you'd get unpredictable results.

This commit ensures that each library is considered at most once, in the
right order.
2021-04-22 14:45:52 +02:00
Alessandro Di Federico 1e6230b46c scripts/revng: drop print_help 2021-03-16 11:36:32 +01:00
Alessandro Di Federico 58d0509909 scripts/revng: re-engineer option parsing
We now employ `argparse` subparsers.

This commit also fixes a bug involving global options with an argument
(such as `--prefix`) that led the argument to be interpreted as the
subcommand.
2021-03-10 12:29:25 +01:00
Alessandro Di Federico e51145ec99 script/revng: introduce --prefix
`--prefix` enables projects using revng to easily and correctly employ
libraries available in build directories organized in a install
tree-like fashion.
2021-03-08 10:37:32 +01:00
Alessandro Di Federico 4780457c53 Drop StackAnalysis<false> and FBDP
This commit drops support for running StackAnalysis without ABI
analysis. This has been broken for quite some time and a source of slow
downs in (badly) crafted optimization pipelines.
2021-03-06 17:35:30 +01:00
Alessandro Di Federico 6347ef5ba5 scripts/revng: --verbose reports all commands
Previously, we were reporting only those going though `wrap`.
2021-02-24 13:05:57 +01:00
Alessandro Di Federico 27b58695a1 Let FunctionIsolation and EnforceABI use the Model 2021-02-19 09:39:49 +01:00
Alessandro Di Federico 3f0e715b98 Decrease verbosity of tests 2021-02-19 09:39:49 +01:00
Alessandro Di Federico a314fd61ef Import revng-dump-model 2021-02-18 18:46:49 +01:00
Alessandro Di Federico 0ab1b786b6 check-revng-conventions: static in C headers is OK 2021-02-18 18:44:42 +01:00
Filippo Cremonese f05f785023 Fix revng_merge_dynamic installation
This commit also substantially reorganizes the root CMakeLists.txt.
2021-02-10 00:00:38 +01:00
Alessandro Di Federico a655507a0c Use relative paths during builds 2021-01-27 19:46:53 +01:00
Filippo Cremonese c5680b2120 Refactor revng-merge-dynamic
Notable changes:

- Split in multiple files the existing revng-merge-dynamic script
- Add the option to merge additional LOAD segments in the resulting
  binary
- Align the new .dynstr to a 4 byte boundary
- Ensure the last verneed entry is marked as such (vn_next == 0)
- Ensure LOAD PHDRs are listed in ascending order,
  as mandated by ELF spec
2021-01-23 00:41:52 +01:00
Alessandro Di Federico 8549844d36 Set BaseAddress to 0x400000 by default 2021-01-06 17:40:56 +01:00
Alessandro Di Federico 28432e30c1 Disable HARD_FLAGS_* when invoking linker
This commit is necessary in order to avoid using the compiler wrapper
provided by orchestra when developing.
2021-01-06 14:40:27 +01:00
Alessandro Di Federico 3c58c7441b Whitespace changes 2020-12-29 16:14:49 +01:00
Pietro Fezzardi d37aed928e Run check-revng-conventions from outside git dirs
This enables running the check-revng-conventions script as part of the
build and install process, to generate the .clang-format file for
installation and use from other projects.
2020-12-29 16:14:45 +01:00
Pietro Fezzardi 86fcff5db4 check-revng-conventions: improve help 2020-12-29 15:43:34 +01:00
Pietro Fezzardi 13a893e91f check-revng-conventions prints errors on more opts
Options with only a single leading dash were previously recognized as
filenames.
Now they are recognized as options.
2020-12-29 15:43:34 +01:00
Pietro Fezzardi 01118920b0 Add check-revng-conventions option to print config
This option is enabled with --print-clang-format-config.
This is useful to work around the fact that clang-format configuration
is hard-coded in a file.
Using this option is easier to generate a .clang-format file that can be
dropped in single projects to be picked up by IDE.
2020-12-29 15:43:34 +01:00
Pietro Fezzardi 4b4e791afe Add missing option to check-revng-conventions help 2020-12-29 15:43:34 +01:00
Pietro Fezzardi cb2c3c610f Add --help flag to check-revng-conventions 2020-12-29 15:43:32 +01:00
Alessandro Di Federico dab8a2dfae Install clang-format-style-file 2020-11-20 18:06:16 +01:00
Pietro Fezzardi e79dcaf780 check-revng-conventions: enforce #pragma once 2020-11-13 14:12:18 +01:00
Pietro Fezzardi 9869f057b9 Use #pragma once for header include guards 2020-11-13 14:12:18 +01:00
Pietro Fezzardi 1a09c00aa1 check-revng-conventions: regroup header includes 2020-11-13 10:00:27 +01:00
Pietro Fezzardi dc4ab84ad3 Move .clang-format to scripts/
The format file has also been renamed to revng-clang-format-style-file.

The check-revng-conventions scripts now always uses the same format
file, unless otherwise specified with the new option
--use-local-clang-format-file.

In this way, the check-revng-conventions uses the same format in all the
projects by default, but if a project needs to customize it (e.g.
cold-revng which follows the Qt style) it can use the new flag to
fallback to using the local .clang-format file.
2020-11-13 09:59:42 +01:00
Alessandro Di Federico 56b6797f8c scripts/revng: backport shlex.join 2020-11-12 16:21:32 +01:00