Commit Graph

2065 Commits

Author SHA1 Message Date
Ryan Scott
c2c2a3d6bd macaw-symbolic: Implement MacawFreshSymbolic for all macaw Types
Rather than `error`ing, we now generate fresh constants for all possible
`macaw` `Type`s that are supplied to the `MacawFreshSymbolic` operation.

Fixes #301.
2023-11-17 17:08:34 -05:00
Ryan Scott
2e49eb5351
Merge pull request #350 from GaloisInc/macaw-ppc-pic-ip-addresses
`macaw-ppc`: Don't assume absolute IP addresses when decoding
2023-11-14 15:02:45 -06:00
Ryan Scott
ca64b56808 macaw-{aarch32,ppc}: Remove vestigial InstructionAtUnmappedAddr error types
Now that `macaw-aarch32` and `macaw-ppc` properly handle position-independent
code, the `InstructionAtUnmappedAddr` error (which could only be thrown if an
IP address was found in position-independent code) is never thrown. Let's
delete it.
2023-11-14 13:03:52 -05:00
Ryan Scott
b12b049455 macaw-ppc: Don't assume absolute IP addresses when decoding
`macaw-ppc` was previously assuming that addresses are absolute, which is not
true for position independent executables. Extracting the offset from the
address is sufficient for our purposes here (note that taking the offset from
the `MemSegmentOffset` would not be right, as that offset is relative to the
segment start).

This is the exact same issue that was noticed in
37d8029c00
(in `macaw-aarch32`), but that commit forgot to fix things on the `macaw-ppc`
end.
2023-11-14 12:58:01 -05:00
Ryan Scott
0c6872ad1d
Merge pull request #348 from GaloisInc/elf-edit-T35
`macaw-base`: Resolve PPC{32,64} relocations
2023-11-14 06:29:49 -06:00
Ryan Scott
2fb4ab4291 macaw-base: Resolve PPC{32,64} relocations
This builds on top of the work in
https://github.com/GaloisInc/elf-edit/pull/41. For now, I only add support for
a select few relocation types, leaving the rest as future work.
2023-11-03 11:38:11 -04:00
Langston Barrett
7a70ce9840
Merge pull request #345 from GaloisInc/lb/syntax
macaw-symbolic-syntax: Concrete syntax for macaw-symbolic CFGs
2023-11-03 09:15:12 -04:00
Langston Barrett
eb68a3fa64 Bump crucible submodule 2023-11-02 17:09:03 -04:00
Langston Barrett
836298bcc6 symbolic-syntax: Remove documentation of type aliases
These are no longer part of the base syntax, but can be added on.
2023-11-02 17:06:06 -04:00
Langston Barrett
191c016565 symbolic-syntax: Clarify comments 2023-11-02 16:42:27 -04:00
Langston Barrett
0b9c4730d8 symbolic-syntax: Remove fresh-vec
It's not part of the Macaw syntax, but rather an operation that's useful
when hand-writing CFGs. This should instead be supported by parser extensions
downstream.
2023-11-02 16:39:24 -04:00
Langston Barrett
8be115c859 symbolic-syntax: Explain the utility of bv-typed-literal 2023-11-02 16:37:58 -04:00
Langston Barrett
5fc17a1c03 symbolic-syntax: make-null -> pointer-make-null 2023-11-02 16:36:08 -04:00
Langston Barrett
de4789b73b symbolic-syntax: Reuse type alias parsers from crucible-llvm-syntax 2023-11-02 16:34:01 -04:00
Langston Barrett
7b38e4b6ce
symbolic-syntax: Fix README backticks
Co-authored-by: Ryan Scott <rscott@galois.com>
2023-11-02 10:56:51 -04:00
Langston Barrett
19f0a578fc symbolic-syntax: Add a test that exercises all the operations 2023-11-02 09:11:04 -04:00
Langston Barrett
a2ac7f4300 macaw-symbolic-syntax: Concrete syntax for macaw-symbolic CFGs
This code was ported from ambient-verifier.
2023-11-01 17:19:13 -04:00
Valentin Robert
e05a9db243
Merge pull request #342 from GaloisInc/vr/fix-doc
fix incorrect documentation
2023-09-11 10:26:31 -07:00
Valentin Robert
28d3c587fc fix incorrect documentation 2023-09-08 10:17:15 -07:00
Valentin Robert
4ad9984185
Merge pull request #341 from GaloisInc/vr/block-invariants-docstrings
fix BlockInvariants docstrings
2023-09-08 08:42:00 -07:00
Valentin Robert
4cfed47b7b fix BlockInvariants docstrings
The alignment was all wonky, and one field was not documented.
2023-09-07 16:57:30 -07:00
Ryan Scott
299c227a77 CI: Test GHC 9.2.8, 9.4.5, 9.6.2 2023-08-21 08:16:10 -04:00
Ryan Scott
c3c5330f7f Don't use deprecated TypeInType extension
As of GHC 8.6, `TypeInType` is simply an alias for `DataKinds` + `PolyKinds`.
And as of GHC 9.6, `TypeInType` is deprecated. Let's just remove our uses of
`TypeInType` to avoid deprecation warnings.
2023-08-21 08:16:10 -04:00
Ryan Scott
984f7cb368 Support building with GHC 9.6
This patch contains a handful of tweaks needed to make the libraries in the
`macaw` repo build with GHC 9.6:

