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

gdb调试std::list和std::vector等容器的方法

GDB中print方法并不能直接打印STL容器中保存的变量,其实只要http://www.yolinux.com/TUTORIALS/src/dbinit_stl_views-1.03.txt这个文件保存为~/.gdbinit 就可以使用它提供的方法方便调试容器

指定启动文件:~/.gdbinit,下面的方法任选其一。
1、调用GDB时,指定启动文件。

# gdb -command=~/.gdbinit a.out 

2、运行GDB后,指定启动文件。
2.1、“source /.gdbinit”,临时导入/.gdbinit文件。
2.2、添加“add-auto-load-safe-path /.gdbinit”到/.gdbinit文件中,使该文件可以被加载;
2.3、添加“set auto-load safe-path ./”到./.gdbinit文件中,相当于禁用了安全路径的保护;

http://www.yolinux.com/TUTORIALS/src/dbinit_stl_views-1.03.txt内容如下:

cat ~/.gdbinit
#                                                                                                        
#   STL GDB evaluators/views/utilities - 1.03
#
#   The new GDB commands:                                                         
# 	    are entirely non instrumental                                             
# 	    do not depend on any "inline"(s) - e.g. size(), [], etc
#       are extremely tolerant to debugger settings
#                                                                                 
#   This file should be "included" in .gdbinit as following:
#   source stl-views.gdb or just paste it into your .gdbinit file
#
#   The following STL containers are currently supported:
#
#       std::vector<T> -- via pvector command
#       std::list<T> -- via plist or plist_member command
#       std::map<T,T> -- via pmap or pmap_member command
#       std::multimap<T,T> -- via pmap or pmap_member command
#       std::set<T> -- via pset command
#       std::multiset<T> -- via pset command
#       std::deque<T> -- via pdequeue command
#       std::stack<T> -- via pstack command
#       std::queue<T> -- via pqueue command
#       std::priority_queue<T> -- via ppqueue command
#       std::bitset<n> -- via pbitset command
#       std::string -- via pstring command
#       std::widestring -- via pwstring command
#
#   The end of this file contains (optional) C++ beautifiers
#   Make sure your debugger supports $argc
#
#   Simple GDB Macros writen by Dan Marinescu (H-PhD) - License GPL
#   Inspired by intial work of Tom Malnar, 
#     Tony Novac (PhD) / Cornell / Stanford,
#     Gilad Mishne (PhD) and Many Many Others.
#   Contact: dan_c_marinescu@yahoo.com (Subject: STL)
#
#   Modified to work with g++ 4.3 by Anders Elton
#   Also added _member functions, that instead of printing the entire class in map, prints a member.#
# std::vector<>
#define pvectorif $argc == 0help pvectorelseset $size = $arg0._M_impl._M_finish - $arg0._M_impl._M_startset $capacity = $arg0._M_impl._M_end_of_storage - $arg0._M_impl._M_startset $size_max = $size - 1endif $argc == 1set $i = 0while $i < $sizeprintf "elem[%u]: ", $ip *($arg0._M_impl._M_start + $i)set $i++endendif $argc == 2set $idx = $arg1if $idx < 0 || $idx > $size_maxprintf "idx1, idx2 are not in acceptable range: [0..%u].\n", $size_maxelseprintf "elem[%u]: ", $idxp *($arg0._M_impl._M_start + $idx)endendif $argc == 3set $start_idx = $arg1set $stop_idx = $arg2if $start_idx > $stop_idxset $tmp_idx = $start_idxset $start_idx = $stop_idxset $stop_idx = $tmp_idxendif $start_idx < 0 || $stop_idx < 0 || $start_idx > $size_max || $stop_idx > $size_maxprintf "idx1, idx2 are not in acceptable range: [0..%u].\n", $size_maxelseset $i = $start_idxwhile $i <= $stop_idxprintf "elem[%u]: ", $ip *($arg0._M_impl._M_start + $i)set $i++endendendif $argc > 0printf "Vector size = %u\n", $sizeprintf "Vector capacity = %u\n", $capacityprintf "Element "whatis $arg0._M_impl._M_startend
enddocument pvectorPrints std::vector<T> information.Syntax: pvector <vector> <idx1> <idx2>Note: idx, idx1 and idx2 must be in acceptable range [0..<vector>.size()-1].Examples:pvector v - Prints vector content, size, capacity and T typedefpvector v 0 - Prints element[idx] from vectorpvector v 1 2 - Prints elements in range [idx1..idx2] from vector
end #
# std::list<>
#define plistif $argc == 0help plistelseset $head = &$arg0._M_impl._M_nodeset $current = $arg0._M_impl._M_node._M_nextset $size = 0while $current != $headif $argc == 2printf "elem[%u]: ", $sizep *($arg1*)($current + 1)endif $argc == 3if $size == $arg2printf "elem[%u]: ", $sizep *($arg1*)($current + 1)endendset $current = $current._M_nextset $size++endprintf "List size = %u \n", $sizeif $argc == 1printf "List "whatis $arg0printf "Use plist <variable_name> <element_type> to see the elements in the list.\n"endend
enddocument plistPrints std::list<T> information.Syntax: plist <list> <T> <idx>: Prints list size, if T defined all elements or just element at idxExamples:plist l - prints list size and definitionplist l int - prints all elements and list sizeplist l int 2 - prints the third element in the list (if exists) and list size
enddefine plist_memberif $argc == 0help plist_memberelseset $head = &$arg0._M_impl._M_nodeset $current = $arg0._M_impl._M_node._M_nextset $size = 0while $current != $headif $argc == 3printf "elem[%u]: ", $sizep (*($arg1*)($current + 1)).$arg2endif $argc == 4if $size == $arg3printf "elem[%u]: ", $sizep (*($arg1*)($current + 1)).$arg2endendset $current = $current._M_nextset $size++endprintf "List size = %u \n", $sizeif $argc == 1printf "List "whatis $arg0printf "Use plist_member <variable_name> <element_type> <member> to see the elements in the list.\n"endend
enddocument plist_memberPrints std::list<T> information.Syntax: plist <list> <T> <idx>: Prints list size, if T defined all elements or just element at idxExamples:plist_member l int member - prints all elements and list sizeplist_member l int member 2 - prints the third element in the list (if exists) and list size
end#
# std::map and std::multimap
#define pmapif $argc == 0help pmapelseset $tree = $arg0set $i = 0set $node = $tree._M_t._M_impl._M_header._M_leftset $end = $tree._M_t._M_impl._M_headerset $tree_size = $tree._M_t._M_impl._M_node_countif $argc == 1printf "Map "whatis $treeprintf "Use pmap <variable_name> <left_element_type> <right_element_type> to see the elements in the map.\n"endif $argc == 3while $i < $tree_sizeset $value = (void *)($node + 1)printf "elem[%u].left: ", $ip *($arg1*)$valueset $value = $value + sizeof($arg1)printf "elem[%u].right: ", $ip *($arg2*)$valueif $node._M_right != 0set $node = $node._M_rightwhile $node._M_left != 0set $node = $node._M_leftendelseset $tmp_node = $node._M_parentwhile $node == $tmp_node._M_rightset $node = $tmp_nodeset $tmp_node = $tmp_node._M_parentendif $node._M_right != $tmp_nodeset $node = $tmp_nodeendendset $i++endendif $argc == 4set $idx = $arg3set $ElementsFound = 0while $i < $tree_sizeset $value = (void *)($node + 1)if *($arg1*)$value == $idxprintf "elem[%u].left: ", $ip *($arg1*)$valueset $value = $value + sizeof($arg1)printf "elem[%u].right: ", $ip *($arg2*)$valueset $ElementsFound++endif $node._M_right != 0set $node = $node._M_rightwhile $node._M_left != 0set $node = $node._M_leftendelseset $tmp_node = $node._M_parentwhile $node == $tmp_node._M_rightset $node = $tmp_nodeset $tmp_node = $tmp_node._M_parentendif $node._M_right != $tmp_nodeset $node = $tmp_nodeendendset $i++endprintf "Number of elements found = %u\n", $ElementsFoundendif $argc == 5set $idx1 = $arg3set $idx2 = $arg4set $ElementsFound = 0while $i < $tree_sizeset $value = (void *)($node + 1)set $valueLeft = *($arg1*)$valueset $valueRight = *($arg2*)($value + sizeof($arg1))if $valueLeft == $idx1 && $valueRight == $idx2printf "elem[%u].left: ", $ip $valueLeftprintf "elem[%u].right: ", $ip $valueRightset $ElementsFound++endif $node._M_right != 0set $node = $node._M_rightwhile $node._M_left != 0set $node = $node._M_leftendelseset $tmp_node = $node._M_parentwhile $node == $tmp_node._M_rightset $node = $tmp_nodeset $tmp_node = $tmp_node._M_parentendif $node._M_right != $tmp_nodeset $node = $tmp_nodeendendset $i++endprintf "Number of elements found = %u\n", $ElementsFoundendprintf "Map size = %u\n", $tree_sizeend
enddocument pmapPrints std::map<TLeft and TRight> or std::multimap<TLeft and TRight> information. Works for std::multimap as well.Syntax: pmap <map> <TtypeLeft> <TypeRight> <valLeft> <valRight>: Prints map size, if T defined all elements or just element(s) with val(s)Examples:pmap m - prints map size and definitionpmap m int int - prints all elements and map sizepmap m int int 20 - prints the element(s) with left-value = 20 (if any) and map sizepmap m int int 20 200 - prints the element(s) with left-value = 20 and right-value = 200 (if any) and map size
enddefine pmap_memberif $argc == 0help pmap_memberelseset $tree = $arg0set $i = 0set $node = $tree._M_t._M_impl._M_header._M_leftset $end = $tree._M_t._M_impl._M_headerset $tree_size = $tree._M_t._M_impl._M_node_countif $argc == 1printf "Map "whatis $treeprintf "Use pmap <variable_name> <left_element_type> <right_element_type> to see the elements in the map.\n"endif $argc == 5while $i < $tree_sizeset $value = (void *)($node + 1)printf "elem[%u].left: ", $ip (*($arg1*)$value).$arg2set $value = $value + sizeof($arg1)printf "elem[%u].right: ", $ip (*($arg3*)$value).$arg4if $node._M_right != 0set $node = $node._M_rightwhile $node._M_left != 0set $node = $node._M_leftendelseset $tmp_node = $node._M_parentwhile $node == $tmp_node._M_rightset $node = $tmp_nodeset $tmp_node = $tmp_node._M_parentendif $node._M_right != $tmp_nodeset $node = $tmp_nodeendendset $i++endendif $argc == 6set $idx = $arg5set $ElementsFound = 0while $i < $tree_sizeset $value = (void *)($node + 1)if *($arg1*)$value == $idxprintf "elem[%u].left: ", $ip (*($arg1*)$value).$arg2set $value = $value + sizeof($arg1)printf "elem[%u].right: ", $ip (*($arg3*)$value).$arg4set $ElementsFound++endif $node._M_right != 0set $node = $node._M_rightwhile $node._M_left != 0set $node = $node._M_leftendelseset $tmp_node = $node._M_parentwhile $node == $tmp_node._M_rightset $node = $tmp_nodeset $tmp_node = $tmp_node._M_parentendif $node._M_right != $tmp_nodeset $node = $tmp_nodeendendset $i++endprintf "Number of elements found = %u\n", $ElementsFoundendprintf "Map size = %u\n", $tree_sizeend
enddocument pmap_memberPrints std::map<TLeft and TRight> or std::multimap<TLeft and TRight> information. Works for std::multimap as well.Syntax: pmap <map> <TtypeLeft> <TypeRight> <valLeft> <valRight>: Prints map size, if T defined all elements or just element(s) with val(s)Examples:pmap_member m class1 member1 class2 member2 - prints class1.member1 : class2.member2pmap_member m class1 member1 class2 member2 lvalue - prints class1.member1 : class2.member2 where class1 == lvalue
end#
# std::set and std::multiset
#define psetif $argc == 0help psetelseset $tree = $arg0set $i = 0set $node = $tree._M_t._M_impl._M_header._M_leftset $end = $tree._M_t._M_impl._M_headerset $tree_size = $tree._M_t._M_impl._M_node_countif $argc == 1printf "Set "whatis $treeprintf "Use pset <variable_name> <element_type> to see the elements in the set.\n"endif $argc == 2while $i < $tree_sizeset $value = (void *)($node + 1)printf "elem[%u]: ", $ip *($arg1*)$valueif $node._M_right != 0set $node = $node._M_rightwhile $node._M_left != 0set $node = $node._M_leftendelseset $tmp_node = $node._M_parentwhile $node == $tmp_node._M_rightset $node = $tmp_nodeset $tmp_node = $tmp_node._M_parentendif $node._M_right != $tmp_nodeset $node = $tmp_nodeendendset $i++endendif $argc == 3set $idx = $arg2set $ElementsFound = 0while $i < $tree_sizeset $value = (void *)($node + 1)if *($arg1*)$value == $idxprintf "elem[%u]: ", $ip *($arg1*)$valueset $ElementsFound++endif $node._M_right != 0set $node = $node._M_rightwhile $node._M_left != 0set $node = $node._M_leftendelseset $tmp_node = $node._M_parentwhile $node == $tmp_node._M_rightset $node = $tmp_nodeset $tmp_node = $tmp_node._M_parentendif $node._M_right != $tmp_nodeset $node = $tmp_nodeendendset $i++endprintf "Number of elements found = %u\n", $ElementsFoundendprintf "Set size = %u\n", $tree_sizeend
enddocument psetPrints std::set<T> or std::multiset<T> information. Works for std::multiset as well.Syntax: pset <set> <T> <val>: Prints set size, if T defined all elements or just element(s) having valExamples:pset s - prints set size and definitionpset s int - prints all elements and the size of spset s int 20 - prints the element(s) with value = 20 (if any) and the size of s
end#
# std::dequeue
#define pdequeueif $argc == 0help pdequeueelseset $size = 0set $start_cur = $arg0._M_impl._M_start._M_curset $start_last = $arg0._M_impl._M_start._M_lastset $start_stop = $start_lastwhile $start_cur != $start_stopp *$start_curset $start_cur++set $size++endset $finish_first = $arg0._M_impl._M_finish._M_firstset $finish_cur = $arg0._M_impl._M_finish._M_curset $finish_last = $arg0._M_impl._M_finish._M_lastif $finish_cur < $finish_lastset $finish_stop = $finish_curelseset $finish_stop = $finish_lastendwhile $finish_first != $finish_stopp *$finish_firstset $finish_first++set $size++endprintf "Dequeue size = %u\n", $sizeend
enddocument pdequeuePrints std::dequeue<T> information.Syntax: pdequeue <dequeue>: Prints dequeue size, if T defined all elementsDeque elements are listed "left to right" (left-most stands for front and right-most stands for back)Example:pdequeue d - prints all elements and size of d
end#
# std::stack
#define pstackif $argc == 0help pstackelseset $start_cur = $arg0.c._M_impl._M_start._M_curset $finish_cur = $arg0.c._M_impl._M_finish._M_curset $size = $finish_cur - $start_curset $i = $size - 1while $i >= 0p *($start_cur + $i)set $i--endprintf "Stack size = %u\n", $sizeend
enddocument pstackPrints std::stack<T> information.Syntax: pstack <stack>: Prints all elements and size of the stackStack elements are listed "top to buttom" (top-most element is the first to come on pop)Example:pstack s - prints all elements and the size of s
end#
# std::queue
#define pqueueif $argc == 0help pqueueelseset $start_cur = $arg0.c._M_impl._M_start._M_curset $finish_cur = $arg0.c._M_impl._M_finish._M_curset $size = $finish_cur - $start_curset $i = 0while $i < $sizep *($start_cur + $i)set $i++endprintf "Queue size = %u\n", $sizeend
enddocument pqueuePrints std::queue<T> information.Syntax: pqueue <queue>: Prints all elements and the size of the queueQueue elements are listed "top to bottom" (top-most element is the first to come on pop)Example:pqueue q - prints all elements and the size of q
end#
# std::priority_queue
#define ppqueueif $argc == 0help ppqueueelseset $size = $arg0.c._M_impl._M_finish - $arg0.c._M_impl._M_startset $capacity = $arg0.c._M_impl._M_end_of_storage - $arg0.c._M_impl._M_startset $i = $size - 1while $i >= 0p *($arg0.c._M_impl._M_start + $i)set $i--endprintf "Priority queue size = %u\n", $sizeprintf "Priority queue capacity = %u\n", $capacityend
enddocument ppqueuePrints std::priority_queue<T> information.Syntax: ppqueue <priority_queue>: Prints all elements, size and capacity of the priority_queuePriority_queue elements are listed "top to buttom" (top-most element is the first to come on pop)Example:ppqueue pq - prints all elements, size and capacity of pq
end#
# std::bitset
#define pbitsetif $argc == 0help pbitsetelsep /t $arg0._M_wend
enddocument pbitsetPrints std::bitset<n> information.Syntax: pbitset <bitset>: Prints all bits in bitsetExample:pbitset b - prints all bits in b
end#
# std::string
#define pstringif $argc == 0help pstringelseprintf "String \t\t\t= \"%s\"\n", $arg0._M_data()printf "String size/length \t= %u\n", $arg0._M_rep()._M_lengthprintf "String capacity \t= %u\n", $arg0._M_rep()._M_capacityprintf "String ref-count \t= %d\n", $arg0._M_rep()._M_refcountend
enddocument pstringPrints std::string information.Syntax: pstring <string>Example:pstring s - Prints content, size/length, capacity and ref-count of string s
end #
# std::wstring
#define pwstringif $argc == 0help pwstringelsecall printf("WString \t\t= \"%ls\"\n", $arg0._M_data())printf "WString size/length \t= %u\n", $arg0._M_rep()._M_lengthprintf "WString capacity \t= %u\n", $arg0._M_rep()._M_capacityprintf "WString ref-count \t= %d\n", $arg0._M_rep()._M_refcountend
enddocument pwstringPrints std::wstring information.Syntax: pwstring <wstring>Example:pwstring s - Prints content, size/length, capacity and ref-count of wstring s
end #
# C++ related beautifiers (optional)
#set print pretty on
set print object on
set print static-members on
set print vtbl on
set print demangle on
set demangle-style gnu-v3
set print sevenbit-strings off

