VSCode远程图形化GDB

news2025/5/13 23:28:21

VSCode远程图形化GDB

  • 摘要
  • 一、安装VSCode
    • 1、使用.exe安装包安装VSCode
    • 2、VSCode 插件安装
    • 3、VSCode建立远程连接
  • 二、core dump找bug
    • 1、开启core文件
    • 2、永久生效的方法
    • 3、编写测试程序
    • 4、运行结果
    • 5、查看core段错误位置
    • 6、在程序中开启core dump并二者core文件大小
  • 三、gdbserver
    • 1、[GDB移植](https://blog.csdn.net/weixin_38426553/article/details/126633280)
    • 2、VSCode远程连接
    • 3、代码编译
  • 4、代码调试
    • 4.1、修改launch.json文件
    • 4.2、gdbserver启动
  • 四、客户端命令行gdbserver调试
    • 1、在arm开发板启动gdbserver
    • 2、在客户端输入命令
    • 3、开启远程连接
    • 4、打断点
    • 5、c继续运行,在断点处停止
    • 6、打印参数
    • 7、其他功能
  • 总结

摘要

本文详细介绍了如何在 Visual Studio Code (VSCode) 中实现远程图形化调试,使用 GDB 和 gdbserver 工具进行嵌入式开发中的程序调试。文章分为四个部分:首先介绍了 VSCode 的安装和插件配置;其次讲解了如何通过 core dump 文件定位程序中的错误;接着介绍了如何在嵌入式设备上使用 gdbserver 进行远程调试;最后通过客户端命令行展示了 gdbserver 的调试功能。通过本文,读者可以掌握在 VSCode 中进行远程调试的完整流程,包括环境搭建、调试配置和常见问题解决。

一、安装VSCode

1、使用.exe安装包安装VSCode

2、VSCode 插件安装

添加Remote SSH、Remote Development等插件

1)、C/C++,这个肯定是必须的。
2)、C/C++ Snippets,即 C/C++重用代码块。
3)、C/C++ Advanced Lint,即 C/C++静态检测 。
4)、Code Runner,即代码运行。
5)、Include AutoComplete,即自动头文件包含。
6)、Rainbow Brackets,彩虹花括号,有助于阅读代码。
7)、One Dark Pro,VSCode 的主题。
8)、GBKtoUTF8,将 GBK 转换为 UTF8。
9)、ARM,即支持 ARM 汇编语法高亮显示。Arm Assembly
10)、Chinese(Simplified),即中文环境。
11)、vscode-icons,VSCode 图标插件,主要是资源管理器下各个文件夹的图标。
12)、compareit,比较插件,可以用于比较两个文件的差异。
13)、DeviceTree,设备树语法插件。
14)、TabNine,一款 AI 自动补全插件,强烈推荐,谁用谁知道!
15)、Remote SSH
16)、Remote Development

(ARM替代,Arm Assembly更全)
设置语言环境:中文环境,安装Chinese(Simplified)插件后会提示更换并重启VSCode,或者去setting去设置locale.jsons设置"zh_cn"并重启VSCode。

{
	// 定义 VS Code 的显示语言。
	// 请参阅 https://go.microsoft.com/fwlink/?LinkId=761051,了解支持的语言列表。
	
	"locale":"zh-cn" // 更改将在重新启动 VS Code 之后生效。
}

3、VSCode建立远程连接

使用本地vscode的remote ssh 远程链接服务器

二、core dump找bug

1、开启core文件

root@ATK-IMX6U:/opt# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 2931
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 2931
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

第一行core文件大小为0,没有开启。
使用#ulimit -c [kbytes]可以设置系统允许生成的core文件大小;

ulimit -c 0 不产生core文件
ulimit -c 100 设置core文件最大为100k
ulimit -c unlimited 不限制core文件大小
root@ATK-IMX6U:/opt# ulimit -c unlimited
root@ATK-IMX6U:/opt# ulimit -a
core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 2931
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 2931
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

2、永久生效的方法

这样进程奔溃就可以生成core文件了,这种方法只能在shell中生效,下面说一下永久生效的方法
vi /etc/profile 进入编辑模式在文件最后加入:ulimit -c unlimited

root@ATK-IMX6U:/opt# vi /etc/profile
root@ATK-IMX6U:/opt# sync

3、编写测试程序

 #include <stdio.h>
 #include <unistd.h>

 int main(int argc, char *argv[])
 {
    unsigned int timerCnt = 0;
    while(1) 
    {
        printf("system runing times:%d\r\n", timerCnt);
        timerCnt++;

        int *p = NULL;
        int num = *p;
        sleep(1);
    }
}