* GHC 9.6 bundles `mtl-2.3.*`, which no longer re-exports `Control.Monad`,
  `Control.Monad.Trans`, and similar modules from `mtl`-related modules. To
  accommodate this, various imports have been made more explicit.
* I have disambiguated a use of `Data.Parameterized.NatRepr.withKnownNat` in
  `macaw-aarch32` to avoid clashing with a newly exported function of the same
  name in `GHC.TypeNats`.
* I have bumped various upper version bounds on `doctest`,
  `optparse-applicative`, and `what4` to allow building these libraries with
  GHC 9.6.
* I have bumped the following submodules to bring in GHC 9.6–related changes:
  * `asl-translator`: GaloisInc/asl-translator#53
  * `crucible`: GaloisInc/crucible#1102
  * `dwarf`: GaloisInc/dwarf#6
  * `elf-edit`: GaloisInc/elf-edit#38
  * `flexdis86`: GaloisInc/flexdis86#54
  * `grift`: GaloisInc/grift#9
  * `llvm-pretty`: elliottt/llvm-pretty#112
  * `llvm-pretty-bc-parser`: GaloisInc/llvm-pretty-bc-parser#225
  * `semmc`: GaloisInc/semmc#80
  * `what4`: GaloisInc/what4#235
2023-08-21 08:16:10 -04:00
Ryan Scott
2ce038c086 Whitespace only 2023-08-21 08:16:10 -04:00
Valentin Robert
21e3b8f461
Merge pull request #340 from GaloisInc/vr/no-return-call
make error casing uniform
2023-08-14 08:17:10 -07:00
Valentin Robert
7e8f7b979b make error casing uniform
This was the only classifier error message not capitalized.
2023-08-11 16:53:41 -07:00
Valentin Robert
2634b881c6
Merge pull request #335 from GaloisInc/vr/pretty-block-explore
Pretty instance for BlockExploreReason
2023-08-10 14:39:56 -07:00
Valentin Robert
133f3bd9d5 Pretty instance for BlockExploreReason 2023-08-10 14:38:17 -07:00
Valentin Robert
24a18d26d3
Merge pull request #336 from GaloisInc/vr/explore-block-reason
explore BlockExploreReason in DiscoveryEvent
2023-08-10 14:37:45 -07:00
Valentin Robert
4f11cbdedd
Merge pull request #339 from GaloisInc/vr/bump-ci-actions
bump obsolete CI actions
2023-08-10 13:26:18 -07:00
Valentin Robert
6d5bbee7f4 bump obsolete CI actions 2023-08-10 11:20:55 -07:00
Valentin Robert
e8351f29f9
Merge pull request #338 from GaloisInc/vr/investigating-cache-misses
fix CI slowness issues
2023-08-10 11:19:54 -07:00
Valentin Robert
b8bbdcdaf1 fix CI slowness issues
One issue was that we were computing the restore key on the hash of a
file before creating said file when restoring, but after creating the
file when saving, so there was a constant mismatch.

The second issue is that we were not caching dist-newstyle, so we would
always rebuild our "local" dependencies such as binary-symbols,
elf-edit, etc.
2023-08-10 10:19:32 -07:00
Valentin Robert
2d2f22b440
Merge pull request #337 from GaloisInc/vr/unused-pragmas
remove redundant pragmas
2023-08-09 19:55:12 -07:00
Valentin Robert
3638d6e2b0 explore BlockExploreReason in DiscoveryEvent
It can be nice from an external consumer's point of view to have the
reason for the exploration of a block.
2023-08-09 14:44:14 -07:00
Valentin Robert
417e8b780b remove redundant pragmas 2023-08-09 14:31:50 -07:00
Valentin Robert
bc9d04fca7
Merge pull request #333 from GaloisInc/vr/hlint
applying reasonable hlint suggestions
2023-07-28 21:09:20 -07:00
Valentin Robert
e089aa220c applying reasonable hlint suggestions
Co-authored-by: Ryan Scott <rscott@galois.com>