相关文章:

gdb调试std::list和std::vector等容器的方法

GDB中print方法并不能直接打印STL容器中保存的变量&#xff0c;其实只要http://www.yolinux.com/TUTORIALS/src/dbinit_stl_views-1.03.txt这个文件保存为~/.gdbinit 就可以使用它提供的方法方便调试容器 指定启动文件&#xff1a;~/.gdbinit&#xff0c;下面的方法任选其一。…...

python stomp 转发activemq topic消息

import pysimplestomp 连接到ActiveMQ的Topic&#xff1a; # 连接ActiveMQ服务器 server "tcp://localhost:61613" topic "/topic/your_topic"# 连接到ActiveMQ的Topic destination f"destination://{topic}" connection pysimplestomp.con…...

Spring Boot使用AOP

一、为什么需要面向切面编程&#xff1f; 面向对象编程&#xff08;OOP&#xff09;的好处是显而易见的&#xff0c;缺点也同样明显。当需要为多个不具有继承关系的对象添加一个公共的方法的时候&#xff0c;例如日志记录、性能监控等&#xff0c;如果采用面向对象编程的方法&…...

C语言通过IXMLHttpRequest以get或post方式发送http请求获取服务器文本或xml数据

做过网页设计的人应该都知道ajax。 Ajax即Asynchronous Javascript And XML&#xff08;异步的JavaScript和XML&#xff09;。使用Ajax的最大优点&#xff0c;就是能在不更新整个页面的前提下维护数据。这使得Web应用程序更为迅捷地回应用户动作&#xff0c;并避免了在网络上发…...

