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
This commit is contained in:
2
debug.cc
2
debug.cc
@@ -10,6 +10,6 @@
|
||||
|
||||
namespace debug {
|
||||
|
||||
seastar::sharded<replica::database>* the_database = nullptr;
|
||||
seastar::sharded<replica::database>* volatile the_database = nullptr;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user