惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
Recent Announcements
Recent Announcements
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The GitHub Blog
The GitHub Blog
MyScale Blog
MyScale Blog
爱范儿
爱范儿
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
美团技术团队
Y
Y Combinator Blog
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
Martin Fowler
Martin Fowler
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
M
MIT News - Artificial intelligence
博客园 - Franky
V
Visual Studio Blog
I
InfoQ
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
博客园 - 司徒正美
L
LangChain Blog

博客园 - MikeLi

ssh Linux install idea ubuntu耳机问题 一个好的计算机学习网站 正则表达式 gitee 设置 javac编译命令 git Ubuntu安装chrome浏览器 Linux安装配置JDK jdk 8 文档和API列表 「转」Java开发的构建工具 netbeans11从源码构建安装教程 Maven国内镜像 Java IDE:NetBeans 如何输入EOF ubuntu截图与录屏 如何在Linux里寻找、安装和卸载软件包How to install and update software in Linux memory
debug in C,Java,Python
MikeLi · 2025-08-31 · via 博客园 - MikeLi
languge: C Java Python
compiler: gcc -g hello_world.c javac -g HelloWorld.java

method 1:

import pdb

pdb.set_trace()

python hello_world.py

method 2:

python -m pdb hello_world.py

execute program: gdb ./a.out jdb Helloworld same with compiler
set breakpoint:

break 18(line number

you want to set break)

break at print()

break in 18 

break
start execution: run run  no start exection command
continue execution: continue continue continue
step execution: step step step
print variable: print your_variable_name print/dump your_variable_name p your_variable_name
show local variable: info locals locals

locals() (priority use, it will not print extra info)

globals()

dir()

eval()

nextline: next next next
show code: list list list
end execution: quit quit quit

posted @ 2025-08-31 10:39  MikeLi  阅读(20)  评论()    收藏  举报