QtRVSim(二)一个 RISC-V 程序的解码流程

继上一篇文章简单代码分析后&#xff0c;本文主要调研如何实现对指令的解析运行。 调试配置 使用 gdb 工具跟踪调试运行。 c_cpp_properties.json 项目配置&#xff1a; {"name": "QtRvSim","includePath": ["${workspaceFolder}/**&quo…...

x-cmd pkg | httpx - 为 Python 设计的下一代 HTTP 客户端库

目录 简介首次用户功能特点进一步探索 简介 HTTPX 是一个为 Python 设计的下一代 HTTP 客户端库&#xff0c;由 Tom Christie 创建。它提供了同步和异步的 API&#xff0c;并支持 HTTP/1.1 和 HTTP/2 协议。与 Requests 库类似&#xff0c;但增加了对异步请求的支持和 HTTP/2 …...

代码随想录算法训练营第四十二天(动态规划篇)|62. 不同路径

62. 不同路径 题目链接&#xff1a;62. 不同路径 - 力扣&#xff08;LeetCode&#xff09; 思路 dp[i][j]: 从0到位置[i, j]共有dp[i][j]条路径。 dp[i][j] dp[i-1][j] dp[i][j-1] 到位置[i,j]&#xff0c;可以从它的上面或者左边来&#xff0c;所以路径和为这两个方向的路…...

