Skip to content

Commit 0daa7ca

Browse files
committed
add gdb
1 parent d8b5961 commit 0daa7ca

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

‎environment/tools/gdb/gdb.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# gdb
2+
3+
可执行文件调试
4+
5+
## core 文件调试
6+
7+
```sh
8+
# 导入调试文件
9+
gdb BinaryFile coreFile
10+
# backtrace 显示堆栈信息
11+
(gdb) bt
12+
# 显示堆栈信息
13+
(gdb) where
14+
# 显示多线程信息
15+
info threads
16+
# 选择线程
17+
thread num
18+
# 打印出当前函数的参数名及其形参值
19+
info args
20+
# 打印出当前函数中所有局部变量及其值
21+
info locals
22+
# 打印出当前函数中的异常处理信息
23+
info catch
24+
# 栈中某一层信息
25+
frame num
26+
```
27+
28+
设置第三方库
29+
30+
```sh
31+
gdb BinaryFile
32+
# 设置搜索路径, 或者设置环境变量 $LD_LIBRARY_PATH
33+
directory absolutePath
34+
# 加载core文件
35+
core-file coreFile
36+
```

‎environment/tools/vscode/remote.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ vscode 远程调试, 使用个人电脑,win10系统,访问远程服务器
6161
Set-Service -Name sshd -StartupType 'Automatic'
6262
# 查询 ssh 相关防���墙
6363
Get-NetFirewallRule -Name *ssh*
64+
65+
# 查看状态
66+
Get-Service sshd
67+
# 关闭服务:
68+
Stop-Service sshd
69+
# 重启服务:
70+
Restart-Service sshd
6471
```
6572

6673
启动后,连接方式与 linux 相同, `ssh user@remote-ip`

0 commit comments

Comments
 (0)