[lldb-dev] Everyone: please download, build and test the new iohandler branch
Greg Clayton
gclayton at apple.com
Fri Jan 10 17:14:59 PST 2014
We have an inlined copy of "pexpect" in "lldb/test/pexpect-2.4", but this isn't the module you guys are using (you are using "/usr/lib/python2.7/dist-packages/pexpect.py").
I noticed we are not shutting down lldb or exiting the python interpreter, you might try adding:
child.sendline("quit()")
child.sendline("quit")
To first quit the embedded interpreter and then quit the other LLDB?
Not sure if this will help. But I can't see what you would be getting the EOF error. You might try seeing if you can get it to run using the "lldb/test/pexpect-2.4" version of pexpect.py, and adding the extra quit statements...
On Jan 10, 2014, at 4:00 PM, Steve Pucci <spucci at google.com> wrote:
> There's new information here: We discovered that when we got those 3 tests Todd mentions below, that was only because we gave the test suite a set of flags that resulted in those tests being skipped. The tests pass reliably on the main trunk branch.
>
> We spent some time investigating the failure of TestConvenienceVariables on the iohandler branch. It is not a consistent failure, and even when it fails, it is not consistent where in the test that it fails. The failure is always an EOF failure, apparently reading from the child lldb process. I'm attaching a transcript with tracing turned on for the particular test. What's odd is that the failure happens at different points (sometimes when looking for the output from lldb.target, sometimes when looking for the output from lldb.thread, sometimes lldb.frame). I'm guessing that there is something that is causing the child to die asynchronously but I don't know what that might be.
>
> - Steve
>
> Command invoked: python ../../llvm/tools/lldb/test/dotest.py -C gcc --executable /usr/local/google/home/spucci/lldb-iohandler/work/build/test/../Debug+Asserts/bin/lldb -p TestConvenienceVariables
> compilers=['gcc']
>
> Configuration: arch=x86_64 compiler=gcc
> ----------------------------------------------------------------------
> Collected 2 tests
>
> .=success F=fail E=error s=skipped x=expected-fail u=unexpected-success
>
> sCurrent executable set to '/usr/local/google/home/spucci/lldb-iohandler/work/llvm/tools/lldb/test/functionalities/embedded_interpreter/a.out' (x86_64).
> (lldb) breakpoint set -f main.c -l 4
> Breakpoint 1: where = a.out`main + 15 at main.c:4, address = 0x00000000004004df
> (lldb) run
> Process 26868 launching
> Process 26868 stopped
> * thread #1: tid = 26868, 0x00007fd7840596b0, name = 'a.out', stop reason = trace
> frame #0: 0x00007fd7840596b0
> -> 0x7fd7840596b0: movq %rsp, %rdi
> 0x7fd7840596b3: callq 0x7fd78405d010
> 0x7fd7840596b8: movq %rax, %r12
> 0x7fd7840596bb: movl 0x2215ff(%rip), %eax
> (lldb) Process 26868 launched: '/usr/local/google/home/spucci/lldb-iohandler/work/llvm/tools/lldb/test/functionalities/embedded_interpreter/a.out' (x86_64)
> (lldb) [7DProcess 26868 stopped
> * thread #1: tid = 26868, 0x00000000004004df a.out`main(argc=1, argv=0x00007fff4c29dd98) + 15 at main.c:4, name = 'a.out', stop reason = breakpoint 1.1
> frame #0: 0x00000000004004df a.out`main(argc=1, argv=0x00007fff4c29dd98) + 15 at main.c:4
> 1 #include <stdio.h>
> 2
> 3 int main(int argc, char const *argv[]) {
> -> 4 printf("Hello world.\n");
> 5 return 0;
> 6 }
> (lldb) script
> Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
> >>> print lldb.debugger
> Debugger (instance: "debugger_1", id: 1)
> >>> print lldb.target
> a.out
> >>> print lldb.process
> SBProcess: pid = 26868, state = stopped, threads = 1, executable = a.out
> >>> print lldb.thread
> SBThread: tid = 0x68f4
> >>> print lldb.frame
> E
> ======================================================================
> ERROR: test_with_dwarf_and_run_commands (TestConvenienceVariables.ConvenienceVariablesCase)
> Test convenience variables lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/usr/local/google/home/spucci/lldb-iohandler/work/llvm/tools/lldb/test/lldbtest.py", line 370, in wrapper
> return func(self, *args, **kwargs)
> File "/usr/local/google/home/spucci/lldb-iohandler/work/llvm/tools/lldb/test/lldbtest.py", line 722, in wrapper
> func(*args, **kwargs)
> File "/usr/local/google/home/spucci/lldb-iohandler/work/llvm/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 25, in test_with_dwarf_and_run_commands
> self.convenience_variables()
> File "/usr/local/google/home/spucci/lldb-iohandler/work/llvm/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 82, in convenience_variables
> child.expect_exact(python_prompt)
> File "/usr/lib/python2.7/dist-packages/pexpect.py", line 1343, in expect_exact
> return self.expect_loop(searcher_string(pattern_list), timeout, searchwindowsize)
> File "/usr/lib/python2.7/dist-packages/pexpect.py", line 1396, in expect_loop
> raise EOF (str(e) + '\n' + str(self))
> EOF: End Of File (EOF) in read_nonblocking(). Exception style platform.
> <pexpect.spawn object at 0x2d27490>
> version: 2.3 ($Revision: 399 $)
> command: /usr/local/google/home/spucci/lldb-iohandler/work/build/test/../Debug+Asserts/bin/lldb
> args: ['/usr/local/google/home/spucci/lldb-iohandler/work/build/test/../Debug+Asserts/bin/lldb', '--no-lldbinit', '/usr/local/google/home/spucci/lldb-iohandler/work/llvm/tools/lldb/test/functionalities/embedded_interpreter/a.out']
> searcher: searcher_string:
> 0: ">>> "
> buffer (last 100 chars):
> before (last 100 chars): print lldb.frame
>
> after: <class 'pexpect.EOF'>
> match: None
> match_index: None
> exitstatus: None
> flag_eof: True
> pid: 26865
> child_fd: 4
> closed: False
> timeout: 30
> delimiter: <class 'pexpect.EOF'>
> logfile: None
> logfile_read: <open file '<stdout>', mode 'w' at 0x7f2bf1a681e0>
> logfile_send: None
> maxread: 2000
> ignorecase: False
> searchwindowsize: None
> delaybeforesend: 0.05
> delayafterclose: 0.1
> delayafterterminate: 0.1
> Config=x86_64-gcc
>
>
>
> On Fri, Jan 10, 2014 at 12:55 PM, Todd Fiala <tfiala at google.com> wrote:
> Our final 3 test issues were covered by failure to set the CC and CXX to our gcc/g++ during the test run.
>
> We're now all clear assuming we check in the patch above.
>
> Any comments on the fix above?
>
> -Todd
>
>
> On Fri, Jan 10, 2014 at 12:35 PM, Todd Fiala <tfiala at google.com> wrote:
> We have a fix in the iohandler branch for a test failure of TestCommandRegex.py. When using libedit, the multi-line handler is stripping one too many lines from the collected input. This is causing 'command regex' and its related test to fail. The test was also expecting different output than the command currently emits.
>
> Here is a patch for the proposed fix:
>
> Index: test/functionalities/command_regex/TestCommandRegex.py
> ===================================================================
> --- test/functionalities/command_regex/TestCommandRegex.py (revision 198951)
> +++ test/functionalities/command_regex/TestCommandRegex.py (working copy)
> @@ -13,9 +13,9 @@
> mydir = TestBase.compute_mydir(__file__)
>
> def test_command_regex(self):
> - """Test a simple scenario of 'command regexp' invocation and subsequent use."""
> + """Test a simple scenario of 'command regex' invocation and subsequent use."""
> prompt = "(lldb) "
> - regex_prompt = "Enter regular expressions in the form 's/<regex>/<subst>/' and terminate with an empty line:\r\n"
> + regex_prompt = "Enter one of more sed substitution commands in the form: 's/<regex>/<subst>/'.\r\nTerminate the substitution list with an empty line.\r\n"
> regex_prompt1 = "\r\n"
>
> child = pexpect.spawn('%s %s' % (self.lldbHere, self.lldbOption))
> Index: source/Commands/CommandObjectCommands.cpp
> ===================================================================
> --- source/Commands/CommandObjectCommands.cpp (revision 198951)
> +++ source/Commands/CommandObjectCommands.cpp (working copy)
> @@ -956,10 +956,9 @@
> {
> if (line_idx == UINT32_MAX)
> {
> - // Remove the last "DONE" line from "lines" so it doesn't appear
> - // in our final commands and return true to indicate we are done
> - // getting lines
> - lines.PopBack();
> + // Return true to indicate we are done getting lines (this
> + // is a "fake" line - the real terminating blank line was
> + // removed during a previous call with the code below)
> error.Clear();
> return LineStatus::Done;
> }
>
> Any feedback on that fix?
>
> After this, we are down to the following failures on the iohandler branch, Ubuntu 12.04, gcc 4.8.2, with latest configure-enabled libedit built from source:
>
> Ran 272 tests.
> Failing Tests (3)
> FAIL: LLDB (suite) :: TestDataFormatterCategories.py (Linux tfiala2.mtv.corp.google.com 3.2.5-gg1336 #1 SMP Thu Aug 29 02:37:18 PDT 2013 x86_64 x86_64)
> FAIL: LLDB (suite) :: TestDataFormatterGlobals.py (Linux tfiala2.mtv.corp.google.com 3.2.5-gg1336 #1 SMP Thu Aug 29 02:37:18 PDT 2013 x86_64 x86_64)
> FAIL: LLDB (suite) :: TestConvenienceVariables.py (Linux tfiala2.mtv.corp.google.com 3.2.5-gg1336 #1 SMP Thu Aug 29 02:37:18 PDT 2013 x86_64 x86_64)
> make: *** [check-local] Error 1
>
> We're working on these now.
>
>
> On Fri, Jan 10, 2014 at 10:47 AM, Steve Pucci <spucci at google.com> wrote:
> > Note even with this, we are still having a libedit issue on multiline input handling (as exposed through the regex command test). We're looking at this now.
>
> I believe I know what this is. More when I've confirmed...
>
> - Steve
>
>
>
> On Fri, Jan 10, 2014 at 10:44 AM, Greg Clayton <gclayton at apple.com> wrote:
> Looks good!
>
> On Jan 10, 2014, at 10:40 AM, Todd Fiala <tfiala at google.com> wrote:
>
> > There was a slight tweak to the change above to deal with modifications that just came in on IOHandler's TreeItem.
> >
> > Here is the change submission:
> >
> > Sending lib/Makefile
> > Sending source/Core/IOHandler.cpp
> > Transmitting file data ..
> >
> > Committed revision 198951.
> >
> > Final patch attached.
> >
> >
> >
> > On Fri, Jan 10, 2014 at 10:21 AM, Todd Fiala <tfiala at google.com> wrote:
> > Here is the final patch we need to get lldb compiling on the iochannel branch on Ubuntu 12.04 x86_64 using configure and makefiles:
> >
> > Index: source/Core/IOHandler.cpp
> > ===================================================================
> > --- source/Core/IOHandler.cpp (revision 198946)
> > +++ source/Core/IOHandler.cpp (working copy)
> > @@ -2251,7 +2251,24 @@
> > m_did_calculate_children (false)
> > {
> > }
> > -
> > +
> > + TreeItem &
> > + operator=(const TreeItem &rhs)
> > + {
> > + if (this != &rhs)
> > + {
> > + m_parent = rhs.m_parent;
> > + m_delegate = rhs.m_delegate;
> > + m_user_data = rhs.m_user_data;
> > + m_row_idx = rhs.m_row_idx;
> > + m_children = rhs.m_children;
> > + m_might_have_children = rhs.m_might_have_children;
> > + m_is_expanded = rhs.m_is_expanded;
> > + m_did_calculate_children = rhs.m_did_calculate_children;
> > + }
> > + return *this;
> > + }
> > +
> > size_t
> > GetDepth () const
> > {
> > Index: lib/Makefile
> > ===================================================================
> > --- lib/Makefile (revision 198946)
> > +++ lib/Makefile (working copy)
> > @@ -148,7 +148,7 @@
> > # Don't allow unresolved symbols.
> > LLVMLibsOptions += -Wl,--no-undefined
> > # Link in python
> > - LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt
> > + LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt -ledit -lncurses
> > LLVMLibsOptions += -Wl,--soname,lib$(LIBRARYNAME)$(SHLIBEXT)
> > endif
> >
> > Note even with this, we are still having a libedit issue on multiline input handling (as exposed through the regex command test). We're looking at this now. I'll go ahead and put up this patch on iochannel, though.
> >
> >
> > On Fri, Jan 10, 2014 at 9:54 AM, Todd Fiala <tfiala at google.com> wrote:
> > Okay - so since Abid is seeing it as well, I'm inclined to put in both (1) the makefile fix for non-cmake (i.e. configure-based) makes, and (2) the explicit operator=.
> >
> > We're tracing through an editline failure in a regex test at the moment. These are test failures, though, not build failures. It is probably worth it for me to get those two build break issues in, then, before we resolve all the test failures.
> >
> > -Todd
> >
> >
> > On Fri, Jan 10, 2014 at 9:37 AM, Greg Clayton <gclayton at apple.com> wrote:
> > Patch looks good.
> >
> > On Jan 9, 2014, at 1:10 PM, Steve Pucci <spucci at google.com> wrote:
> >
> > > Hi all,
> > >
> > > Running the iohandler branch on Ubuntu 12.04 using gcc 4.8.2, using configure rather than CMake, ran into a similar issue as Abid (needed to add -lcurses, and also add back in -ledit; patch attached). I'm getting these test failures:
> > >
> > > Ran 272 tests.
> > > Failing Tests (4)
> > > FAIL: LLDB (suite) :: TestCommandRegex.py (Linux spucci-linux.mtv.corp.google.com 3.2.5-gg1336 #1 SMP Thu Aug 29 02:37:18 PDT 2013 x86_64 x86_64)
> > > FAIL: LLDB (suite) :: TestDataFormatterCategories.py (Linux spucci-linux.mtv.corp.google.com 3.2.5-gg1336 #1 SMP Thu Aug 29 02:37:18 PDT 2013 x86_64 x86_64)
> > > FAIL: LLDB (suite) :: TestDataFormatterGlobals.py (Linux spucci-linux.mtv.corp.google.com 3.2.5-gg1336 #1 SMP Thu Aug 29 02:37:18 PDT 2013 x86_64 x86_64)
> > > FAIL: LLDB (suite) :: TestConvenienceVariables.py (Linux spucci-linux.mtv.corp.google.com 3.2.5-gg1336 #1 SMP Thu Aug 29 02:37:18 PDT 2013 x86_64 x86_64)
> > >
> > > We will be looking at these shortly, but we're also tracking a compilation error that's blocking this now on this branch (more about that shortly).
> > >
> > > - Steve
> > >
> > > Patch:
> > >
> > > Index: lib/Makefile
> > > ===================================================================
> > > --- lib/Makefile (revision 198878)
> > > +++ lib/Makefile (working copy)
> > > @@ -148,7 +148,7 @@
> > > # Don't allow unresolved symbols.
> > > LLVMLibsOptions += -Wl,--no-undefined
> > > # Link in python
> > > - LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt
> > > + LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt -ledit -lncurses
> > > LLVMLibsOptions += -Wl,--soname,lib$(LIBRARYNAME)$(SHLIBEXT)
> > > endif
> > >
> > >
> > >
> > >
> > > On Wed, Jan 8, 2014 at 9:09 AM, Abid, Hafiz <Hafiz_Abid at mentor.com> wrote:
> > > > Great, please check in any changes you need in order to build!
> > > Committed in revision 198773.
> > >
> > > >
> > > > On Jan 7, 2014, at 8:21 AM, Abid, Hafiz <Hafiz_Abid at mentor.com> wrote:
> > > >
> > > > > Hi Greg,
> > > > >
> > > > >> -----Original Message-----
> > > > >> From: lldb-dev-bounces at cs.uiuc.edu
> > > > >> [mailto:lldb-dev-bounces at cs.uiuc.edu]
> > > > >> On Behalf Of Greg Clayton
> > > > >> Sent: 02 January 2014 22:57
> > > > >> To: lldb-dev at cs.uiuc.edu
> > > > >> Subject: [lldb-dev] Everyone: please download, build and test the new
> > > > >> iohandler branch
> > > > >>
> > > > >> svn co
> > > > >> https://$USER@llvm.org/svn/llvm-project/lldb/branches/iohandler
> > > > >>
> > > > >> The first step is to get it building for your platform as I am sure
> > > > >> the Makefiles are out of date.
> > > > >>
> > > > >> This branch will soon be merged back into top of tree, but I wanted
> > > > >> to give all the major platforms time to submit patches against this
> > > > >> to get things working on all systems before any buildbots get broken.
> > > > >>
> > > > >> The major benefits include:
> > > > >> - editline is not built into the lldb shared library so all IOHandler
> > > > >> objects can use the editline functionality.
> > > > >> - autocomplete now working in the embedded python interpreter
> > > > >> - history now working in the embedded python interpreter
> > > > >> - autocomplete now working for multi-line command entering (like in
> > > > >> "breakpoint command add")
> > > > >> - when editing multiple lines you can use the UP and DOWN arrow keys
> > > > >> to edit previous lines. This makes multi-line expressions and
> > > > >> commands much easier to write and edit. Use ^B and ^N for next/prev
> > > > >> history when in multi- line mode.
> > > > >> - curses is now supported with the new IOHandler infrastructure. To
> > > > >> try this out, run and hit a breakpoint, and type "gui" on the command
> > > > >> line to drop into the curses GUI mode! Lots of stuff isn't hooked up
> > > > >> yet, but I am sure the open source community can help fill in some
> > > > >> new views and improve existing ones.
> > > > >>
> > > > >> So please get this building and test this on your system and let us
> > > > >> know what issues you run into.
> > > > >
> > > > > I tried to build this branch using cmake on Ubuntu 12.04 with gcc 4.8.
> > > > > There were some build issues that I fixed as follows.
> > > > >
> > > > > Include limits.h in Editline.cpp for PATH_MAX and libncurses in the cmake
> > > > files.
> > > > > I also noted that libedit version on my system was missing some
> > > > > defines like EL_PROMPT_ESC. I have to get hold of a recent version for
> > > > libedit.
> > > > > After that lldb builds fine on my system. Still have to test it though.
> > > > >
> > > > > I am pasting the changes needed for the build below.
> > > > >
> > > > >
> > > > > Index: source/Host/common/Editline.cpp
> > > > >
> > > > ================================================================
> > > > ===
> > > > > --- source/Host/common/Editline.cpp (revision 198682)
> > > > > +++ source/Host/common/Editline.cpp (working copy)
> > > > > @@ -15,6 +14,8 @@
> > > > > #include "lldb/Core/StringList.h"
> > > > > #include "lldb/Host/Host.h"
> > > > >
> > > > > +#include <limits.h>
> > > > > +
> > > > > using namespace lldb;
> > > > > using namespace lldb_private;
> > > > >
> > > > > Index: source/Symbol/ClangASTType.cpp
> > > > >
> > > > ================================================================
> > > > ===
> > > > > --- source/Symbol/ClangASTType.cpp (revision 198682)
> > > > > +++ source/Symbol/ClangASTType.cpp (working copy)
> > > > > @@ -1135,7 +1135,7 @@
> > > > > if (typedef_type)
> > > > > {
> > > > > const TypedefNameDecl *typedef_decl = typedef_type->getDecl();
> > > > > - type_name = typedef_decl-
> > > > >getQualifiedNameAsString(printing_policy);
> > > > > + type_name = typedef_decl->getQualifiedNameAsString();
> > > > > }
> > > > > else
> > > > > {
> > > > > Index: CMakeLists.txt
> > > > >
> > > > ================================================================
> > > > ===
> > > > > --- CMakeLists.txt (revision 198682)
> > > > > +++ CMakeLists.txt (working copy)
> > > > > @@ -265,6 +265,10 @@
> > > > > list(APPEND system_libs execinfo)
> > > > > endif()
> > > > >
> > > > > +if (CMAKE_SYSTEM_NAME MATCHES "Linux")
> > > > > + list(APPEND system_libs ncurses)
> > > > > +endif()
> > > > > +
> > > > > #add_subdirectory(include)
> > > > > add_subdirectory(docs)
> > > > > if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
> > > > >
> > > > > Regards,
> > > > > Abid
> > > > >
> > > > >>
> > > > >> Greg Clayton
> > > > >>
> > > > >> _______________________________________________
> > > > >> lldb-dev mailing list
> > > > >> lldb-dev at cs.uiuc.edu
> > > > >> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
> > >
> > >
> > > _______________________________________________
> > > lldb-dev mailing list
> > > lldb-dev at cs.uiuc.edu
> > > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
> > >
> > > <iohandler-patch.txt>
> >
> > _______________________________________________
> > lldb-dev mailing list
> > lldb-dev at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
> >
> >
> >
> > --
> > Todd Fiala | Software Engineer | tfiala at google.com | 650-943-3180
> >
> >
> >
> >
> > --
> > Todd Fiala | Software Engineer | tfiala at google.com | 650-943-3180
> >
> >
> >
> >
> > --
> > Todd Fiala | Software Engineer | tfiala at google.com | 650-943-3180
> >
> > <spucci-2014-01-10_r2.diff>
>
>
>
>
>
> --
> Todd Fiala | Software Engineer | tfiala at google.com | 650-943-3180
>
>
>
>
> --
> Todd Fiala | Software Engineer | tfiala at google.com | 650-943-3180
>
>
More information about the lldb-dev
mailing list