YOLO 全面回顾:从最初的YOLOv1到最新的YOLOv8、YOLO-NAS,以及整合了 Transformers 的 YOLO

YOLO 全面回顾 综述评估指标YOLO v1YOLO v2YOLO v3YOLO v4YOLOv5 与 Scaled-YOLOv4 YOLORYOLOXYOLOv6YOLOv7DAMO-YOLOYOLOv8PP-YOLO, PP-YOLOv2, and PP-YOLOEYOLO-NASYOLO with Transformers 综述 论文&#xff1a;https://arxiv.org/pdf/2304.00501.pdf 代码&#xff1a;gi…...

Android双指缩放ScaleGestureDetector检测放大因子大图移动到双指中心点ImageView区域中心,Kotlin(2)

Android双指缩放ScaleGestureDetector检测放大因子大图移动到双指中心点ImageView区域中心&#xff0c;Kotlin&#xff08;2&#xff09; 在 Android ScaleGestureDetector检测双指缩放Bitmap基于Matrix动画移动到双指捏合中心点ImageView区域中心&#xff0c;Kotlin-CSDN博客 …...

同为科技(TOWE)自动控制循环定时插座

随着科技的发展&#xff0c;智能化家居已成为我们生活的重要组成部分。作为国内领先的智能家居品牌&#xff0c;同为科技&#xff08;TOWE&#xff09;推出的自动控制循环定时插座&#xff0c;无疑将科技与生活完美地结合在一起。 1.外观设计 同为科技&#xff08;TOWE&#x…...

