From 514d8cd83ea7408f7f4215a5f0233c6f10c7a1ca Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 23 Sep 2016 18:06:53 +0000 Subject: Update the prompt related functions to use StringRefs. llvm-svn: 282269 --- lldb/source/Core/Debugger.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lldb/source/Core/Debugger.cpp') diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index 7a727479e16..806f9151bf2 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -276,7 +276,7 @@ Error Debugger::SetPropertyValue(const ExecutionContext *exe_ctx, if (error.Success()) { // FIXME it would be nice to have "on-change" callbacks for properties if (strcmp(property_path, g_properties[ePropertyPrompt].name) == 0) { - const char *new_prompt = GetPrompt(); + llvm::StringRef new_prompt = GetPrompt(); std::string str = lldb_utility::ansi::FormatAnsiTerminalCodes( new_prompt, GetUseColor()); if (str.length()) @@ -337,16 +337,16 @@ bool Debugger::GetNotifyVoid() const { nullptr, idx, g_properties[idx].default_uint_value != 0); } -const char *Debugger::GetPrompt() const { +llvm::StringRef Debugger::GetPrompt() const { const uint32_t idx = ePropertyPrompt; return m_collection_sp->GetPropertyAtIndexAsString( nullptr, idx, g_properties[idx].default_cstr_value); } -void Debugger::SetPrompt(const char *p) { +void Debugger::SetPrompt(llvm::StringRef p) { const uint32_t idx = ePropertyPrompt; m_collection_sp->SetPropertyAtIndexAsString(nullptr, idx, p); - const char *new_prompt = GetPrompt(); + llvm::StringRef new_prompt = GetPrompt(); std::string str = lldb_utility::ansi::FormatAnsiTerminalCodes(new_prompt, GetUseColor()); if (str.length()) -- cgit v1.2.3