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

网站开发采集工具如何做网站内链优化

网站开发采集工具,如何做网站内链优化,酒类网站建设方案案,深圳高端网页设计公司在使用GDB#xff08;GNU Debugger#xff09;进行多进程调试时#xff0c;你可以使用几种不同的方法来管理和调试多个进程。这里是一些基本的步骤和技巧#xff1a; 1. 启动GDB 首先#xff0c;你需要启动GDB。通常情况下#xff0c;你可以通过命令行启动GDB并附加到一…在使用GDBGNU Debugger进行多进程调试时你可以使用几种不同的方法来管理和调试多个进程。这里是一些基本的步骤和技巧 1. 启动GDB 首先你需要启动GDB。通常情况下你可以通过命令行启动GDB并附加到一个正在运行的进程或者启动一个新的进程。 gdb 程序名或者附加到一个已经存在的进程 gdb -p 进程ID2. 跟踪多个进程 当你的应用程序启动多个进程时你可以使用 set follow-fork-mode 命令来控制GDB在fork时应该跟踪父进程还是子进程。 跟踪父进程 (gdb) set follow-fork-mode parent跟踪子进程 (gdb) set follow-fork-mode child3. 切换进程 如果需要在多个进程之间切换可以使用 info inferiors 命令查看所有进程的列表然后使用 inferior 命令选择一个进程。 查看进程列表 (gdb) info inferiors切换到特定进程例如切换到编号为2的进程 (gdb) inferior 24. 调试线程 如果在一个多线程的进程中调试你还可以使用线程相关的命令。查看和切换线程 查看所有线程 (gdb) info threads切换到特定线程 (gdb) thread 线程号5. 继续和中断进程 在调试过程中你可以控制进程的执行使用 continue 命令继续执行使用 interrupt 命令中断一个正在运行的进程。 6. 设置断点 你可以在代码中设置断点以便在执行到特定的代码行时停下来 (gdb) break 文件名:行号或者在函数入口处设置断点 (gdb) break 函数名小技巧 使用 detach 命令可以从当前进程中分离出来让它继续运行。 detach inferiors id设置调试模式 set detach-on-fork on/off默认为on,表示调试当前进程的时候其他进程被GDB挂起 使用 kill 命令可以终止当前正在调试的进程。 通过这些步骤和命令你可以有效地使用GDB进行多进程的调试。这对于开发涉及多个进程交互的复杂应用程序尤其有用。 GDB默认调试父进程 daicdaic:~/Linux/linuxwebserver/part02multiProgress/lesson19$ gdb hello GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1 Copyright (C) 2018 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 x86_64-linux-gnu. 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 hello...done. (gdb) l 1 #include stdio.h 2 #include unistd.h 3 4 int main() { 5 6 printf(begin\n); 7 8 if(fork() 0) { 9 10 printf(我是父进程pid %d, ppid %d\n, getpid(), getppid()); (gdb) l 11 12 int i; 13 for(i 0; i 10; i) { 14 printf(i %d\n, i); 15 sleep(1); 16 } 17 18 } else { 19 20 printf(我是子进程pid %d, ppid %d\n, getpid(), getppid()); (gdb) b 10 Breakpoint 1 at 0x7c8: file hello.c, line 10. (gdb) b 20 Breakpoint 2 at 0x81e: file hello.c, line 20. (gdb) i b Num Type Disp Enb Address What 1 breakpoint keep y 0x00000000000007c8 in main at hello.c:10 2 breakpoint keep y 0x000000000000081e in main at hello.c:20 (gdb) r Starting program: /home/daic/Linux/linuxwebserver/part02multiProgress/lesson19/hello begin 我是子进程pid 16447, ppid 16443 j 0Breakpoint 1, main () at hello.c:10 10 printf(我是父进程pid %d, ppid %d\n, getpid(), getppid()); (gdb) j 1 j 2 j 3 j 4 j 5 j 6 j 7 j 8 j 9 n 我是父进程pid 16443, ppid 16428 13 for(i 0; i 10; i) { (gdb) n 14 printf(i %d\n, i); (gdb) n i 0 15 sleep(1); (gdb) n 13 for(i 0; i 10; i) { (gdb) n 14 printf(i %d\n, i); (gdb) n i 1 15 sleep(1); (gdb) c Continuing. i 2 i 3 i 4 i 5 i 6 i 7 i 8 i 9 [Inferior 1 (process 16443) exited normally] (gdb) show follow-fork-mode Debugger response to a program call of fork or vfork is parent. (gdb) set follow-fork-mode child (gdb) show follow-fork-mode Debugger response to a program call of fork or vfork is child. (gdb) i b Num Type Disp Enb Address What 1 breakpoint keep y 0x00005555555547c8 in main at hello.c:10breakpoint already hit 2 times 2 breakpoint keep y 0x000055555555481e in main at hello.c:20 (gdb) r Starting program: /home/daic/Linux/linuxwebserver/part02multiProgress/lesson19/hello begin [New process 16465] 我是父进程pid 16464, ppid 16428 i 0 [Switching to process 16465]Thread 2.1 hello hit Breakpoint 2, main () at hello.c:20 20 printf(我是子进程pid %d, ppid %d\n, getpid(), getppid()); (gdb) i 1 i 2 i 3 i 4 i 5 i 6 i 7 i 8 i 9 n 我是子进程pid 16465, ppid 1 23 for(j 0; j 10; j) { (gdb) n 24 printf(j %d\n, j); (gdb) n j 0 25 sleep(1); (gdb) n 23 for(j 0; j 10; j) { (gdb) n 24 printf(j %d\n, j); 因为gdb8.1版本存在多进程调试bug故升级到gdb12.1 升级gdb版本步骤 要将GDBGNU Debugger从8.1.1版本升级到12.1版本你可以按照以下步骤操作。这些步骤适用于大多数Linux发行版但具体命令可能会根据你的操作系统有所不同。请确保按照适用于你的操作系统的指南进行操作。 步骤1: 卸载旧版本的GDB 在安装新版本之前建议先卸载旧版本的GDB以避免版本冲突。你可以使用包管理器来执行此操作例如在Debian或Ubuntu系统上 sudo apt-get remove gdb在Red Hat、CentOS或Fedora上 sudo yum remove gdb步骤2: 获取最新版本的GDB 有几种方法可以获取最新版本的GDB 通过包管理器安装 如果你的Linux发行版的软件源已经包含了新版本的GDB你可以直接通过包管理器安装。例如在Debian或Ubuntu上 sudo apt-get update sudo apt-get install gdb在Red Hat、CentOS或Fedora上 sudo yum install gdb从源代码编译 如果包管理器提供的不是最新版本或者你需要一个具有特定配置的GDB版本你可以从源代码编译安装。首先需要从GNU项目的网站或镜像下载最新的GDB源代码 访问 GNU官方网站 或 GDB的FTP镜像 下载最新的源代码包。解压下载的源码包 tar -xvf gdb-12.1.tar.xz进入解压后的目录配置并编译源代码 cd gdb-12.1 ./configure make安装编译后的GDB sudo make install步骤3: 验证安装 安装完成后你可以通过运行以下命令来验证新版本的GDB是否安装成功 gdb --version这条命令应该显示出新安装的GDB版本号例如“GNU gdb (GDB) 12.1”。 注意事项 在编译GDB之前确保你的系统已安装了所有必需的依赖项如gcc, make 和开发工具包。如果你在使用的系统中遇到权限问题或依赖性错误确保按照你的系统的具体要求解决这些问题。 这样你就可以从GDB 8.1.1升级到GDB 12.1了。如果你在升级过程中遇到任何问题可以查看GDB的官方文档或在相应的社区论坛中寻求帮助。 daicdaic:~/Linux/linuxwebserver/part02multiProgress/lesson19$ gdb hello GNU gdb (GDB) 12.1 Copyright (C) 2022 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 x86_64-pc-linux-gnu. Type show configuration for configuration details. For bug reporting instructions, please see: https://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 hello... (gdb) l 1 #include stdio.h 2 #include unistd.h 3 4 int main() { 5 6 printf(begin\n); 7 8 if(fork() 0) { 9 10 printf(我是父进程pid %d, ppid %d\n, getpid(), getppid()); (gdb) l 11 12 int i; 13 for(i 0; i 10; i) { 14 printf(i %d\n, i); 15 sleep(1); 16 } 17 18 } else { 19 20 printf(我是子进程pid %d, ppid %d\n, getpid(), getppid()); (gdb) set detach-on-fork off (gdb) b 10 Breakpoint 1 at 0x7c8: file hello.c, line 10. (gdb) b 20 Breakpoint 2 at 0x81e: file hello.c, line 20. (gdb) i b Num Type Disp Enb Address What 1 breakpoint keep y 0x00000000000007c8 in main at hello.c:10 2 breakpoint keep y 0x000000000000081e in main at hello.c:20 (gdb) r Starting program: /home/daic/Linux/linuxwebserver/part02multiProgress/lesson19/hello begin [New inferior 2 (process 67145)]Thread 1.1 hello hit Breakpoint 1, main () at hello.c:10 10 printf(我是父进程pid %d, ppid %d\n, getpid(), getppid()); (gdb) n 我是父进程pid 67142, ppid 67133 13 for(i 0; i 10; i) { (gdb) n 14 printf(i %d\n, i); (gdb) n i 0 15 sleep(1); (gdb) info inferiors Num Description Connection Executable * 1 process 67142 1 (native) /home/daic/Linux/linuxwebserver/part02multiProgress/lesson19/hello 2 process 67145 1 (native) /home/daic/Linux/linuxwebserver/part02multiProgress/lesson19/hello (gdb) inferior 2 [Switching to inferior 2 [process 67145] (/home/daic/Linux/linuxwebserver/part02multiProgress/lesson19/hello)] [Switching to thread 2.1 (process 67145)] #0 0x00007ffff7ac67cc in fork () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) info inferiors Num Description Connection Executable 1 process 67142 1 (native) /home/daic/Linux/linuxwebserver/part02multiProgress/lesson19/hello * 2 process 67145 1 (native) /home/daic/Linux/linuxwebserver/part02multiProgress/lesson19/hello (gdb) c Continuing.Thread 2.1 hello hit Breakpoint 2, main () at hello.c:20 20 printf(我是子进程pid %d, ppid %d\n, getpid(), getppid()); (gdb) n 我是子进程pid 67145, ppid 67142 23 for(j 0; j 10; j) { (gdb) n 24 printf(j %d\n, j); (gdb) n j 0 25 sleep(1); (gdb) inferior 1 [Switching to inferior 1 [process 67142] (/home/daic/Linux/linuxwebserver/part02multiProgress/lesson19/hello)] [Switching to thread 1.1 (process 67142)] #0 main () at hello.c:15 15 sleep(1); (gdb) c Continuing. i 1 i 2 i 3 i 4 i 5 i 6 i 7 i 8 i 9 [Inferior 1 (process 67142) exited normally] [Switching to process 67145] (gdb) info inferiors Num Description Connection Executable 1 null /home/daic/Linux/linuxwebserver/part02multiProgress/lesson19/hello * 2 process 67145 1 (native) /home/daic/Linux/linuxwebserver/part02multiProgress/lesson19/hello (gdb) n 23 for(j 0; j 10; j) { (gdb) n 24 printf(j %d\n, j); (gdb) c Continuing. j 1 j 2 j 3 j 4 j 5 j 6 j 7 j 8 j 9 [Inferior 2 (process 67145) exited normally]
http://www.pierceye.com/news/464405/

