Commit Graph

15 Commits

Author SHA1 Message Date
Alessandro Di Federico dcc795c424 Drop Logger's StaticEnabled feature 2025-10-31 14:49:05 +01:00
Giacomo Vercesi fede2f2090 ProgramRunner: allow redirection of streams
Change ProgramRunner's API to allow to optionally provide stdin and
capture stdout/stderr.
2025-05-05 17:28:48 +02:00
Giacomo Vercesi 042108bc44 ProgramRunner: cleanup
Clean up the `ProgramRunner` class:
* use llvm-provided wrappers and system-agnostic variables to compute
  the `Paths` variable
* pre-compute the list of path variables so it's not re-computed on
  every invocation of `run` or `isProgramAvailable`
* Wrap the logging code so that it's not triggered if the logger is
  disabled
2025-03-13 16:23:21 +01:00
Giacomo Vercesi 442020bf22 ProgramRunner: print exit code to logger
Print the exit code of the invoked program to the `program-runner`
logger.
2025-03-13 15:16:17 +01:00
Alessandro Di Federico 5c9b6ed9b3 Rename DILogger into Log 2024-08-16 13:27:00 +02:00
Alessandro Di Federico c7868b4e7d Runner: improve logging 2024-03-01 14:53:06 +01:00
Alessandro Di Federico f584308ead Introduce getLibrariesFullPath 2023-08-23 16:14:05 +02:00
Ivan Krysak 7d235f4fd0 Enforce licence header consistency
Also do some basic cleanup: capitalize first letters, add `.`
at the end of the sentences, and so on.
2023-07-03 15:23:10 +00:00
Djordje Todorovic 961f9e5461 Model: search debug info locally upon import
Also find prototypes in Models of dynamic libs for both PE and ELF.
2022-12-13 11:26:54 +01:00
Giacomo Vercesi 05dc27715d Improve pipeline saving capabilities
This commit introduces some changes to how the revng pipeline handles
serializing to disk. Specificaly:

* Pipeline globals (specifically model.yml) are better handled if they
  are in a subdirectory. They are now saved in the "context"
  subdirectory.
* In python:revng.api the pipeline is serialized whenever there is a
  non-reproducible change to the state (e.g. binary upload or model
  change).
  In the case of analyses this is done conservatively by checking that
  the diff produced is not empty.
* The logic for computing a step's subdirectory has been moved to the
  pipeline runner, consequently if a step is asked to serialize it
  will not create any subdirectories.
* Functionality for saving a single step/context has been exposed in
  Pipeline C.
* Finally, all path concatenations are now handled by
  llvm::sys::path::append, for extra os-agnosticism.
2022-06-29 14:50:58 +02:00
Giacomo Vercesi 168eab6cc5 Use /proc/self/maps to determine root
Use the path of the mapped librevngSupport.so to determine the root
directory.
2022-04-28 22:18:08 +02:00
Alessandro Di Federico da7701bd4e Move all executables except revng to libexec/revng
We used to collect all binaries into the `bin/` directory. However this
led to confusions since certain commands where available both as
`revng-command` and `revng command`.

This commit moves all the executables except `revng` into
`libexec/revng`, which, according to FHS, is dedicated to "internal
binaries that are not intended to be executed directly by users or shell
scripts".
2022-03-17 14:10:50 +01:00
Massimo Fioravanti afbebaf531 ProgramRunner: fix misuse of executable path
ProgramRunner was using garbage data instead of correctly using the path
to the current executable directory.
2022-01-17 18:17:54 +01:00
Alessandro Di Federico 441a5552b7 ProgramRunner: do not depend on main
`main` is not in all cases a dynamically exported symbol, therefore,
it's not safe to rely on it.

This commit switches to use `PathList`'s `getCurrentExecutableFullPath`,
which reads `/proc/self/exe`.
2022-01-09 19:00:57 +01:00
Massimo Fioravanti 80c3121c29 Introduce ProgramRunner
The ProgramRunner will be used by revng-pipeline to invoke the external
linker to operate on object file stored on disk.
2022-01-05 14:45:01 +01:00