Satrol_ 2023-11-22 21:41 采纳率: 90.9%
浏览 6
已结题

gdb调试代码后无法list操作,如何解决?(操作系统-linux)

每一次调试完代码后,我想要看一下源码设置新断点,结果输出以下错误,求各路dl解答

img

  • 写回答

1条回答 默认 最新

  • CSDN-Ada助手 CSDN-AI 官方账号 2023-11-23 09:10
    关注

    【相关推荐】



    • 帮你找了个相似的问题, 你可以看下: https://ask.csdn.net/questions/7741302
    • 我还给你找了一篇非常好的博客,你可以看看是否有帮助,链接:GDB 高级调试-多线程、后台调试、多进程、反向调试
    • 您还可以看一下 夏曹俊老师的学会在Linux上编译调试C++项目课程中的 GDB介绍和list指令小节, 巩固相关知识点
    • 除此之外, 这篇博客: linux调试程序利器 GDB学习笔记中的 1.使用list(简写:l) 命令,将看到部分源程序清单。 部分也许能够解决你的问题, 你可以仔细阅读以下内容或跳转源博客中阅读:
      list:                显示源程序1-10行
      list +行号:      显示行号前后若干行
      list +函数名:          显示函数前后若干行
      这里就不一一列举了,所有有关list的相关操作可以使用 help list 命令进行查看
      如:
      (gdb) l main
      29       *   Input Args:
      30       *  Output Args:
      31       * Return Value:
      32       ********************************************************************************/
      33      int main (int argc, char **argv)
      34      {
      35          int i;
      36          long result = 0;
      37          int sum = 0;
      38          sum  = func(10);
      (gdb) help list //可以看到有关list的命令说明
      List specified function or line.
      With no argument, lists ten more lines after or around previous listing.
      "list -" lists the ten lines before a previous ten-line listing.
      One argument specifies a line, and ten lines are listed around that line.
      Two arguments with comma between specify starting and ending lines to list.
      Lines can be specified in these ways:
        LINENUM, to list around that line in current file,
        FILE:LINENUM, to list around that line in that file,
        FUNCTION, to list around beginning of that function,
        FILE:FUNCTION, to distinguish among like-named static functions.
        *ADDRESS, to list around the line containing that address.
      With two args if one is empty it stands for ten lines away from the other arg.
      



    如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 12月7日
  • 已采纳回答 11月29日
  • 创建了问题 11月22日

悬赏问题

  • ¥200 csgo2的viewmatrix值是否还有别的获取方式
  • ¥15 Stable Diffusion,用Ebsynth utility在视频选帧图重绘,第一步报错,蒙版和帧图没法生成,怎么处理啊
  • ¥15 请把下列每一行代码完整地读懂并注释出来
  • ¥15 pycharm运行main文件,显示没有conda环境
  • ¥15 寻找公式识别开发,自动识别整页文档、图像公式的软件
  • ¥15 为什么eclipse不能再下载了?
  • ¥15 编辑cmake lists 明明写了project项目名,但是还是报错怎么回事
  • ¥15 关于#计算机视觉#的问题:求一份高质量桥梁多病害数据集
  • ¥15 特定网页无法访问,已排除网页问题
  • ¥50 如何将脑的图像投影到颅骨上