This is an archive of the discontinued LLVM Phabricator instance.

[lldb-mi] Re-implement symbol-list-lines command.
ClosedPublic

Authored by apolyakov on Jun 30 2018, 5:06 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

apolyakov created this revision.Jun 30 2018, 5:06 AM

This is going to be really nice!

tools/lldb-mi/MICmdCmdSymbol.cpp
24 ↗(On Diff #153623)

Please remove the inline keyword. LLVM will inline if it's profitable anyway.
Also: could this be a constructor of CMImnMIValueTuple?

apolyakov added inline comments.Jun 30 2018, 3:03 PM
tools/lldb-mi/MICmdCmdSymbol.cpp
24 ↗(On Diff #153623)

I think it could not. There are specific strings like "0x", "pc", "line" in this function which don't have any relation to CMICmnMIValueTuple class. Also, passing them as arguments doesn't seem like a good way. But it can be discussed, maybe someone will suggest a good approach for dealing with it.

I am ok with the content of this. I will let Adrian give the final OK due to lit stuff.

I am ok with the content of this. I will let Adrian give the final OK due to lit stuff.

aprantl accepted this revision.Jul 2 2018, 8:21 AM

LGTM with the inline keyword removed.

tools/lldb-mi/MICmdCmdSymbol.cpp
24 ↗(On Diff #153623)

I see in that case keeping it local to this file seems like the better approach.

This revision is now accepted and ready to land.Jul 2 2018, 8:21 AM
clayborg accepted this revision.Jul 2 2018, 2:02 PM
apolyakov updated this revision to Diff 153818.Jul 2 2018, 3:42 PM

Removed inline keyword.

apolyakov updated this revision to Diff 153847.Jul 2 2018, 7:02 PM

Removed sb_target.IsDummy() since IsDummy won't be a member of SBTarget class. Now sb_target == rSessionInfo.GetDebugger().GetDummyTarget() is used for this goal.

aprantl accepted this revision.Jul 3 2018, 8:16 AM
This revision was automatically updated to reflect the committed changes.

symbol-list-lines.test fails on windows. I'm trying to get through the rest of the failing tests on Windows, so I can add a bot to run the tests and alert on new failures.

         ********************
         FAIL: lldb :: tools/lldb-mi/symbol/symbol-list-lines.test (45 of 1063)
         ******************** TEST 'lldb :: tools/lldb-mi/symbol/symbol-list-lines.test' FAILED ********************
         Script:
         --
         : 'RUN: at line 1';   E:/_work/4/b/LLVMBuild/Release/bin/clang.exe -o E:\_work\4\b\LLVMBuild\tools\lldb\lit\tools\lldb-mi\symbol\Output\symbol-list-lines.test.tmp E:\_work\4\s\llvm\tools\lldb\lit\tools\lldb-mi\symbol/inputs/main.c E:\_work\4\s\llvm\tools\lldb\lit\tools\lldb-mi\symbol/inputs/symbol-list-lines.c E:\_work\4\s\llvm\tools\lldb\lit\tools\lldb-mi\symbol/inputs/list-lines-helper.c -g
         : 'RUN: at line 2';   E:\_work\4\b\LLVMBuild\Release\bin\lldb-mi.EXE --synchronous E:\_work\4\b\LLVMBuild\tools\lldb\lit\tools\lldb-mi\symbol\Output\symbol-list-lines.test.tmp < E:\_work\4\s\llvm\tools\lldb\lit\tools\lldb-mi\symbol\symbol-list-lines.test | E:\_work\4\b\LLVMBuild\Release\bin\FileCheck.EXE E:\_work\4\s\llvm\tools\lldb\lit\tools\lldb-mi\symbol\symbol-list-lines.test
         --
         Exit Code: 1
         
         Command Output (stdout):
         --
         $ ":" "RUN: at line 1"
         $ "E:/_work/4/b/LLVMBuild/Release/bin/clang.exe" "-o" "E:\_work\4\b\LLVMBuild\tools\lldb\lit\tools\lldb-mi\symbol\Output\symbol-list-lines.test.tmp" "E:\_work\4\s\llvm\tools\lldb\lit\tools\lldb-mi\symbol/inputs/main.c" "E:\_work\4\s\llvm\tools\lldb\lit\tools\lldb-mi\symbol/inputs/symbol-list-lines.c" "E:\_work\4\s\llvm\tools\lldb\lit\tools\lldb-mi\symbol/inputs/list-lines-helper.c" "-g"
         $ ":" "RUN: at line 2"
         $ "E:\_work\4\b\LLVMBuild\Release\bin\lldb-mi.EXE" "--synchronous" "E:\_work\4\b\LLVMBuild\tools\lldb\lit\tools\lldb-mi\symbol\Output\symbol-list-lines.test.tmp"
         $ "E:\_work\4\b\LLVMBuild\Release\bin\FileCheck.EXE" "E:\_work\4\s\llvm\tools\lldb\lit\tools\lldb-mi\symbol\symbol-list-lines.test"
         # command stderr:
##[error]llvm\tools\lldb\lit\tools\lldb-mi\symbol\symbol-list-lines.test(14,10): Error G8E235623: expected string not found in input
     3>E:\_work\4\s\llvm\tools\lldb\lit\tools\lldb-mi\symbol\symbol-list-lines.test(14,10): error G8E235623: expected string not found in input [E:\_work\4\b\LLVMBuild\tools\lldb\lit\check-lldb-lit.vcxproj]
         
         # CHECK: ^done,lines=[{pc="0x{{[0-9A-Fa-f]+}}",line="3"},{pc="0x{{[0-9A-Fa-f]+}}",line="4"},{pc="0x{{[0-9A-Fa-f]+}}",line="5"}]
         
                  ^
         
         <stdin>:17:1: note: scanning from here
         
         (gdb)
         
         ^

Could you please provide an output of this command on Windows: E:\_work\4\b\LLVMBuild\Release\bin\lldb-mi.EXE --synchronous E:\_work\4\b\LLVMBuild\tools\lldb\lit\tools\lldb-mi\symbol\Output\symbol-list-lines.test.tmp < E:\_work\4\s\llvm\tools\lldb\lit\tools\lldb-mi\symbol\symbol-list-lines.test? I'll try to find out what causes a failure.

(gdb)
-file-exec-and-symbols "E:\\_work\\4\\b\\LLVMBuild\\tools\\lldb\\lit\\tools\\lldb-mi\\symbol\\Output\\symbol-list-lines.test.tmp"
^done
(gdb)
^done
(gdb)
=library-loaded,id="E:\\_work\\4\\b\\LLVMBuild\\tools\\lldb\\lit\\tools\\lldb-mi\\symbol\\Output\\symbol-list-lines.test.tmp",target-name="E:\\_work\\4\\b\\LLVMBuild\\tools\\lldb\\lit\\tools\\lldb-mi\\symbol\\Output\\symbol-list-lines.test.tmp",host-name="E:\\_work\\4\\b\\LLVMBuild\\tools\\lldb\\lit\\tools\\lldb-mi\\symbol\\Output\\symbol-list-lines.test.tmp",symbols-loaded="0",loaded_addr="-",size="0"
^done
(gdb)
^done
(gdb)
^done
(gdb)
^done
(gdb)
^error,msg="File Handler. Invalid file name path"
(gdb)
^done
(gdb)
^done
(gdb)
^error,msg="File Handler. Invalid file name path"
(gdb)
^done
(gdb)
^error,msg="File Handler. Invalid file name path"
(gdb)
^done
(gdb)

@apolyakov Perhaps we can mark the test as XFAIL on Windows while you investigate. Any objections?

@apolyakov Perhaps we can mark the test as XFAIL on Windows while you investigate. Any objections?

Sure, I'll do it.

symbol-list-lines.test fails on Linux too, input is compiled with gcc.

lldb/trunk/lit/tools/lldb-mi/symbol/inputs/symbol-list-lines.c
6

The check doesn't count this line

lldb/trunk/lit/tools/lldb-mi/symbol/symbol-list-lines.test
14

here

symbol-list-lines.test fails on Linux too, input is compiled with gcc.

Thanks for noting this. Fixed in r342329 (https://reviews.llvm.org/D52101).

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.cpp