Commit Graph

104 Commits

Author SHA1 Message Date
Giacomo Vercesi 82591a72c9 mass-testing: exclude paths from flamegraph
Add a new option to the mass-testing `meta.yml` that allows skipping
some paths when generating the flamegraph. In the case of revng this
allows skipping the intermediate python frames.
2025-12-11 17:25:36 +01:00
Giacomo Vercesi 8af5e1d05c Implement revng2 quick artifact 2025-12-10 16:16:14 +01:00
Giacomo Vercesi e3b263d9da Implement revng2 project init 2025-12-10 16:16:14 +01:00
Alessandro Di Federico bce32d9669 Default to --emit-hex-constant-literals-from=4096 2025-11-28 11:21:18 +01:00
Tommaso Fontana 9f5ca81401 Pypeline: introduce analysis lists
Now in the pipeline.yml you can specify lists of analysis that are run
sequentially.
2025-11-24 16:41:15 +01:00
Giacomo Vercesi d90f6ff0f5 revng2: use cache_directory from support 2025-11-17 10:04:12 +01:00
Tommaso Fontana 8ae70d85d4 Pypeline: replace logging with custom log
Now the pype command has a `--verbose` argument that to enable debug
logging in the pypelien code.
Adapted the codebase to use this new logging format but replacing
`logging` with `revng.pypeline.utils.logger`, this is done in
preparation of debug-log.
2025-11-11 17:15:28 +01:00
Tommaso Fontana 036411b441 Pypeline: add pipebox initialize and -- args
The pipebox now has to have an initialize function that is called with
all arguments passed to the CLI after --.
2025-11-11 17:15:28 +01:00
Tommaso Fontana 639593164a Pypeline: add autocomplete and refactor CLI
Now pype has an `autocomplete` command usable to enable autocompletion
and revng2 now is based on `pype`, modifying its defalults and
injecting new commands.
2025-11-11 17:15:27 +01:00
Giacomo Vercesi 145bd01279 generate-migrations: remove __init__
Remove the `__init__` function from the template used by the
`revng generate-migrations` command, so far it hasn't been used.
2025-10-16 16:08:05 +02:00
Giacomo Vercesi 6bdc3c9179 fetch-debuginfo: fix parsing of PDB filename
The PDB filename is up to the first `\x00`, everything else after should
be discarded.
2025-10-15 11:58:11 +02:00
Ivan Krysak 00ea93c99e TTG: move metaschema.yml to share/revng/ 2025-10-13 18:33:10 +03:00
Ivan Krysak 04fdc2028a migrations: do not duplicate the template 2025-10-13 18:33:10 +03:00
Ivan Krysak e56f543b1a Split module.bc.zstd 2025-10-13 10:26:41 +03:00
Ivan Krysak ed53e759c9 Do not use -Y flag
Yaml model are now the _only_ way to store them, no point in still
specifying the old flag for it.
2025-10-13 10:26:41 +03:00
Tommaso Fontana 80eb02c207 Pypeline: merge pypeline 2025-09-10 12:05:15 +02:00
Tommaso Fontana 680f5cacf2 Apply revng check-conventions --force-format 2025-09-10 12:05:14 +02:00
Giacomo Vercesi 62421eeaa2 fetch debuginfo: switch default servers
Switch the default servers used by `fetch debuginfo` to revng-managed
ones, as especially the elfutils.org once has been spotty in the past.
2025-08-08 17:52:57 +02:00
Giacomo Vercesi 78e66e0d08 cli: move model import idb in separate dir
Move the two python scripts that compose the `revng model import idb`
command into a separate subdirectory.
2025-07-18 09:30:56 +02:00
Giacomo Vercesi 38b50c2977 tupletree: fix Reference class
Fix the `Reference` class, make it work with the new model and allow it
to be dereferences via the `_accessor` attribute.
2025-07-18 09:30:55 +02:00
Ivan Krysak 452612eaea import-idb: fix misuse of PrimitiveType object 2025-06-27 17:42:27 +03:00
Giacomo Vercesi d62b7b6b1a TTG: inline root type in schema
Move the root type inside the schema definition, as it is a property of
it and not of the generator.
2025-06-25 15:40:13 +02:00
Giacomo Vercesi 087192cac4 mass-testing: add max_rss to database
Add the `max_rss` column to the database generated by the `revng
mass-testing generate-report` command.
2025-06-04 13:30:42 +02:00
Giacomo Vercesi deeae6d904 mass-testing run: auto-detect max-jobs
With the information propagated by `meta.yml`, compute the maximum
number of jobs based on the max memory limit.
2025-06-04 13:30:42 +02:00
Giacomo Vercesi f63cd5ff6f mass-testing configure: add env to sample
Add an environment variable to the `revng mass-testing configure`
command that allows sampling the inputs to a limited amount.
2025-06-04 13:30:42 +02:00
Giacomo Vercesi 6e59f45c89 mass-testing configure: add env for seed
Add an environment variable that allows setting the seed of the RNG for
`revng mass-testing configure`. Drop the `--seed` command line option.
2025-06-04 13:30:42 +02:00
Giacomo Vercesi 14f951effe mass-testing configure: change input format
Change the input format accepted by the `revng mass-testing configure`
command. This allows knowing in `meta.yml` the limits (ram, time)
imposed on each test set.
2025-06-04 13:30:41 +02:00
Giacomo Vercesi 8b9aad7292 mass-testing generate-report: fix exception
Fix an exception that happened when generating the report. In some cases
the `stacktrace.json` file has a line like this:
```
{"Address":"0x7f7","Error":{"Message":"No such file or directory"},"ModuleName":"linux-vdso.so.1"}
```
This is a valid line that maps to `(linux-vdso.so.1+0x7f7)`, however
this was not properly handled in the code. This commits fixes it so that
a dummy line is added and the line is skipped.
2025-06-04 13:30:41 +02:00
Giacomo Vercesi 130a2bfc9f Command: fix typing of command in constructor 2025-06-04 13:30:41 +02:00
Ivan Krysak f3cce00c3f Migrations: fix the template 2025-05-08 15:42:01 +02:00
Giacomo Vercesi 890a735610 test_docs: add ignoreoutput option for python
Sometimes the output of a command is not important, in these cases
`doctest` complains nonetheless. This commit introduces a
`IGNORE_OUTPUT` option which still allows checking that the command
executes correctly but skips the checking of the output with the
expected one. In addition to this the `test_docs` command now can parse
a `ignoreoutput` option in the python block which will:
* if numbers are specified (e.g. `ignoreoutput=1,2`): the specified
  line numbers will have `# doctest: +IGNORE_OUTPUT` added at the end
  of the specified line numbers.
