Home  >  Article  >  Operation and Maintenance  >  How to use gdb to view stack information of hung programs during operation and maintenance

How to use gdb to view stack information of hung programs during operation and maintenance

坏嘻嘻
坏嘻嘻Original
2018-09-15 16:22:243621browse

The content of this article is about how to use gdb to view the stack information of the hung program during the operation and maintenance process. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you. .​

Use gdb to view the stack information of the hung program


  1. View the stuck process

ps -ef|grep CobotStudio

How to use gdb to view stack information of hung programs during operation and maintenance2. Use gdb to open the process

sudo gdb ./CobotStudio

How to use gdb to view stack information of hung programs during operation and maintenance3. Use attach to attach

attach 22108(这里22108为进程子PID)

How to use gdb to view stack information of hung programs during operation and maintenance4. Use bt to view stack information

bt(直接使用bt查看堆栈信息)

How to use gdb to view stack information of hung programs during operation and maintenance


Enter gdb and use common commands in gdb

  • ##c: Continue

  • p_: Print

  • list: List

  • attach: Attach

  • b code snippet: Set breakpoint

  • i b: View the set breakpoint

  • bt: View program crash stack information

  • -up: Previous method (Press Enter to view the next page)

  • down: Next method (Press Enter to view the next page




The above is the detailed content of How to use gdb to view stack information of hung programs during operation and maintenance. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn