From 533aec84b3b0b1531ea49653697c3e5b7c9118eb Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Sun, 29 Nov 2015 12:45:08 +0100 Subject: [PATCH] schema: Enable shared_from_this() --- schema.hh | 2 +- scylla-gdb.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/schema.hh b/schema.hh index d94d49cdd3..e184ccaa77 100644 --- a/schema.hh +++ b/schema.hh @@ -322,7 +322,7 @@ extern template class serializer; * Effectively immutable. * Not safe to access across cores because of shared_ptr's. */ -class schema final { +class schema final : public enable_lw_shared_from_this { private: // More complex fields are derived from these inside rebuild(). // Contains only fields which can be safely default-copied. diff --git a/scylla-gdb.py b/scylla-gdb.py index 82034bb545..83d7ac6647 100644 --- a/scylla-gdb.py +++ b/scylla-gdb.py @@ -93,7 +93,7 @@ class scylla_column_families(gdb.Command): cfs = db['_column_families'] for (key, value) in list_unordered_map(cfs): value = value['_p']['_value'] # it's a lw_shared_ptr - schema = value['_schema']['_p']['_value'] + schema = value['_schema']['_p'].reinterpret_cast(gdb.lookup_type('schema').pointer()) name = str(schema['_raw']['_ks_name']) + '/' + str(schema['_raw']['_cf_name']) schema_version = str(schema['_raw']['_version']) gdb.write('{:5} {} v={} {:45} (column_family*){}\n'.format(shard, key, schema_version, name, value.address))