aboutsummaryrefslogtreecommitdiff
path: root/lldb/tools/debugserver/source/DNBArch.cpp
diff options
context:
space:
mode:
authorKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
committerKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
commitb9c1b51e45b845debb76d8658edabca70ca56079 (patch)
treedfcb5a13ef2b014202340f47036da383eaee74aa /lldb/tools/debugserver/source/DNBArch.cpp
parentd5aa73376966339caad04013510626ec2e42c760 (diff)
downloadllvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip
llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz
llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.bz2
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
Diffstat (limited to 'lldb/tools/debugserver/source/DNBArch.cpp')
-rw-r--r--lldb/tools/debugserver/source/DNBArch.cpp95
1 files changed, 39 insertions, 56 deletions
diff --git a/lldb/tools/debugserver/source/DNBArch.cpp b/lldb/tools/debugserver/source/DNBArch.cpp
index f17a719..1312bcf 100644
--- a/lldb/tools/debugserver/source/DNBArch.cpp
+++ b/lldb/tools/debugserver/source/DNBArch.cpp
@@ -24,74 +24,57 @@ typedef std::map<uint32_t, DNBArchPluginInfo> CPUPluginInfoMap;
static uint32_t g_current_cpu_type = 0;
CPUPluginInfoMap g_arch_plugins;
-
-static const DNBArchPluginInfo *
-GetArchInfo ()
-{
- CPUPluginInfoMap::const_iterator pos = g_arch_plugins.find(g_current_cpu_type);
- if (pos != g_arch_plugins.end())
- return &pos->second;
- return NULL;
+static const DNBArchPluginInfo *GetArchInfo() {
+ CPUPluginInfoMap::const_iterator pos =
+ g_arch_plugins.find(g_current_cpu_type);
+ if (pos != g_arch_plugins.end())
+ return &pos->second;
+ return NULL;
}
+uint32_t DNBArchProtocol::GetArchitecture() { return g_current_cpu_type; }
-uint32_t
-DNBArchProtocol::GetArchitecture ()
-{
- return g_current_cpu_type;
-}
-
-bool
-DNBArchProtocol::SetArchitecture (uint32_t cpu_type)
-{
- g_current_cpu_type = cpu_type;
- bool result = g_arch_plugins.find(g_current_cpu_type) != g_arch_plugins.end();
- DNBLogThreadedIf (LOG_PROCESS, "DNBArchProtocol::SetDefaultArchitecture (cpu_type=0x%8.8x) => %i", cpu_type, result);
- return result;
+bool DNBArchProtocol::SetArchitecture(uint32_t cpu_type) {
+ g_current_cpu_type = cpu_type;
+ bool result = g_arch_plugins.find(g_current_cpu_type) != g_arch_plugins.end();
+ DNBLogThreadedIf(
+ LOG_PROCESS,
+ "DNBArchProtocol::SetDefaultArchitecture (cpu_type=0x%8.8x) => %i",
+ cpu_type, result);
+ return result;
}
-void
-DNBArchProtocol::RegisterArchPlugin (const DNBArchPluginInfo &arch_info)
-{
- if (arch_info.cpu_type)
- g_arch_plugins[arch_info.cpu_type] = arch_info;
+void DNBArchProtocol::RegisterArchPlugin(const DNBArchPluginInfo &arch_info) {
+ if (arch_info.cpu_type)
+ g_arch_plugins[arch_info.cpu_type] = arch_info;
}
-uint32_t
-DNBArchProtocol::GetRegisterCPUType ()
-{
- const DNBArchPluginInfo *arch_info = GetArchInfo ();
- if (arch_info)
- return arch_info->cpu_type;
- return 0;
+uint32_t DNBArchProtocol::GetRegisterCPUType() {
+ const DNBArchPluginInfo *arch_info = GetArchInfo();
+ if (arch_info)
+ return arch_info->cpu_type;
+ return 0;
}
const DNBRegisterSetInfo *
-DNBArchProtocol::GetRegisterSetInfo (nub_size_t *num_reg_sets)
-{
- const DNBArchPluginInfo *arch_info = GetArchInfo ();
- if (arch_info)
- return arch_info->GetRegisterSetInfo (num_reg_sets);
- *num_reg_sets = 0;
- return NULL;
+DNBArchProtocol::GetRegisterSetInfo(nub_size_t *num_reg_sets) {
+ const DNBArchPluginInfo *arch_info = GetArchInfo();
+ if (arch_info)
+ return arch_info->GetRegisterSetInfo(num_reg_sets);
+ *num_reg_sets = 0;
+ return NULL;
}
-DNBArchProtocol *
-DNBArchProtocol::Create (MachThread *thread)
-{
- const DNBArchPluginInfo *arch_info = GetArchInfo ();
- if (arch_info)
- return arch_info->Create (thread);
- return NULL;
-
+DNBArchProtocol *DNBArchProtocol::Create(MachThread *thread) {
+ const DNBArchPluginInfo *arch_info = GetArchInfo();
+ if (arch_info)
+ return arch_info->Create(thread);
+ return NULL;
}
-const uint8_t *
-DNBArchProtocol::GetBreakpointOpcode (nub_size_t byte_size)
-{
- const DNBArchPluginInfo *arch_info = GetArchInfo ();
- if (arch_info)
- return arch_info->GetBreakpointOpcode (byte_size);
- return NULL;
+const uint8_t *DNBArchProtocol::GetBreakpointOpcode(nub_size_t byte_size) {
+ const DNBArchPluginInfo *arch_info = GetArchInfo();
+ if (arch_info)
+ return arch_info->GetBreakpointOpcode(byte_size);
+ return NULL;
}
-