游戏设计模式

单列模式 概念 单例模式是一种创建型设计模式&#xff0c;可以保证一个类只有一个实例&#xff0c;并提供一个访问该实例的全局节点。 优点 可以派生&#xff1a;在单例类的实例构造函数中可以设置以允许子类派生。受控访问&#xff1a;因为单例类封装他的唯一实例&#xf…...

CUBEMX与FreeRTOS在Arm Compiler 6下的配置方法

在嵌入式开发中&#xff0c;STM32是一种广泛使用的微控制器。为了提高开发效率&#xff0c;我们通常会利用ST公司提供的STM32CubeMX工具来配置硬件&#xff0c;并结合FreeRTOS这一实时操作系统来进行多任务处理。本文将深入探讨如何在这一框架下&#xff0c;使用Arm Compiler 6…...

Android Studio 提示Use app:drawableStartCompat instead of android:drawableStart

每次提交代码时&#xff0c;AS这个老妈子总爱唠叨一堆warning&#xff0c;这些Warning都在讲什么&#xff1f; 1.Use app:drawableStartCompat instead of android:drawableStart 在Android开发中&#xff0c;android:drawableStart和app:drawableStartCompat是两个用于设置…...

C# wpf 实现任意控件(包括窗口)更多调整大小功能

WPF拖动改变大小系列 第一节 Grid内控件拖动调整大小 第二节 Canvas内控件拖动调整大小 第三节 窗口拖动调整大小 第四节 附加属性实现拖动调整大小 第五章 拓展更多调整大小功能&#xff08;本章&#xff09; 文章目录 WPF拖动改变大小系列前言一、添加的功能1、任意控件Drag…...

