summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Debugger.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-06-23 17:59:56 +0000
committerGreg Clayton <gclayton@apple.com>2011-06-23 17:59:56 +0000
commit4a33d3188c6d8d6f7f6ecd4963fcfd083c2e3325 (patch)
treec017ed69136cda3e55390dbbd1767c87be819d6c /lldb/source/Core/Debugger.cpp
parent3a0c5e52ff3ea056329fbbacd6f7e2bf281bf3ee (diff)
downloadbcm5719-llvm-4a33d3188c6d8d6f7f6ecd4963fcfd083c2e3325.tar.gz
bcm5719-llvm-4a33d3188c6d8d6f7f6ecd4963fcfd083c2e3325.zip
Committing type format code for Enrico Granata.
This commit adds a new top level command named "type". Currently this command implements three commands: type format add <format> <typename1> [<typename2> ...] type format delete <typename1> [<typename2> ...] type format list [<typename1> [<typename2>] ...] This allows you to specify the default format that will be used to display types when you use "frame variable" or "expression", or the SBValue classes. Examples: // Format uint*_t as hex type format add x uint16_t uint32_t uint64_t // Format intptr_t as a pointer type format add p intptr_t The format characters are the same as "printf" for the most part with many additions. These format character specifiers are also used in many other commands ("frame variable" for one). The current list of format characters include: a - char buffer b - binary B - boolean c - char C - printable char d - signed decimal e - float f - float g - float i - signed decimal I - complex integer o - octal O - OSType p - pointer s - c-string u - unsigned decimal x - hex X - complex float y - bytes Y - bytes with ASCII llvm-svn: 133728
Diffstat (limited to 'lldb/source/Core/Debugger.cpp')
-rw-r--r--lldb/source/Core/Debugger.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index ba43411dfaf..b7be1715ca9 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -7,9 +7,13 @@
//
//===----------------------------------------------------------------------===//
+#include "lldb/Core/Debugger.h"
+
+#include <map>
+
#include "lldb/lldb-private.h"
#include "lldb/Core/ConnectionFileDescriptor.h"
-#include "lldb/Core/Debugger.h"
+#include "lldb/Core/FormatManager.h"
#include "lldb/Core/InputReader.h"
#include "lldb/Core/RegisterValue.h"
#include "lldb/Core/State.h"
@@ -1309,6 +1313,37 @@ Debugger::FormatPrompt
return success;
}
+
+static FormatManager&
+GetFormatManager() {
+ static FormatManager g_format_manager;
+ return g_format_manager;
+}
+
+bool
+Debugger::GetFormatForType (const ConstString &type, lldb::Format& format, bool& cascade)
+{
+ return GetFormatManager().GetFormatForType(type, format, cascade);
+}
+
+void
+Debugger::AddFormatForType (const ConstString &type, lldb::Format format, bool cascade)
+{
+ GetFormatManager().AddFormatForType(type,format, cascade);
+}
+
+bool
+Debugger::DeleteFormatForType (const ConstString &type)
+{
+ return GetFormatManager().DeleteFormatForType(type);
+}
+
+void
+Debugger::LoopThroughFormatList (FormatCallback cback, void* param)
+{
+ return GetFormatManager().LoopThroughFormatList(cback, param);
+}
+
#pragma mark Debugger::SettingsController
//--------------------------------------------------
OpenPOWER on IntegriCloud