相关文章:

  • 2015百度推广网站遭到攻击非遗网页设计作品欣赏
  • 网站空间需要多大网站推荐几个免费的
  • 做一个网站花多少钱建行系统
  • 滁州市住房城乡建设部网站wordpress title背景
  • 餐饮手机微网站怎么做wordpress 多语言建站
  • 企业信息系统案例东昌府聊城网站优化
  • 做美食直播哪个网站好php网站开发数据列表排重
  • 网站建设 职责网站分站加盟
  • 单页网站产品手机网站免费生成
  • 无锡电子商务网站建设公司德国网站的后缀名
  • 服务器做视频网站赣州企业做网站
  • 如何看出网站用dede做的网站百度快照
  • 做网站很难吗五种新型营销方式
  • 个人网站搭建模拟感想江西企业网站建设哪家好
  • 长春企业网站建设网站制作公司相关工作
  • 免费课程网站有哪些兼职网站项目建设报告
  • 建立网站免费dedecms网站地图制作
  • 网页设计公司网站制作做网站最主要是那个一类商标
  • 卫生局网站建设方案网站架构设计英文翻译
  • 学做衣服网站有哪些智能开发平台软件
  • wordpress 下载站插件wordpress清楚所有评论
  • 公司网站建设工作计划网站设置受信任
  • 网站如何做实名验证码深圳企业网站推广
  • 傻瓜式大型网站开发工具餐饮业手机php网站
  • 网站建设小细节图片东阳网站建设yw126
  • 为什么找不到做网站的软件怎么做音乐mp3下载网站
  • 做一个网站需要什么网络营销方式分析论文
  • 可以做3d电影网站企业网站优化应该怎么做
  • 中山做网站联系电话app客户端开发公司
  • 秦皇岛网站推广价钱南京建设网站制作