当前位置:网站首页>GDB debugging
GDB debugging
2022-06-24 21:07:00 【AcTarjan】
technological process
# load go Runtime support files runtime-gdb.py
# The file in go Installation directory src/runtime/ Next
### Method 1( Each use gdb Automatic loading ) modify ~/.gdbinit file , Add a row :
add-auto-load-safe-path /opt/go/src/runtime/runtime-gdb.py
### Method 2( Every time I enter gdb Must be loaded once ) stay gdb The interface executes the following commands :
(gdb) source /opt/go/src/runtime/runtime-gdb.py
# compiler
go build -gcflags "-N -l" -o mymain main.go
# Get into gdb Debugging interface
gdb mymain
gdb Debug command
| command | function | Example |
|---|---|---|
| help [ command ] | Help document | help info |
| start | Start debugging , Will stop at the program entrance , namely func main() | |
| r | Run the program , Will stop at breakpoint or end of program | |
| l [ Line number / Function name ] | View the source code | l 10 |
| set args | Set runtime parameters | set args 10 |
| show args | Look at the runtime parameters | |
| b [ file name : Line number / Function name ] | To set breakpoints | b 10 |
| d [ Breakpoint number ] | Delete breakpoints | d 1 |
| s | Execute a line of code ( Enter function ) | |
| n | Execute a line of code ( Don't go into functions ) | |
| c | Continue operation , Stop at the next breakpoint or the end of the program | |
| finish | Finished running the current function | |
| p [ Variable name ] | Print variable values | p i |
| display [ Variable name ] | Tracking variables | display i |
| undisplay [ Variable number ] | Untracking variables | undisplay 1 |
| info breakpoints | View breakpoint information | |
| info goroutines | see go Process information | |
| info locals | View local variables |
边栏推荐
- List set Introduction & common methods
- 等保备案是等保测评吗?两者是什么关系?
- Common self realization functions in C language development
- 2021-09-30
- Batch capitalization of MySQL table names
- [performance tuning basics] performance tuning strategy
- IDEA Dashboard
- OSI notes sorting
- 得物多活架构设计之路由服务设计
- Analysis of errors in JSON conversion using objectmapper
猜你喜欢

Interpreter mode -- formulas for dating

It was Tencent who jumped out of the job with 26k. It really wiped my ass with sandpaper. It gave me a hand

DHCP operation

云计算发展的 4 个阶段,终于有人讲明白了

JMeter basic learning records

Record a deletion bash_ Profile file
![Use the transparent [x] cross button image in the dialog](/img/0c/2be7bc7f20b581a2cc745d9cabe9ff.jpg)
Use the transparent [x] cross button image in the dialog

Learn to use a new technology quickly

Camera rental management system based on qt+mysql

Basic operation of sequence table
随机推荐
Sequence stack version 1.0
Common data model (updating)
Record a deletion bash_ Profile file
Shell script
Where is 5g really powerful? What is the difference with 4G?
go_ keyword
Sequential stack traversal binary tree
What does virtualization mean? What technologies are included? What is the difference with private cloud?
在Dialog中使用透明的【X】叉叉按钮图片
Intermediary model -- collaboration among departments
Berkeley, MIT, Cambridge, deepmind and other industry leaders' online lectures: towards safe, reliable and controllable AI
Grating diffraction
Popupwindow touch event transparent transmission scheme
Can the OPDS SQL component pass process parameters to the next component through context
Simulation lottery and probability statistics experiment of the top 16 Champions League
More than ten years' work experience is recommended at the bottom of the box: how much does it cost to find a job? See here! Brothers and sisters are recommended to collect and pay attention
2021-09-30
Berkeley, MIT, Cambridge, deepmind et d'autres grandes conférences en ligne: vers une IA sûre, fiable et contrôlable
Bridging mode -- law firm
Pytest test framework II