当前位置: 首页 > news >正文

远程调试MySQL内核

1 vscode 需要安装remote-ssh插件

在这里插入图片描述
安装成功后,登录:
在这里插入图片描述
默认远程服务器的登录

ssh root@ip

注意,Linux需要设置root远程登录;

2 安装debug扩展

C\C++ extemsion Pack
C\C++

在这里插入图片描述

3 设置Attach进程

{// Use IntelliSense to learn about possible attributes.// Hover to view descriptions of existing attributes.// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387"version": "0.2.0","configurations": [{"name": "(gdb) Pipe Attach","type": "cppdbg","request": "attach","program": "enter program name, for example ${workspaceFolder}/a.out","processId": "${command:pickRemoteProcess}","pipeTransport": {"debuggerPath": "/usr/bin/gdb","pipeProgram": "/usr/bin/ssh","pipeArgs": [],"pipeCwd": ""},"MIMode": "gdb","setupCommands": [{"description": "Enable pretty-printing for gdb","text": "-enable-pretty-printing","ignoreFailures": true},{"description": "Set Disassembly Flavor to Intel","text": "-gdb-set disassembly-flavor intel","ignoreFailures": true}]}]
}

这里

 "processId": "${command:pickRemoteProcess}",

填写mysql的进程ID;

# lsof -i:3306
COMMAND    PID  USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
mysqld  199182 mysql   17u  IPv6 1323770      0t0  TCP *:mysql (LISTEN)
#

样例

{// Use IntelliSense to learn about possible attributes.// Hover to view descriptions of existing attributes.// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387"version": "0.2.0","configurations": [{"name": "(gdb) Pipe Attach","type": "cppdbg","request": "attach","program": "enter program name, for example ${workspaceFolder}/a.out","processId": "199182","pipeTransport": {"debuggerPath": "/usr/bin/gdb","pipeProgram": "/usr/bin/ssh","pipeArgs": [],"pipeCwd": ""},"MIMode": "gdb","setupCommands": [{"description": "Enable pretty-printing for gdb","text": "-enable-pretty-printing","ignoreFailures": true},{"description": "Set Disassembly Flavor to Intel","text": "-gdb-set disassembly-flavor intel","ignoreFailures": true}]}]
}

4 断点

sql_parse.cc文件
函数:

int mysql_execute_command(THD *thd, bool first_level = false);

(备注,mysql必须是debug版本)

在这里插入图片描述

http://www.lryc.cn/news/111641.html

相关文章:

  • 前端学习---vue2--选项/数据--data-computed-watch-methods-props
  • UML-构件图
  • uniapp使用视频地址获取视频封面
  • java操作PDF:转换、合成、切分
  • 递增子序列——力扣491
  • 解密!品牌独立站为何能成为外国消费者的心头爱?
  • 【HDFS】每天一个RPC系列----complete(二):客户端侧
  • 五、PC远程控制ESP32 LED灯
  • 详解PHP反射API
  • 打开虚拟机进行ip addr无网络连接
  • Spring Boot如何整合mybatisplus
  • webpack基础知识一:说说你对webpack的理解?解决了什么问题?
  • 小研究 - 基于 MySQL 数据库的数据安全应用设计(二)
  • 大数据-数据内容分类
  • Babel编译与Webpack
  • 0805hw
  • ROS实现机器人移动
  • Dockerfile构建LNMP镜像
  • 总结七大排序!
  • 没有fastjson,rust怎么方便的解析提取复杂json呢?
  • Docker制作SpringBoot镜像
  • 力扣:53. 最大子数组和(Python3)
  • 利用appium抓取app中的信息
  • 数据结构:双向链表的实现(C实现)
  • linuxARM裸机学习笔记(4)----GPIO中断以及定时器中断实验
  • 第十二次CCF计算机软件能力认证
  • ceph pg inconsistent修复(unexpected clone)
  • 供求重构是产业互联网的核心 个体崛起是产业互联网的终点
  • torchvision.datasets数据加载失败
  • 【UEC++学习】UE网络 - Replication、RPC