Small refactor.
- Move all ScopedDisableDebugCalls into the debug_XXX calls. This avoids
any issues that might arise where every part of the code needs to properly
guard anything that might allocate. Instead everything is already guarded.
- Add a pointer to debug_data in all of the XXData classes. This avoids
calling individual functions passing in the debug_data pointer.
- Flip the NO_HEADER_OPTIONS to an explicit HEADER_OPTIONS list since fewer
options actually require a header.
- Move the extern of g_debug to the DebugData.h header.
Change-Id: Ia213a391b4a44d9ce122a709d09fe4f1b5426f36
diff --git a/libc/malloc_debug/BacktraceData.h b/libc/malloc_debug/BacktraceData.h
index 842e372..dbc3989 100644
--- a/libc/malloc_debug/BacktraceData.h
+++ b/libc/malloc_debug/BacktraceData.h
@@ -33,12 +33,14 @@
#include <private/bionic_macros.h>
+#include "OptionData.h"
+
// Forward declarations.
struct Config;
-class BacktraceData {
+class BacktraceData : public OptionData {
public:
- BacktraceData(const Config& config, size_t* offset);
+ BacktraceData(DebugData* debug_data, const Config& config, size_t* offset);
virtual ~BacktraceData() = default;
bool Initialize(const Config& config);