newlines
2023-07-28 10:15:10 -07:00
Valentin Robert
399309e637
Merge pull request #331 from GaloisInc/vr/bump-flexdis
bump flexdis86
2023-07-12 08:43:15 -07:00
Valentin Robert
6c5cc25906 bump flexdis86 2023-07-11 15:27:40 -07:00
Ryan Scott
30fe405a39 Point macaw-loader submodule to master commit 2023-04-18 15:30:30 -04:00
Ryan Scott
2b8be71a41 CI: Always save cache, even on failure 2023-04-18 15:17:23 -04:00
Ryan Scott
9ff819e718 CI: Test GHC 9.2.7 and 9.4.4, drop 8.8.4 and 9.0.2 2023-04-18 15:17:23 -04:00
Ryan Scott
01cfc1db49 Regenerate cabal.project.freeze.ghc-8.10.7 2023-04-18 15:17:23 -04:00
Ryan Scott
7e346081a5 Fix -Wtype-equality-requires-operators warnings
GHC 9.4 adds `-Wtype-equality-requires-operators` to `-Wall`, which warns about
certain uses of type equalities that are not forward-compatible with planned
changes in GHC. See [this
section](https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.4?version_id=b60e52482a666d25638d59cd7e86851ddf971dc1#-is-now-a-type-operator)
of the GHC 9.4 Migration Guide. These warnings are easily fixed by enabling the
`TypeOperators` extension.
2023-04-18 15:17:23 -04:00
Ryan Scott
e55add0b51 Support building with GHC 9.4
This contains a variety of tweaks needed to make the libraries in the
`macaw` repo build with GHC 9.4:

* `ST` no longer has a `MonadFail` instance. See
  [this section](https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.4?version_id=b60e52482a666d25638d59cd7e86851ddf971dc1#st-is-no-longer-an-instance-of-monadfail)
  of the GHC 9.4 Migration Guide. To adapt to this change, I had to change some
  uses of `fail` to `panic`, and I also had to avoid some partial pattern
  matches in `do`-notation to avoid incurring `MonadFail (ST s)` constraints.
* GHC 9.4 is pickier about undecidable superclass checking. As such, I needed to
  explicitly enable `UndecidableSuperClasses` in a handful of places.
* The following submodule changes were brought in to support building with
  GHC 9.4:
  * `asl-translator`: GaloisInc/asl-translator#51
  * `bv-sized`: GaloisInc/bv-sized#27
  * `bv-sized-float`: GaloisInc/bv-sized-float#4
  * `crucible`: GaloisInc/crucible#1073

    (This also requires bumping the `llvm-pretty`, `llvm-pretty-bc-parser`,
    and `what4` submodules as a side effect)
  * `dismantle`: GaloisInc/dismantle#40
  * `grift`: GaloisInc/grift#8
  * `macaw-loader`: GaloisInc/macaw-loader#17
  * `semmc`: GaloisInc/semmc#79
2023-04-18 15:17:23 -04:00
Ryan Scott
02c2bc468e macaw-base: Introduce *.Panic module
This is cargo-culted from the `*.Panic` module of a similar name in
`macaw-aarch32`. This will be useful in a subsequent commit in which we replace
some unreachable calls to `fail` with `panic`.
2023-04-18 15:17:23 -04:00
Ryan Scott
0686e5d86b Regenerate cabal.project.freeze.ghc-* files 2023-03-21 16:05:53 -04:00
Ryan Scott
e6a3fb0b87 Bump what4 submodule to version 1.4
The only other changes required are (1) deleting an unused dependency on
`what4-serialize`, and (2) raising upper version bounds on `what4`.

This brings in submodule changes from the following:

* GaloisInc/asl-translator#48, which performed a similar `what4` adaptation.
* GaloisInc/semmc#78, which performed a similar `what4` adaptation.
* GaloisIns/crucible#1068, which ensures that everything can build against
  `tasty-sugar >= 2.0` (the version of the library that `what4-1.4` depends on).
2023-03-21 16:05:53 -04:00