【问题标题】:How to halt execution of a single thread when a breakpoint is reached with Eclipse CDT + GDB使用 Eclipse CDT + GDB 到达断点时如何停止执行单个线程
【发布时间】:2017-10-25 20:09:54
【问题描述】:

我正在使用 gdb 7.4 在 Eclipse Oxygen 中调试多线程 C++ 应用程序 默认行为是当到达断点时所有线程都停止,但是,我希望只有到达断点的线程停止,所有其他线程继续运行。

怎么可能?

【问题讨论】:

    标签: multithreading gdb eclipse-cdt


    【解决方案1】:

    怎么可能?

    (gdb) set non-stop on 
    

    默认情况下,不间断模式是关闭的。您希望它开启,请参阅 gdb 内置帮助:

    (gdb) help set non-stop 
    Set whether gdb controls the inferior in non-stop mode.
    When debugging a multi-threaded program and this setting is
    off (the default, also called all-stop mode), when one thread stops
    (for a breakpoint, watchpoint, exception, or similar events), GDB stops
    all other threads in the program while you interact with the thread of
    interest.  When you continue or step a thread, you can allow the other
    threads to run, or have them remain stopped, but while you inspect any
    thread's state, all threads stop.
    
    In non-stop mode, when one thread stops, other threads can continue
    to run freely.  You'll be able to step each thread independently,
    leave it stopped or free to run as needed.
    (gdb) 
    

    【讨论】:

      猜你喜欢
      • 2013-10-07
      • 1970-01-01
      • 2016-06-30
      • 1970-01-01
      • 1970-01-01
      • 2011-07-05
      • 2020-01-11
      • 1970-01-01
      • 2017-12-05
      相关资源
      最近更新 更多