Linux:给进程打断点,查看进程状态

1.touch myprocess.c
2.ls > Makefile
3.vim Makefile
Makefile中加 -g 表示可调试
在这里插入图片描述
4.
在这里插入图片描述

 #include<stdio.h>
 
 int main()
 {
    
    
   printf("hello debug!\n");
   printf("hello debug!\n");
   printf("hello debug!\n");
  printf("hello debug!\n");
   printf("hello debug!\n");                                                            
 
   return o;
 }

  1. make一下
    在这里插入图片描述
    6.gdb生成的程序在这里插入图片描述
    7.b 8 :在第八行打断点 r:运行
    在这里插入图片描述
    8.可以发现进程是t状态,即就是暂停状态
    在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_47952981/article/details/129602156
今日推荐