aboutsummaryrefslogtreecommitdiff
path: root/rel32_finder.h
AgeCommit message (Collapse)Author
2021-07-25components: Replace base::Optional and friends with absl counterpartsAnton Bikineev
This replaces: - base::Optional -> absl::optional - include "base/optional.h" -> include "third_party/abseil-cpp/absl/types/optional.h" - base::nullopt -> absl::nullopt - base::make_optional -> absl::make_optional Bug: 1202909 Change-Id: If697b7bf69b199c1796f873eedca3359cdb48c64 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897151 Commit-Queue: Anton Bikineev <bikineev@chromium.org> Owners-Override: Anton Bikineev <bikineev@chromium.org> Reviewed-by: Peter Kasting <pkasting@chromium.org> Cr-Commit-Position: refs/heads/master@{#883296} NOKEYCHECK=True GitOrigin-RevId: 1156b5f891de178171e71b9221a96bef1ced3d3b
2021-07-25Remove/replace unnecessary includes of logging.h (components/)Hans Wennborg
If the file just needs the CHECK/CHECK_OP/NOTREACHED macros, use the appropriate header for that instead. Or if logging.h is not needed at all, remove it. This is both a nice cleanup (logging.h is a big header, and including it unnecessarily has compile-time costs), and part of the final step towards making logging.h no longer include check.h and the others. Bug: 1031540 Change-Id: Ibeb7cc26e331161c5a1490b84ef5a59ecd122413 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2254029 Auto-Submit: Hans Wennborg <hans@chromium.org> Commit-Queue: Colin Blundell <blundell@chromium.org> Reviewed-by: Colin Blundell <blundell@chromium.org> Cr-Commit-Position: refs/heads/master@{#781841} NOKEYCHECK=True GitOrigin-RevId: 29c74d3fa1a05f3de62c3017b70c4e9e0d7fbbca
2021-07-25[Zucchini] Rel32Finder: Make rel32 accept / reject semantics explicit.Samuel Huang
Zucchini heuristically scans assembly code byte-by-byte for rel32 references. When found, the result needs validation, and on X86 / X64, this directs where to scan next: If accepted, scan resumes after the instruction containing the rel32 found; if rejected, scan resumes on the next byte. Rel32Finder implements the above interactively: GetNext() emits the next candidate rel32, and the caller needs to call Accept() to signal acceptance (else rejection is assumed). Inherited classes of Rel32Finder implements architecture-specific code via Scan(), which caches results. Previously, Scan() also returns a range for the instruction found. If accepted, scan resumes after the range; if rejected, scan resumes 1 byte after the start of range. Problem: The "scan 1 byte after" scheme works well for X86 / X64 and fixed-size instructions (by aligning in Scan()). However, for THUMB2 instructions in ARM, which has easily discernible 2-byte and 4-byte op codes, for both "accept" and "reject", scan should resume on the next instruction. This CL refactors Rel32Finder to solve the above, with other cleanup. Details: * Change Scan() to return (new struct) NextIterators, which stores iterator for "accept" and "reject" cases. * Rename Reset() to SetRegion() to assign |region_|, and remove the |region_| assignment via constructor. * Add Rel32FinderIntel::SetResult(). * Move more code from .h to .cc. * Rename |next_cursor_| to |accept_it_|. * Extensive comment updates. Bug: 943315,918867 Change-Id: Ie0a0b380975c35b0aedb013037f8d69673c9697c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1529166 Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org> Reviewed-by: Samuel Huang <huangs@chromium.org> Commit-Queue: Samuel Huang <huangs@chromium.org> Cr-Commit-Position: refs/heads/master@{#643098} NOKEYCHECK=True GitOrigin-RevId: 47fef62aa7626d9a47fc1986b8e51e6e866570d1
2021-07-23[Zucchini] Move Zucchini from /chrome/installer/ to /components/.Samuel Huang
(Use "git log --follow" to see older revisions of files). /components/ is the most logical place to put Zucchini, which only depends on /base and /testing/gtest. This move also enables Zucchini to be used by the Component Updater. Details: - Move all files; run the following to change deps and guards: sed 's/chrome\/installer/components/' *.cc *.h -i sed 's/CHROME_INSTALLER/COMPONENTS/' *.cc *.h -i - Sorting works out pretty well! - Change all 'chrome/installer/zucchini' to 'components/zucchini' throughout other parts of the repo; sort if necessary. - Fix 6 'git cl lint' errors. - Change 1 Bind() usage to BindRepeated(). - Update OWNER. Bug: 729154 Change-Id: I50c5a7d411ea85f707b5994ab319dfb2a1acccf7 Reviewed-on: https://chromium-review.googlesource.com/954923 Reviewed-by: Greg Thompson <grt@chromium.org> Reviewed-by: Jochen Eisinger <jochen@chromium.org> Reviewed-by: Samuel Huang <huangs@chromium.org> Commit-Queue: Samuel Huang <huangs@chromium.org> Cr-Commit-Position: refs/heads/master@{#542857} NOKEYCHECK=True GitOrigin-RevId: 577ef6c435e8d43be6e3e60ccbcbd1881780f4ec