Vue+OpenLayers7入门到实战:快速搭建Vue+OpenLayers7地图脚手架项目。从零开始构建Vue项目并整合OpenLayers7.5.2

返回《Vue+OpenLayers7》专栏目录:Vue+OpenLayers7 前言 本章针对Vue初学者,对Vue不熟悉,甚至还不会Vue的入门学生读者。 本章会详细讲解从NodeJS环境到npm环境的各个步骤,再到使用vue-cli脚手架快速生成项目,以及添加OpenLayers7地图库依赖,编写简单的xyz高德地图显示…...

mysql-线上常用运维sql

1.表备份 INSERT INTO table1 SELECT * FROM table2; 2.用一个表中的字段更新另一张表中的字段 UPDATE table2 JOIN table1 ON table2.id table1.id SET table2.column2 table1.column1; 3.在MySQL中&#xff0c;查询一个表的列字段值是否包含另一个表的字段&#xff0c;…...

Linux之进程间通信(system V 共享内存)

目录 一、共享内存 1、基本原理 2、共享内存的创建 3、共享内存的释放 4、共享内存的关联 5、共享内存的去关联 6、查看IPC资源 二、完整通信代码 三、共享内存的特点 四、信号量 1、相关概念 2、信号量概念 进程间通信的本质就是让不同的进程看到同一个资源。而前…...

