Giter Site home page Giter Site logo

Capture debugee output about pygdbmi HOT 3 CLOSED

cs01 avatar cs01 commented on May 4, 2024
Capture debugee output

from pygdbmi.

Comments (3)

cs01 avatar cs01 commented on May 4, 2024

Hi, thanks for the question. This happens because gdb is run as a subprocess, which causes event handling for new data to stdout/stderr to become less reliable.

There are a few options, you can can experiment with them and see which help

  • interrupt gdb with the interrupt_gdb method of the GdbController class
  • force flush output check for output with -data-evaluate-expression fflush(0) or call fflush(0). I think this needs to be run after interrupting.
  • periodically call the get_gdb_response method of the GdbController class, with raise_error_on_timeout=False. Similar to the previous bullet, you may have to interrupt gdb before running this.

Let me know if you get it to work.

from pygdbmi.

vivi00790 avatar vivi00790 commented on May 4, 2024

sorry for the late reply
i've tried the way above a bit and i got some more question
in my debugee some commands need more than one seconds(defalt value of gdbController.write()) to execute, and this will also cause GdbTimeoutError
my question is: if i don't clearly know the command execute time, should i have to perform the way above (periodcally interrupt then get_gdb_response) on every command i entered? If so, is it possible that this method will cause some synchronization problems in the debugee?

from pygdbmi.

cs01 avatar cs01 commented on May 4, 2024

You shouldn't have to do it for every single method. For example, you can do

get_gdb_response(timeout_sec=10) if you know the command can take up to 10 seconds.

You could also do get_gdb_response(raise_error_on_timeout=False) if you don't care about the output for some reason.

from pygdbmi.

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.