Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 1.17 KB

errata.md

File metadata and controls

35 lines (28 loc) · 1.17 KB

Errata

Chapter 7: Software Breakpoints

All cproc initializations are wrong

The initializations of cproc in sdb/test/tests.cpp initialize const references to std::unique_ptr, but std::unique_ptr doesn't maintain const through dereferences, so uses of this operate on non-const sdb::process objects. These changes fix this, capturing instead const sdb::process* pointers:

TEST_CASE("Can find breakpoint site", "[breakpoint]") {
    auto proc = process::launch("targets/run_endlessly");
-   const auto& cproc = proc;
+   const auto* cproc = proc.get();
TEST_CASE("Cannot find breakpoint site", "[breakpoint]") {
    auto proc = process::launch("targets/run_endlessly");
-   const auto& cproc = proc;
+   const auto* cproc = proc.get();
TEST_CASE("Breakpoint site list size and emptiness", "[breakpoint]") {
    auto proc = process::launch("targets/run_endlessly");
-   const auto& cproc = proc;
+   const auto* cproc = proc.get();
TEST_CASE("Can iterate breakpoint sites", "[breakpoint]") {
    auto proc = process::launch("targets/run_endlessly");
-   const auto& cproc = proc;
+   const auto* cproc = proc.get();