* Without numbers (e.g. `{python ignoreoutput}`) then all lines will
  have a `# doctest: +IGNORE_OUTPUT` appended.
2025-05-07 10:48:54 +02:00
Giacomo Vercesi 0f6b6e00bd Add revng init
Add a new `revng` command that allows to initialize a resume directory.
2025-05-07 10:48:49 +02:00
Jurij Srebrnič 3bc63b833e Fixed python and typescript doc-test not executing 2025-05-07 10:48:23 +02:00
Giacomo Vercesi e95ad01ff8 Implement revng llm-rename 2025-05-05 17:28:48 +02:00
Giacomo Vercesi 591107cdce Overhaul PTML functionality
The logic of the `revng ptml` command was too tightly coupled with the
parsing of the xml. Overhaul the structure of the ptml code and split it
in two locations:
* `revng.ptml`: this module contains functions that allow easy
  manipulation of PTML, both for printing it and for obtaining the split
  metadata/text version.
* `revng.internal.cli._commands.ptml`: this implements the actual `revng
  ptml` command. This leverages the new logic in the `revng.ptml` module
  while maintaining the same functionality.
2025-05-05 17:28:48 +02:00
Giacomo Vercesi bfed42ed1e Add revng.support.get_llvmcpy helper
Add the `get_llvmcpy` helper function which returns an instance of
`LLVMCPy` which uses the `llvm-config` that's present in the search
paths.
2025-05-05 16:02:40 +02:00
Giacomo Vercesi 6fc6d38228 Remove argparse.FileType
Python 3.14 will deprecate `argparse.FileType` [1]. This is due to a
variety of factors, one of which is that the class leaks file
descriptors when used. Remove all usages in the codebase and instead
use a wrapper function for `open`.

[1] https://docs.python.org/3.14/library/argparse.html#argparse.FileType
2025-05-05 16:02:40 +02:00
Giacomo Vercesi 57c4f89dd3 python: remove relative imports
Remove all the relative imports from the python code that are not
relative to the current module (e.g. `from .<X> import ...`).
2025-05-05 16:02:40 +02:00
Khaled Ismaeel 8b355fc896 Add primitive support for generating migrations 2025-04-30 15:08:45 +02:00
Khaled Ismaeel 9b07b3bcce Add primitive migration support to the CLI 2025-04-30 15:08:45 +02:00
Giacomo Vercesi 6509cad084 test_docs: remove useless global
The `verbose` was is not modified in the `log` function, so the use of
`global` is useless.
2025-04-24 13:22:14 +02:00
Ivan Krysak ae3f19664a ModelPasses: introduce fix-model 2025-04-17 11:19:17 +03:00
Ivan Krysak 0c99d5d5fb IDBImporter: omit unnecessary typedefs 2025-04-17 11:19:17 +03:00
Ivan Krysak 2eed7f2410 IDBImporter: fix an incorrect type check 2025-04-17 11:19:17 +03:00
Ivan Krysak c4f071dfe3 Importers: adopt primitive typedef flattening 2025-04-17 11:19:17 +03:00
Ivan Krysak 433af9ef6e Adopt the new name deduplication pass 2025-04-17 11:19:17 +03:00
Ivan Krysak f070f1f1e1 Model: sunset double name system 2025-04-17 11:19:17 +03:00
Giacomo Vercesi d9e928dce9 fetch debuginfo: provide alternative urls via env
Allow the `fetch debuginfo` command to have the upstream server urls be
provided via environment variables rather than the command-line.
2025-03-13 18:03:50 +01:00
Giacomo Vercesi f6b9e509a3 fetch debuginfo: actually check for PE/COFF
Add the code needed to check if the input file is actually a PE/COFF
file.
2025-03-13 18:03:50 +01:00
Giacomo Vercesi fa44c4cf2f fetch debuginfo: drop self.verbose
The `FetchDebugInfoCommand` contained assignment to `self.verbose` which
was unused. Drop it.
2025-03-13 18:03:50 +01:00