This is an archive of the discontinued LLVM Phabricator instance.

Include comments in LLDB-MI disassembly, and other MI changes
AbandonedPublic

Authored by EwanCrawford on Apr 9 2015, 9:01 AM.

Details

Reviewers
abidh
ki.stfu
Summary

Hi everybody,

This patch includes the following three LLDB-MI changes:

  1. Showing comments in disassembly code. The comments included in LLDB disassembly after the semi-colon are currently missing in MI, e.g.

    ^done,asm_insns=[...,{address="0x00000000004004ff",func-name="main",offset="18",size="2",inst="jmp 0x40050b ; <+30> at main.c:7"}]

    instead of

    ^done,asm_insns=[...,{address="0x00000000004004ff",func-name="main",offset="18",size="2",inst="jmp 0x40050b"}]
  1. Improved logging. Moves log file to temp directory from current directory. Change log file name to reflect the time & date the log was taken on.
  1. Support for '-var-create $regname' -var-create $regname is currently processed using expression evaluation, meaning the variable binds to the result of the expression not the register. Therefore any subsequent calls to -var-assign will not update the register. Fixed by detecting '$' prefix for registers.

Thanks,
Ewan

Diff Detail

Repository
rL LLVM

Event Timeline

EwanCrawford retitled this revision from to Include comments in LLDB-MI disassembly, and other MI changes.
EwanCrawford updated this object.
EwanCrawford edited the test plan for this revision. (Show Details)
EwanCrawford added reviewers: ki.stfu, abidh.
EwanCrawford set the repository for this revision to rL LLVM.
EwanCrawford added subscribers: deepak2427, domipheus.
EwanCrawford added a subscriber: Unknown Object (MLST).
ki.stfu requested changes to this revision.Apr 9 2015, 9:35 AM
ki.stfu edited edge metadata.

Create a separate review for each of these changes and take into account the following comments please:

tools/lldb-mi/MICmdCmdData.cpp
413–419

minor fix:

const MIchar *pStrComment = instrt.GetComment(sbTarget);
CMIUtilString strComment;
if (pStrComment != nullptr && *pStrComment != '\0')
    strComment = CMIUtilString::Format("\t\t; %s", pStrComment);
442
const CMICmnMIValueConst miValueConst5(CMIUtilString::Format("%s %s%s", pStrMnemonic, pStrOperands, strComment.c_str()))
tools/lldb-mi/MICmdCmdVar.cpp
182–186
if (rStrExpression[0] == '$')
{
    const CMIUtilString rStrRegister(rStrExpression.substr(1).c_str());
    value = frame.FindRegister(rStrRegister.c_str());
}
tools/lldb-mi/MICmnLogMediumFile.cpp
30

why? add any ext back, please.

tools/lldb-mi/MIUtilDateTimeStd.cpp
85–88
std::time(&m_rawTime);
const std::tm *pTi = std::localtime(&m_rawTime);
const CMIUtilString strTime(CMIUtilString::Format("%d-%02d-%02d--%02d-%02d-%02d", pTi->tm_year + 1900, pTi->tm_mon,
                                                  pTi->tm_mday, pTi->tm_hour, pTi->tm_min, pTi->tm_sec));
tools/lldb-mi/MIUtilSystemLinux.cpp
107

Does it work on Windows?

tools/lldb-mi/MIUtilSystemWindows.cpp
139

Use dynamic memory

This revision now requires changes to proceed.Apr 9 2015, 9:35 AM

Thanks for the comments ki.stfu, I'll go ahead and split the patch up.

EwanCrawford abandoned this revision.Apr 10 2015, 3:02 AM