From ae211ece6a90c367ef0cdbabad3110aba3fcda67 Mon Sep 17 00:00:00 2001 From: Michal Gorny Date: Tue, 19 Mar 2019 17:13:13 +0000 Subject: [lldb] [Reproducer] Move SBRegistry registration into declaring files Move SBRegistry method registrations from SBReproducer.cpp into files declaring the individual APIs, in order to reduce the memory consumption during build and improve maintainability. The current humongous SBRegistry constructor exhausts all memory on a NetBSD system with 4G RAM + 4G swap, therefore making it impossible to build LLDB. Differential Revision: https://reviews.llvm.org/D59427 llvm-svn: 356481 --- lldb/source/API/SBWatchpoint.cpp | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'lldb/source/API/SBWatchpoint.cpp') diff --git a/lldb/source/API/SBWatchpoint.cpp b/lldb/source/API/SBWatchpoint.cpp index 11113ae49f8..ed25d65c779 100644 --- a/lldb/source/API/SBWatchpoint.cpp +++ b/lldb/source/API/SBWatchpoint.cpp @@ -289,3 +289,46 @@ SBWatchpoint SBWatchpoint::GetWatchpointFromEvent(const lldb::SBEvent &event) { Watchpoint::WatchpointEventData::GetWatchpointFromEvent(event.GetSP()); return LLDB_RECORD_RESULT(sb_watchpoint); } + +namespace lldb_private { +namespace repro { + +template <> +void RegisterMethods(Registry &R) { + LLDB_REGISTER_CONSTRUCTOR(SBWatchpoint, ()); + LLDB_REGISTER_CONSTRUCTOR(SBWatchpoint, (const lldb::WatchpointSP &)); + LLDB_REGISTER_CONSTRUCTOR(SBWatchpoint, (const lldb::SBWatchpoint &)); + LLDB_REGISTER_METHOD(const lldb::SBWatchpoint &, + SBWatchpoint, operator=,(const lldb::SBWatchpoint &)); + LLDB_REGISTER_METHOD(lldb::watch_id_t, SBWatchpoint, GetID, ()); + LLDB_REGISTER_METHOD_CONST(bool, SBWatchpoint, IsValid, ()); + LLDB_REGISTER_METHOD_CONST(bool, SBWatchpoint, operator bool, ()); + LLDB_REGISTER_METHOD(lldb::SBError, SBWatchpoint, GetError, ()); + LLDB_REGISTER_METHOD(int32_t, SBWatchpoint, GetHardwareIndex, ()); + LLDB_REGISTER_METHOD(lldb::addr_t, SBWatchpoint, GetWatchAddress, ()); + LLDB_REGISTER_METHOD(size_t, SBWatchpoint, GetWatchSize, ()); + LLDB_REGISTER_METHOD(void, SBWatchpoint, SetEnabled, (bool)); + LLDB_REGISTER_METHOD(bool, SBWatchpoint, IsEnabled, ()); + LLDB_REGISTER_METHOD(uint32_t, SBWatchpoint, GetHitCount, ()); + LLDB_REGISTER_METHOD(uint32_t, SBWatchpoint, GetIgnoreCount, ()); + LLDB_REGISTER_METHOD(void, SBWatchpoint, SetIgnoreCount, (uint32_t)); + LLDB_REGISTER_METHOD(const char *, SBWatchpoint, GetCondition, ()); + LLDB_REGISTER_METHOD(void, SBWatchpoint, SetCondition, (const char *)); + LLDB_REGISTER_METHOD(bool, SBWatchpoint, GetDescription, + (lldb::SBStream &, lldb::DescriptionLevel)); + LLDB_REGISTER_METHOD(void, SBWatchpoint, Clear, ()); + LLDB_REGISTER_METHOD_CONST(lldb::WatchpointSP, SBWatchpoint, GetSP, ()); + LLDB_REGISTER_METHOD(void, SBWatchpoint, SetSP, + (const lldb::WatchpointSP &)); + LLDB_REGISTER_STATIC_METHOD(bool, SBWatchpoint, EventIsWatchpointEvent, + (const lldb::SBEvent &)); + LLDB_REGISTER_STATIC_METHOD(lldb::WatchpointEventType, SBWatchpoint, + GetWatchpointEventTypeFromEvent, + (const lldb::SBEvent &)); + LLDB_REGISTER_STATIC_METHOD(lldb::SBWatchpoint, SBWatchpoint, + GetWatchpointFromEvent, + (const lldb::SBEvent &)); +} + +} +} -- cgit v1.2.3