diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-06-13 22:08:14 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-06-13 22:08:14 +0000 |
commit | 937348cd1359b30359b958ca81b7e7d8711b443e (patch) | |
tree | f4249e96df7ff194b336fdbf8cbd6c690d5a39f2 /lldb/source/API/SBAttachInfo.cpp | |
parent | 07570f55e4ad104a474efff4ae1a3c3b49145fed (diff) | |
download | bcm5719-llvm-937348cd1359b30359b958ca81b7e7d8711b443e.tar.gz bcm5719-llvm-937348cd1359b30359b958ca81b7e7d8711b443e.zip |
[FileSpec] Make style argument mandatory for SetFile. NFC
SetFile has an optional style argument which defaulted to the native
style. This patch makes that argument mandatory so clients of the
FileSpec class are forced to think about the correct syntax.
At the same time this introduces a (protected) convenience method to
update the file from within the FileSpec class that keeps the current
style.
These two changes together prevent a potential pitfall where the style
might be forgotten, leading to the path being updated and the style
unintentionally being changed to the host style.
llvm-svn: 334663
Diffstat (limited to 'lldb/source/API/SBAttachInfo.cpp')
-rw-r--r-- | lldb/source/API/SBAttachInfo.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/API/SBAttachInfo.cpp b/lldb/source/API/SBAttachInfo.cpp index e6500c468ec..d6cb212dedf 100644 --- a/lldb/source/API/SBAttachInfo.cpp +++ b/lldb/source/API/SBAttachInfo.cpp @@ -26,14 +26,16 @@ SBAttachInfo::SBAttachInfo(lldb::pid_t pid) SBAttachInfo::SBAttachInfo(const char *path, bool wait_for) : m_opaque_sp(new ProcessAttachInfo()) { if (path && path[0]) - m_opaque_sp->GetExecutableFile().SetFile(path, false); + m_opaque_sp->GetExecutableFile().SetFile(path, false, + FileSpec::Style::native); m_opaque_sp->SetWaitForLaunch(wait_for); } SBAttachInfo::SBAttachInfo(const char *path, bool wait_for, bool async) : m_opaque_sp(new ProcessAttachInfo()) { if (path && path[0]) - m_opaque_sp->GetExecutableFile().SetFile(path, false); + m_opaque_sp->GetExecutableFile().SetFile(path, false, + FileSpec::Style::native); m_opaque_sp->SetWaitForLaunch(wait_for); m_opaque_sp->SetAsync(async); } @@ -77,7 +79,8 @@ void SBAttachInfo::SetProcessPluginName(const char *plugin_name) { void SBAttachInfo::SetExecutable(const char *path) { if (path && path[0]) - m_opaque_sp->GetExecutableFile().SetFile(path, false); + m_opaque_sp->GetExecutableFile().SetFile(path, false, + FileSpec::Style::native); else m_opaque_sp->GetExecutableFile().Clear(); } |