数据库 sql select *from account where name=‘张三‘ 执行过程

select *from account where name张三分析上面语句的执行过程 用到了索引 由于是根据 1.name字段进行查询&#xff0c;所以先根据name张三’到name字段的二级索引中进行匹配查 找。但是在二级索引中只能查找到 Arm 对应的主键值 10。 2.由于查询返回的数据是*&#xff0c…...

力扣日记1.27-【回溯算法篇】131. 分割回文串

力扣日记&#xff1a;【回溯算法篇】131. 分割回文串 日期&#xff1a;2023.1.27 参考&#xff1a;代码随想录、力扣 131. 分割回文串 题目描述 难度&#xff1a;中等 给你一个字符串 s&#xff0c;请你将 s 分割成一些子串&#xff0c;使每个子串都是 回文串 。返回 s 所有可…...

如何用web界面打开华为防火墙

目录 1.创建一个虚拟网卡 2.cloud操作 3.防火墙上操作 4. 登录 1.创建一个虚拟网卡 2.cloud操作 3.防火墙上操作 4. 登录...

java 实现excel文件转pdf | 无水印 | 无限制

文章目录 目录 文章目录 前言 1.项目远程仓库配置 2.pom文件引入相关依赖 3.代码破解 二、Excel转PDF 1.代码实现 2.Aspose.License.xml 授权文件 总结 前言 java处理excel转pdf一直没找到什么好用的免费jar包工具,自己手写的难度,恐怕高级程序员花费一年的事件,也…...

