diff options
Diffstat (limited to 'tools/lldb-mi/MICmnMIResultRecord.cpp')
-rw-r--r-- | tools/lldb-mi/MICmnMIResultRecord.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/tools/lldb-mi/MICmnMIResultRecord.cpp b/tools/lldb-mi/MICmnMIResultRecord.cpp index ea6fcf8fc59c..93bb5a60ec3d 100644 --- a/tools/lldb-mi/MICmnMIResultRecord.cpp +++ b/tools/lldb-mi/MICmnMIResultRecord.cpp @@ -1,9 +1,8 @@ //===-- MICmnMIResultRecord.cpp ---------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -15,7 +14,6 @@ #include "MICmnResources.h" //++ -//------------------------------------------------------------------------------------ // Details: Map a result class to the corresponding string. // Args: veType - (R) A MI result class enumeration. // Return: const char* - The string corresponding to the result class. @@ -36,11 +34,10 @@ MapResultClassToResultClassText(CMICmnMIResultRecord::ResultClass_e veType) { return "exit"; } assert(false && "unknown CMICmnMIResultRecord::ResultClass_e"); - return NULL; + return nullptr; } //++ -//------------------------------------------------------------------------------------ // Details: Build the result record's mandatory data part. The part up to the // first // (additional) result i.e. result-record ==> [ token ] "^" @@ -54,11 +51,11 @@ static const CMIUtilString BuildResultRecord(const CMIUtilString &vrToken, CMICmnMIResultRecord::ResultClass_e veType) { const char *pStrResultRecord = MapResultClassToResultClassText(veType); - return CMIUtilString::Format("%s^%s", vrToken.c_str(), pStrResultRecord); + return CMIUtilString::Format("%s^%s", vrToken.c_str(), + CMIUtilString::WithNullAsEmpty(pStrResultRecord)); } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIResultRecord constructor. // Type: Method. // Args: None. @@ -69,7 +66,6 @@ CMICmnMIResultRecord::CMICmnMIResultRecord() : m_strResultRecord(MIRSRC(IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION)) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIResultRecord constructor. // Type: Method. // Args: vrToken - (R) The command's transaction ID or token. @@ -82,7 +78,6 @@ CMICmnMIResultRecord::CMICmnMIResultRecord(const CMIUtilString &vrToken, : m_strResultRecord(BuildResultRecord(vrToken, veType)) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIResultRecord constructor. // Type: Method. // Args: vrToken - (R) The command's transaction ID or token. @@ -99,7 +94,6 @@ CMICmnMIResultRecord::CMICmnMIResultRecord(const CMIUtilString &vrToken, } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIResultRecord destructor. // Type: Overrideable. // Args: None. @@ -109,7 +103,6 @@ CMICmnMIResultRecord::CMICmnMIResultRecord(const CMIUtilString &vrToken, CMICmnMIResultRecord::~CMICmnMIResultRecord() {} //++ -//------------------------------------------------------------------------------------ // Details: Return the MI result record as a string. The string is a direct // result of // work done on *this result record so if not enough data is added then @@ -128,7 +121,6 @@ const CMIUtilString &CMICmnMIResultRecord::GetString() const { } //++ -//------------------------------------------------------------------------------------ // Details: Add to *this result record additional information. // Type: Method. // Args: vMIValue - (R) A MI value derived object. |