简体   繁体   English

GDB逐步调试两个线程

[英]GDB step by step debugging of two threads

I have a c++ program running two threads. 我有一个运行两个线程的C ++程序。 thread A and thread B. is there a way to do step by step debugging of both threads in GDB? 线程A和线程B。有没有一种方法可以逐步调试GDB中的两个线程? steps should be something like this: 步骤应该是这样的:

  1. Stop Threads A & B 停止线A和B
  2. Switch to thread A. continue one step. 切换到线程A。继续一个步骤。
  3. Switch to thread B. continue two steps. 切换到线程B。继续执行两个步骤。

使用gdb命令“信息线程”查看该进程的所有线程,然后使用命令“ thread thread-id”顶部切换到所需的任何线程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM