GithubHelp home page GithubHelp logo

Comments (10)

critiqjo avatar critiqjo commented on May 27, 2024

I'm not so sure what's going wrong... Try increasing the delay to 2 seconds here and rerun the tests.

If that doesn't work, add this line:

self.logger.info(method.__name__, args)

below this line, try reproducing this error, and give me the whole log as text.

from lldb.nvim.

tsliwkan avatar tsliwkan commented on May 27, 2024

Added delay as 2 and added the logger method. I also modified my $PATH so python2 is will be run from the system directory.

From the terminal buffer

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading
.py", line 810, in __bootstrap_inner
    self.run
  File "/Users/tsliwkan/config/nvim/plugged/lldb.nvim/rplugin/python/lldb_nvim/controlle
r.py", line 286, in run
    out += self._process.GetSTDERR(256)
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'NoneType'

Traceback (most recent call last):
  File "test.py", line 40, in <module>
    iface._exec('continue')
  File "/Users/tsliwkan/config/nvim/plugged/lldb.nvim/rplugin/python/lldb_nvim/__init__.
py", line 41, in _exec
    self.ctrl.safe_execute(args)
  File "/Users/tsliwkan/config/nvim/plugged/lldb.nvim/rplugin/python/lldb_nvim/controlle
r.py", line 93, in safe_execute
    self.safe_call(self.exec_command, [cmd])
  File "/Users/tsliwkan/config/nvim/plugged/lldb.nvim/rplugin/python/lldb_nvim/controlle
r.py", line 86, in safe_call
    raise EventLoopError("Dead event loop!")
EventLoopError: Dead event loop!
Debugger terminated! If you see no errors, everything's cool!

and from test.log

2016-04-16 14:40:13,647 [INFO @ controller.py:safe_call:69] 3032 - handle
2016-04-16 14:40:13,647 [INFO @ controller.py:run:275] 3032 - Calling handle with ['load', 'lldb-nvim.json']
2016-04-16 14:40:13,649 [INFO @ vim_x.py:call:19] 3032 - ('lldb#layout#init_buffers',)
2016-04-16 14:40:15,648 [INFO @ controller.py:safe_call:69] 3032 - mode_setup
2016-04-16 14:40:15,648 [INFO @ controller.py:run:275] 3032 - Calling mode_setup with ['debug']
2016-04-16 14:40:16,265 [INFO @ vim_x.py:call:19] 3032 - ('bufnr', '/Users/tsliwkan/config/nvim/plugged/lldb.nvim/test/ab.c', 1)
2016-04-16 14:40:16,265 [INFO @ vim_x.py:call:19] 3032 - ('setbufvar', 2, '&bl', 1)
2016-04-16 14:40:16,266 [INFO @ vim_x.py:call:19] 3032 - ('bufnr', '/Users/tsliwkan/config/nvim/plugged/lldb.nvim/test/ab.c', 1)
2016-04-16 14:40:16,266 [INFO @ vim_x.py:call:19] 3032 - ('setbufvar', 2, '&bl', 1)
2016-04-16 14:40:16,266 [INFO @ vim_x.py:call:19] 3032 - ('bufnr', '/Users/tsliwkan/config/nvim/plugged/lldb.nvim/test/ab.c', 1)
2016-04-16 14:40:16,267 [INFO @ vim_x.py:call:19] 3032 - ('setbufvar', 2, '&bl', 1)
2016-04-16 14:40:19,652 [INFO @ controller.py:safe_call:69] 3032 - exec_command
2016-04-16 14:40:21,654 [INFO @ controller.py:safe_call:69] 3032 - put_stdin
2016-04-16 14:40:23,656 [INFO @ controller.py:safe_call:69] 3032 - exec_command
2016-04-16 14:40:23,657 [CRITICAL @ controller.py:safe_call:85] 3032 - Event loop thread is probably dead!

from lldb.nvim.

tsliwkan avatar tsliwkan commented on May 27, 2024

Oops, the above test.log output is from

self.logger.info(method.__name__)

if I add the args argument I get

Note: `:LL-` commands are not bound with this test instance
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/_
_init__.py", line 859, in emit
    msg = self.format(record)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/_
_init__.py", line 732, in format
    return fmt.format(record)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/_
_init__.py", line 471, in format
    record.message = record.getMessage()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/_
_init__.py", line 335, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Logged from file controller.py, line 69

from lldb.nvim.

critiqjo avatar critiqjo commented on May 27, 2024

Ah! It was not the problem with delay. GetSTDOUT here is returning None. I don't know why it does... Try inserting this condition in-between those lines:

out = self._process.GetSTDOUT(256)
if out is None:
  break
out += self._process.GetSTDERR(256)

And check if you're able to work with the plugin, and the process stdout is getting printed...

from lldb.nvim.

critiqjo avatar critiqjo commented on May 27, 2024

Oops, the above test.log output is from

Ya, that was a mistake from my part. Remove that line... (I forgot that str(args) was required)

from lldb.nvim.

tsliwkan avatar tsliwkan commented on May 27, 2024

OK. I think this is working now. I changed controller.py a little bit more from your suggestion, the block in question now looks like

out = ''
stdout = self._process.GetSTDOUT(256)
if stdout is not None:
  out += stdout
stderr = self._process.GetSTDERR(256)
if stderr is not None:
  out += stderr 
if len(out) == 0:
  break

as I was still getting an error with += on str and None types from self._process.GetSTDERR(256). test/run.sh passed now, the term window outputs

Note: `:LL-` commands are not bound with this test instance
Debugger terminated! If you see no errors, everything's cool!
>>>

I also fired up my own "Hello world" in C, running the commands

:LLsession new
:LLmode debug
:LL continue

and the process exited with code 0!

from lldb.nvim.

critiqjo avatar critiqjo commented on May 27, 2024

Is "Hello world" actually printed in the log buffer? I'm guessing the debugger is not getting any process outputs now.

from lldb.nvim.

tsliwkan avatar tsliwkan commented on May 27, 2024

In the pane [lldb]logs

(lldb) target create a.out
Current executable set to 'a.out' (x86_64).
(lldb) breakpoint set -n main
Breakpoint 1: where = a.out`main, address = 0x0000000100000f50
(lldb) process launch
Process 3295 launched: '/Users/tsliwkan/development/a.out' (x86_64)
(lldb) continue
Process 3295 resuming
Hello, world!

from lldb.nvim.

critiqjo avatar critiqjo commented on May 27, 2024

Okay, great!! I'll push that fix soon...

from lldb.nvim.

tsliwkan avatar tsliwkan commented on May 27, 2024

Cheers! Thanks for the prompt replies. Also, thanks for your work on this plugin, it looks super slick.

from lldb.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.