diff options
author | Tamas Berghammer <tberghammer@google.com> | 2015-03-13 10:32:37 +0000 |
---|---|---|
committer | Tamas Berghammer <tberghammer@google.com> | 2015-03-13 10:32:37 +0000 |
commit | e724af10b67b91a594568444772a9c4f7d705f80 (patch) | |
tree | bcdd16cbf9ec4437a1a5199d2d0e6aefb0ec9a6a | |
parent | a73d657e369527d1882bb762cf821ea1aed96e7a (diff) | |
download | bcm5719-llvm-e724af10b67b91a594568444772a9c4f7d705f80.tar.gz bcm5719-llvm-e724af10b67b91a594568444772a9c4f7d705f80.zip |
Remove non const version of GetArchitecture from Target.h
The architecture of a target should be updated only by the
SetArchitecture method so the target can correctly manage its modules.
llvm-svn: 232152
-rw-r--r-- | lldb/include/lldb/Target/Target.h | 6 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 21 |
2 files changed, 12 insertions, 15 deletions
diff --git a/lldb/include/lldb/Target/Target.h b/lldb/include/lldb/Target/Target.h index 81af7ba2252..6785c3e87dd 100644 --- a/lldb/include/lldb/Target/Target.h +++ b/lldb/include/lldb/Target/Target.h @@ -1044,12 +1044,6 @@ public: bool ModuleIsExcludedForUnconstrainedSearches (const lldb::ModuleSP &module_sp); - ArchSpec & - GetArchitecture () - { - return m_arch; - } - const ArchSpec & GetArchitecture () const { diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index e68a5d41a3a..67dcfad5cf7 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -1091,7 +1091,7 @@ ProcessGDBRemote::DidLaunchOrAttach (ArchSpec& process_arch) if (process_arch.IsValid()) { - ArchSpec &target_arch = GetTarget().GetArchitecture(); + const ArchSpec &target_arch = GetTarget().GetArchitecture(); if (target_arch.IsValid()) { if (log) @@ -1121,20 +1121,23 @@ ProcessGDBRemote::DidLaunchOrAttach (ArchSpec& process_arch) { // Fill in what is missing in the triple const llvm::Triple &remote_triple = process_arch.GetTriple(); - llvm::Triple &target_triple = target_arch.GetTriple(); - if (target_triple.getVendorName().size() == 0) + llvm::Triple new_target_triple = target_arch.GetTriple(); + if (new_target_triple.getVendorName().size() == 0) { - target_triple.setVendor (remote_triple.getVendor()); + new_target_triple.setVendor (remote_triple.getVendor()); - if (target_triple.getOSName().size() == 0) + if (new_target_triple.getOSName().size() == 0) { - target_triple.setOS (remote_triple.getOS()); + new_target_triple.setOS (remote_triple.getOS()); - if (target_triple.getEnvironmentName().size() == 0) - target_triple.setEnvironment (remote_triple.getEnvironment()); + if (new_target_triple.getEnvironmentName().size() == 0) + new_target_triple.setEnvironment (remote_triple.getEnvironment()); } - } + ArchSpec new_target_arch = target_arch; + new_target_arch.SetTriple(new_target_triple); + GetTarget().SetArchitecture(new_target_arch); + } } if (log) |