【快手拥抱开源】通过快手团队开源的 KwaiCoder-AutoThink-preview 解锁大语言模型的潜力

引言&#xff1a; 在人工智能快速发展的浪潮中&#xff0c;快手Kwaipilot团队推出的 KwaiCoder-AutoThink-preview 具有里程碑意义——这是首个公开的AutoThink大语言模型&#xff08;LLM&#xff09;。该模型代表着该领域的重大突破&#xff0c;通过独特方式融合思考与非思考…...

css3笔记 (1) 自用

outline: none 用于移除元素获得焦点时默认的轮廓线 broder:0 用于移除边框 font-size&#xff1a;0 用于设置字体不显示 list-style: none 消除<li> 标签默认样式 margin: xx auto 版心居中 width:100% 通栏 vertical-align 作用于行内元素 / 表格单元格&#xff…...

Maven 概述、安装、配置、仓库、私服详解

目录 1、Maven 概述 1.1 Maven 的定义 1.2 Maven 解决的问题 1.3 Maven 的核心特性与优势 2、Maven 安装 2.1 下载 Maven 2.2 安装配置 Maven 2.3 测试安装 2.4 修改 Maven 本地仓库的默认路径 3、Maven 配置 3.1 配置本地仓库 3.2 配置 JDK 3.3 IDEA 配置本地 Ma…...

安卓基础(aar)

重新设置java21的环境&#xff0c;临时设置 $env:JAVA_HOME "D:\Android Studio\jbr" 查看当前环境变量 JAVA_HOME 的值 echo $env:JAVA_HOME 构建ARR文件 ./gradlew :private-lib:assembleRelease 目录是这样的&#xff1a; MyApp/ ├── app/ …...

C++:多态机制详解

目录 一. 多态的概念 1.静态多态&#xff08;编译时多态&#xff09; 二.动态多态的定义及实现 1.多态的构成条件 2.虚函数 3.虚函数的重写/覆盖 4.虚函数重写的一些其他问题 1&#xff09;.协变 2&#xff09;.析构函数的重写 5.override 和 final关键字 1&#…...

20个超级好用的 CSS 动画库

分享 20 个最佳 CSS 动画库。 它们中的大多数将生成纯 CSS 代码&#xff0c;而不需要任何外部库。 1.Animate.css 一个开箱即用型的跨浏览器动画库&#xff0c;可供你在项目中使用。 2.Magic Animations CSS3 一组简单的动画&#xff0c;可以包含在你的网页或应用项目中。 3.An…...

代码规范和架构【立芯理论一】(2025.06.08)

1、代码规范的目标 代码简洁精炼、美观&#xff0c;可持续性好高效率高复用&#xff0c;可移植性好高内聚&#xff0c;低耦合没有冗余规范性&#xff0c;代码有规可循&#xff0c;可以看出自己当时的思考过程特殊排版&#xff0c;特殊语法&#xff0c;特殊指令&#xff0c;必须…...

省略号和可变参数模板

本文主要介绍如何展开可变参数的参数包 1.C语言的va_list展开可变参数 #include <iostream> #include <cstdarg>void printNumbers(int count, ...) {// 声明va_list类型的变量va_list args;// 使用va_start将可变参数写入变量argsva_start(args, count);for (in…...

windows系统MySQL安装文档

概览&#xff1a;本文讨论了MySQL的安装、使用过程中涉及的解压、配置、初始化、注册服务、启动、修改密码、登录、退出以及卸载等相关内容&#xff0c;为学习者提供全面的操作指导。关键要点包括&#xff1a; 解压 &#xff1a;下载完成后解压压缩包&#xff0c;得到MySQL 8.…...