[Lldb-commits] [PATCH] D112931: Fix mixed disassembly showing source lines for "line 0"

Ted Woodward via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 2 07:58:15 PDT 2021


ted added inline comments.


================
Comment at: lldb/test/Shell/Commands/command-disassemble-mixed.c:11-18
+int main(int argc, char **argv)
+{
+  int i;
+
+  for (i=0; i < 10; ++i) ;
+
+  return 0;
----------------
labath wrote:
> ted wrote:
> > clayborg wrote:
> > > are we guaranteed to get some debug info with line zero in it with this example?
> > I tried this with x86 Linux clang 12.0 and our internal Hexagon clang; both gave me a line zero.
> > 
> > I ran this test on Ubuntu 18 using x86 Linux clang 12.0 and the test failed without the change and passed with it.
> Nonetheless, it would be better to test this via a .s file with some explicit .line directives. That way you could check for the actual command output instead of the absence of some string.
> 
> (Negative tests like this are very brittle, as they can be rendered ineffective by a change in the capitalization of the error message.)
The test is specifically "the first line of the source file is not displayed when we do dis -m". The only way I can think of testing this is a negative test.  If anyone can think of a better way, I'm happy to do that.
Fortunately, the message we're testing against is contained in the test, so it avoids the brittleness of changes to text in the tool.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112931/new/

https://reviews.llvm.org/D112931



More information about the lldb-commits mailing list