Files
scylladb/debug.cc
Avi Kivity f4b1ad43d4 gdb: protect debug::the_database from lto
Clang 18.1 with lto gained the ability to eliminate dead stores.
Since debug::the_database is write-only as far as the compiler understands
(it is read only by gdb), all writes to it are eliminated.

Protect writes to the variable by marking it volatile.

Closes scylladb/scylladb#22454
2025-01-23 22:26:04 +02:00

16 lines
237 B
C++

/*
* Copyright (C) 2023-present ScyllaDB
*/
/*
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
*/
#include "debug.hh"
namespace debug {
seastar::sharded<replica::database>* volatile the_database = nullptr;
}