4、运行结果

root@ATK-IMX6U:/opt# ./gdbApp
system runing times:0
Segmentation fault (core dumped)
root@ATK-IMX6U:/opt# ls
core  download.sh  gdbApp  GW_EVSE  IBG_AWS_Conn  logs  QDesktop  sqlite  src  volume.tmp
root@ATK-IMX6U:/opt# ls -l core
-rw------- 1 root root 344K Jul 21 23:14 core
root@ATK-IMX6U:/opt#

产生的core文件即为异常中止调试文件。

5、查看core段错误位置

将core文件拷贝到Ubuntu平台上,和可自行文件放在同一个文件夹下,然后运行下面的命令:

/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb gdbApp core

运行结果:

leo@leo-virtual-machine:/mnt/hgfs/VMShare/TESTVSCODE$ /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb gdbApp core 
GNU gdb (GDB) 7.10.1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-pokysdk-linux --target=arm-poky-linux-gnueabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
---Type <return> to continue, or q <return> to quit---y
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gdbApp...done.
[New LWP 1577]

warning: Could not load shared library symbols for 3 libraries, e.g. linux-vdso.so.1.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `./gdbApp'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00010494 in main (argc=1, argv=0x7edf5cd4) at gdbApp.c:14
14              int num = *p;
(gdb) 

运行结果来看,错误产生在14行,将空指针*p赋值给了num。

6、在程序中开启core dump并二者core文件大小

#define CORE_DUMP_SIZE	1024*1024*500 //500M
#define CORE_DUMP_DEBUG 1

#if CORE_DUMP_DEBUG
	/*设置core文件存储上限,系统默认为0.用于段错误时堆栈信息记录的操作,可以产生一个core文件*/
	struct rlimit rlmt;
	if (getrlimit(RLIMIT_CORE, &rlmt) == -1) 
    {
		return -1; 
	}   
	rlmt.rlim_cur	= (rlim_t)CORE_DUMP_SIZE;
	rlmt.rlim_max	= (rlim_t)CORE_DUMP_SIZE;
	if (setrlimit(RLIMIT_CORE, &rlmt) == -1)
    {
        return -1; 
    }
#endif	

三、gdbserver

1、GDB移植

将Ubuntu上的交叉编译器里面的gdbserver拷贝到开发板文件系统指定目录/bin/

leo@leo-virtual-machine:~$ whereis gdbserver
gdbserver: /usr/bin/gdbserver /usr/local/arm_gcc/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/gdbserver /usr/share/man/man1/gdbserver.1.gz
leo@leo-virtual-machine:~$ 

在这里插入图片描述

2、VSCode远程连接

在这里插入图片描述
在这里插入图片描述

具体步骤可以百度:
设置.ssh config
在这里插入图片描述

设置config文件

Host 192.168.3.116
  HostName 192.168.3.116

Host 192.168.3.143
  HostName 192.168.3.143
  Port 22
  User root
  
Host 192.168.3.116
  HostName 192.168.3.116
  Port 22
  User leo

在这里插入图片描述

server设置:
在这里插入图片描述

输入密码连接
在这里插入图片描述

3、代码编译

编译代码:修改Makefile,在gcc 后面加上 -ggdb选项

# -------------[ CFLAGS ] -------------
CFLAGS += -g
CFLAGS += -ggdb
CFLAGS += -Wall
CFLAGS += -I.
CFLAGS += -I $(TOPDIR)/api
CFLAGS += -I $(TOPDIR)/daemon
......

然后和以前一样编译代码,这样代码编译出来的可执行文件会更大一些,保留了调试信息在可执行文件中。

4、代码调试

4.1、修改launch.json文件

点击运行->启动调试(或者按F5)。新的代码未创建launch.json文件,选择C++(GDB/LLDB),选择默认配置会自动生成一个launch.json文件。
在这里插入图片描述
在这里插入图片描述

或者
或者点击调试,选择创建爱你launch.json文件。,选择C++(GDB/LLDB)生成一个launch.json文件。
在这里插入图片描述

修改launch.json文件

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "cppdbg",
            "request": "launch",
            "name": "(gdb)调试",
            "program": "${workspaceFolder}/GW_EVSE",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath":
            "/opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb",
            //"/usr/local/arm_gcc/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gdb",
            "miDebuggerServerAddress": "192.168.3.143:2001",
            "setupCommands": [
                {
                    "description": "为 gdb 启用整齐打印",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

注意交叉编译器和可执行文件名称需要修改。上面交叉编译器有两个,需要和编译代码的交叉编译器对应上,否则程序不可执行,会段错误。

4.2、gdbserver启动

将程序可执行文件下载到arm linux开发板后,执行

root@ATK-IMX6U:/opt# gdbserver 192.168.3.143:2001 GW_EVSE
Process gdbApp created; pid = 1629
Listening on port 2001

或者本机地址可以省略

root@ATK-IMX6U:/opt# gdbserver 3:2001 GW_EVSE
Process gdbApp created; pid = 1629
Listening on port 2001

然后在PC端VSCode启动调试,就可以打断点进行调试了
在这里插入图片描述

四、客户端命令行gdbserver调试

1、在arm开发板启动gdbserver

root@ATK-IMX6U:/opt# gdbserver 192.168.3.143:2001 GW_EVSE
Process gdbApp created; pid = 1629
Listening on port 2001

2、在客户端输入命令

leo@leo-virtual-machine:/mnt/hgfs/VMShare/VSCodeWorkSpace/GW_EVSE$ /opt/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb GW_EVSE
GNU gdb (GDB) 7.10.1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-pokysdk-linux --target=arm-poky-linux-gnueabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from GW_EVSE...done.
(gdb)

3、开启远程连接

(gdb) target remote 192.168.3.143:2001
Remote debugging using 192.168.3.143:2001
Reading /lib/ld-linux-armhf.so.3 from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
Reading /lib/ld-linux-armhf.so.3 from remote target...
Reading symbols from target:/lib/ld-linux-armhf.so.3...Reading /lib/ld-2.23.so from remote target...
Reading /lib/.debug/ld-2.23.so from remote target...
(no debugging symbols found)...done.
0x76fcfac0 in ?? () from target:/lib/ld-linux-armhf.so.3
(gdb)

4、打断点

(gdb) b 140
Breakpoint 1 at 0x1efac: file main/main_pro.c, line 140.
(gdb)

5、c继续运行,在断点处停止

(gdb) c
Continuing.
Reading /lib/librt.so.1 from remote target...
Reading /lib/libpthread.so.0 from remote target...
Reading /lib/libm.so.6 from remote target...
Reading /lib/libdl.so.2 from remote target...
Reading /lib/libc.so.6 from remote target...
Reading /lib/librt-2.23.so from remote target...
Reading /lib/.debug/librt-2.23.so from remote target...
Reading /lib/libpthread-2.23.so from remote target...
Reading /lib/.debug/libpthread-2.23.so from remote target...
Reading /lib/libm-2.23.so from remote target...
Reading /lib/.debug/libm-2.23.so from remote target...
Reading /lib/libdl-2.23.so from remote target...
Reading /lib/.debug/libdl-2.23.so from remote target...
Reading /lib/libc-2.23.so from remote target...
Reading /lib/.debug/libc-2.23.so from remote target...
[New Thread 1725]
[New Thread 1726]
[New Thread 1727]
[New Thread 1728]
[New Thread 1729]
[New Thread 1731]
[New Thread 1732]
[New Thread 1733]
[New Thread 1734]
[New Thread 1736]
[New Thread 1738]
[New Thread 1739]
[New Thread 1740]

Breakpoint 1, main () at main/main_pro.c:140
warning: Source file is more recent than executable.
140                     if(cnt > 30)
(gdb)

6、打印参数

(gdb) r
The "remote" target does not support "run".  Try "help target" or "continue".
(gdb) c
Continuing.

Breakpoint 1, main () at main/main_pro.c:140
140                     if(cnt > 30)
(gdb) c
Continuing.

Breakpoint 1, main () at main/main_pro.c:140
140                     if(cnt > 30)
(gdb) print cnt
$1 = 3
(gdb)

从上面看出,远程模式下,不支持全速运行 r 命令。

7、其他功能

这里不再赘述,可以查看操作手册。

总结

本文为嵌入式开发人员提供了一套完整的 VSCode 远程调试解决方案。通过安装必要的插件和配置远程连接,开发者可以在 VSCode 中方便地进行代码编写和调试。core dump 功能可以帮助快速定位程序崩溃的原因,而 gdbserver 则实现了远程设备与本地调试环境的无缝连接。通过修改 launch.json 文件和正确配置交叉编译器路径,开发者可以在 VSCode 中轻松启动和管理远程调试会话。此外,文章还介绍了如何通过命令行使用 gdbserver 进行调试,进一步扩展了调试功能的灵活性。总之,本文为希望在 VSCode 中实现高效远程调试的开发者提供了实用的指导和参考。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2340223.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

软件工程师中级考试-上午知识点总结(上)

我总结的这些都是每年的考点&#xff0c;必须要记下来的。 1. 计算机系统基础 1.1 码 符号位0表示正数&#xff0c;符号位1表示负数。补码&#xff1a;简化运算部件的设计&#xff0c;最适合进行数字加减运算。移码&#xff1a;与前几种不同&#xff0c;1表示&#xff0c;0表…

基于FreeRTOS和STM32的微波炉

一、项目简介 使用STM32F103C8T6、舵机、继电器、加热片、蜂鸣器、两个按键、LCD及DHT11传感器等硬件。进一步&#xff0c;结合FreeRTOS和状态机等软件实现了一个微波炉系统&#xff1b;实现的功能包含&#xff1a;人机交互、时间及功率设置、异常情况处理及固件升级等。 二、…

国防科大清华城市空间无人机导航推理!GeoNav:赋予多模态大模型地理空间推理能力,实现语言指令导向的空中目标导航

作者&#xff1a; Haotian Xu 1 ^{1} 1, Yue Hu 1 ^{1} 1, Chen Gao 2 ^{2} 2, Zhengqiu Zhu 1 ^{1} 1, Yong Zhao 1 ^{1} 1, Yong Li 2 ^{2} 2, Quanjun Yin 1 ^{1} 1单位&#xff1a; 1 ^{1} 1国防科技大学系统工程学院&#xff0c; 2 ^{2} 2清华大学论文标题&#xff1a;Geo…

uniapp打ios包

uniapp在windows电脑下申请证书并打包上架 前言 该开发笔记记录了在window系统下&#xff0c;在苹果开发者网站生成不同证书&#xff0c;进行uniapp打包调试和上线发布&#xff0c;对window用户友好 注&#xff1a;苹果打包涉及到两种证书&#xff1a;开发证书 和 分发证书 …

快速搭建 Cpolar 内网穿透(Mac 系统)

1、Cpolar快速入门教程&#xff08;官方&#xff09; 链接地址&#xff1a;Cpolar 快速入门 2、官方教程详解 本地安装homebrew /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"这个是从 git 上拉取的&#x…

动态监控进程

1.介绍: top和ps命令很相似,它们都是用来显示正在执行的进程,top和ps最大的不同之处,在于top在执行中可以更新正在执行的进程. 2.基本语法&#xff1a; top [选项] 选项说明 ⭐️僵死进程&#xff1a;内存没有释放,但是进程已经停止工作了,需要及时清理 交互操作说明 应用案…

HADOOP 3.4.1安装和搭建(尚硅谷版~)

目录 1.配置模版虚拟机 2.克隆虚拟机 3.在hadoop102安装JDK 4.完全分布式运行模式 1.配置模版虚拟机 1.安装模板虚拟机&#xff0c;IP地址192.168.10.100、主机名称hadoop100、内存2G、硬盘20G&#xff08;有需求的可以配置4G内存&#xff0c;50G硬盘&#xff09; 2.hado…

第 4 篇:平稳性 - 时间序列分析的基石

第 4 篇&#xff1a;平稳性 - 时间序列分析的基石 在上一篇中&#xff0c;我们学习了如何将时间序列分解为趋势、季节性和残差。我们看到&#xff0c;很多真实世界的时间序列&#xff08;比如 CO2 浓度&#xff09;都包含明显的趋势&#xff08;长期向上或向下&#xff09;和/…

DeepSeek赋能Nuclei:打造网络安全检测的“超级助手”

引言 各位少侠&#xff0c;周末快乐&#xff0c;幸会幸会&#xff01; 今天唠一个超酷的技术组合——用AI大模型给Nuclei开挂&#xff0c;提升漏洞检测能力&#xff01; 想象一下&#xff0c;当出现新漏洞时&#xff0c;少侠们经常需要根据Nuclei模板&#xff0c;手动扒漏洞文章…

从0到1彻底掌握Trae:手把手带你实战开发AI Chatbot,提升开发效率的必备指南!

我正在参加Trae「超级体验官」创意实践征文&#xff0c; 本文所使用的 Trae 免费下载链接&#xff1a; www.trae.ai/?utm_source… 前言 大家好&#xff0c;我是小Q&#xff0c;字节跳动近期推出了一款 AI IDE—— Trae&#xff0c;由国人团队开发&#xff0c;并且限时免费体…

opencv图片颜色识别,颜色的替换

图片颜色识别 1. RGB颜色空间2. 颜色加法2.1使用numpy对图像进行加法2.2使用opencv加法&#xff08;cv2.add&#xff09; 3 颜色加权加法&#xff08;cv2.addWeighted()&#xff09;4. HSV颜色空间5. 制作掩膜4. 与运算&#xff08;cv2.bitwise_and&#xff09;5.颜色的替换7 R…

B实验-12

需要注意版本、页面源代码 两个文件一个目录&#xff1a;phpinfo robots phpmyadmin 实验12 靶机1 一个key在phpmyadmin&#xff0c;一个key在回收站 用两个扫描目录的工具扫&#xff0c;nmap给python版 情况1&#xff1a;弱口令 root root root 123456 …

【网工第6版】第5章 网络互联②

目录 ■ IPV6 ▲ IPV6报文格式 ◎ IPV6扩展报头&#xff08;RFC2460&#xff09; ◎ IPv6相关协议 ▲ IPV6地址分类 ◎ IPv6地址基础 ◎ IPv6地址举例 ◎ IPv6地址分类 ◎ 特殊地址对比IPv4 vs IPv6 ▲ 过渡技术 本章重要程度&#xff1a;☆☆☆☆☆ ■ IPV6 与IPv4…

单页面应用的特点,什么是路由,VueRouter的下载,安装和使用,路由的封装抽离,声明式导航的介绍和使用

文章目录 一.什么是单页面应用?二.什么是路由?生活中的路由和Vue中的路由 三.VueRouter(重点)0.引出1.介绍2.下载与使用(5个基本步骤2个核心步骤)2.1 五个基本步骤2.2 两个核心步骤 四.路由的封装抽离五.声明式导航1.导航链接特点一:能跳转特点二:能高亮 2.两个高亮类名2.1.区…

STM32---外部中断EXTI

目录 一、中断向量表 二、EXTI工作原理图 三、NVIC模块 四、GPIO设置为EXTI的结构 五、C语言示例代码 在STM32中&#xff0c;中断是一个非常重要的结构&#xff0c;他能让我们在执行主函数的时候&#xff0c;由硬件检测一些外部或内部产生的中断信号&#xff0c;跳转到中断…

Itext进行PDF的编辑开发

这周写了一周的需求&#xff0c;是制作一个PDF生成功能&#xff0c;其中用到了Itext来制作PDF的视觉效果。其中一些功能不是很懂&#xff0c;仅作记录&#xff0c;若要学习请仔细甄别正确与否。 开始之前&#xff0c;我还是想说&#xff0c;这傻福需求怎么想出来的&#xff0c…

Hibernate的组件映射

在实际的开发中,使用的是非常多的&#xff0c;还有几种比较特殊的关系映射: 组件映射继承映射 先看一下组件映射: 组件映射中, 组件也是一个类, 但是这个类它不独立称为一个实体, 也就是说, 数据库中没有一个表格单独的和它对应, 具体情况呢, 看演示&#xff1a;

C++ 操作符重载Operator

C可以重载大多数操作符&#xff0c;如算术运算符号&#xff0c;-号。 位操作符<<,>> 下标符号[]等都可以重载。 重载的意思&#xff0c;是让这些符号&#xff0c;按你定义的行为来执行代码&#xff0c;但是这种自定义&#xff0c;是有限制的&#xff0c;必须有一…

Docker 镜像、容器和 Docker Compose的区别

前言&#xff1a;Docker 的镜像、容器和 Docker Compose 是容器化技术的核心组件&#xff0c;以下是对它们的详细解析及使用场景说明。 ​​1、Docker 镜像&#xff08;Image&#xff09;​​ ​​定义​​&#xff1a; 镜像是只读模板&#xff0c;包含运行应用程序所需的代码、…

Linux深度探索:进程管理与系统架构

1.冯诺依曼体系结构 我们常见的计算机&#xff0c;如笔记本。我们不常见的计算机&#xff0c;如服务器&#xff0c;大部分都遵守冯诺依曼体系。 截至目前&#xff0c;我们所认识的计算机&#xff0c;都是由⼀个个的硬件组件组成。 输入设备&#xff1a;键盘&#xff0c;鼠标…