- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在做一个类(class)项目(别担心,这个问题不是家庭作业),最近从部门的机器搬到了我自己的机器上。该项目是构建一个简单的操作系统。为了使任务更容易,我们提供了将 gdb “附加”到我们程序运行的 QEMU 的能力。在我的计算机上运行这个程序而不附加 gdb 工作正常,但是当我开始尝试使用 gdb 时它不运行。需要注意的主要事项(我认为)是它在部门计算机 (gdb 7.4.1-debian) 上运行良好,但在我的计算机 (7.6.1-ubuntu) 上运行良好。
我得到的关于 python 的错误是 gdb 扩展是用 python 编写的,但它们似乎没有被发现。我也遇到语法错误。该程序的运行如下所示:
/usr/bin/qemu-system-i386
GNU gdb (GDB) 7.6.1-ubuntu
Copyright (C) 2013 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".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/alfonso/course/cs167/weenix/kernel/weenix.dbg...done.
然后它挂了一会儿,然后给我这个错误:
inittmp.gdb:1: Error in sourced command file:
localhost:1234: Connection timed out.
Traceback (most recent call last):
File "/home/alfonso/course/cs167/weenix/kernel/mm/memcheck.py", line 5, in <module>
import weenix
ImportError: No module named 'weenix'
File "/home/alfonso/course/cs167/weenix/kernel/mm/page.py", line 15
print "pagesize: {0}".format(weenix.kmem.pagesize())
^
SyntaxError: invalid syntax
File "/home/alfonso/course/cs167/weenix/kernel/mm/slab.py", line 40
print "{1:<{0}} {3:>{2}} {5:>{4}} {7:>{6}}".format(
^
SyntaxError: invalid syntax
File "/home/alfonso/course/cs167/weenix/kernel/proc/proc.py", line 17
print weenix.proc.str_proc_tree()
^
SyntaxError: invalid syntax
Traceback (most recent call last):
File "/home/alfonso/course/cs167/weenix/kernel/util/debug.py", line 3, in <module>
import weenix
ImportError: No module named 'weenix'
Traceback (most recent call last):
File "/home/alfonso/course/cs167/weenix/kernel/util/list.py", line 3, in <module>
import weenix
ImportError: No module named 'weenix'
Breakpoint 1 at 0xc0008f04: file util/debug.c, line 190.
Breakpoint 2 at 0xc0007016: file main/kmain.c, line 298.
Breakpoint 3 at 0xc0006cf3: file main/kmain.c, line 129.
init.gdb:6: Error in sourced command file:
The program is not being run.
当然,导入错误和无效语法让我开始考虑我的 PYTHONPATH 和/或包设置,但这是工作正常的东西(测试过)。我唯一能想到的是我忽略了一些配置问题。
如果您愿意,我可以发布 bash 脚本、.gdb 文件和其他文件,但由于这在部门计算机上运行良好,我怀疑这是问题所在。
Python 版本:(部门:“2.7.3”,我:“2.7.5+”)
编辑:经过一番搜索,我意识到最新的 Linux Mint(petra) 使用将 python 解释为 python3 的 gdb。我目前正在寻找一种配置 gdb 的方法,但由于我以前从未做过,如果有人可以指导我这样做,我将不胜感激。
最佳答案
您将 Python 3 用于此 Debug模式。
$ python3 test33.py
File "test33.py", line 1
print "hello".format()
^
SyntaxError: invalid syntax
确保按照您所说的使用 Python 2。
关于python - "No module named"。 gdb 中的 Python 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22076453/
假设我定义了一个 new gdb command其中包括别名。 import gdb import string class PrettyPrintString (gdb.Command):
是否可以使用 gdb 的 if 或 while 条件来测试 gdb 命令是否成功(而不是查询程序值或变量)? 现在为了清楚起见,我谈论的是 gdb 内置命令(即当您在 gdb 中键入 help 时出现
我只是使用 gdb 逐行逐行执行代码,以了解它是如何工作的以及它在做什么。我第一次这样做时效果很好,但现在下一个命令无法正常工作。有时它前进,有时它倒退。这没有意义。每次我这样做似乎都是相同的模式。下
我怎样才能运行类似 gdb -e path/to/exe -ex 'run --argnamae argvalue' 的东西? 让我们假设在过去一两年内有一个最新版本的 gfb。 Gdb 运行并打印响
我正在使用 gdb 调试程序,并且我想要命令的输出 $(perl -e 'print "A"x20') 作为我的论点。我怎样才能做到这一点?这样,论点将非常灵活。 最佳答案 您可以使用 run 命令,
我在 linux 上使用 gdb 版本 7.5.1,并试图使用诸如 $_memeq 之类的便利功能只是发现它显然不存在: Undefined command: "$_memeq". Try "help
我有: 正在运行的剥离二进制文件 总局 未剥离的二进制文件 我可以连接到运行剥离的二进制文件 (gdp -p PID)。如何将未剥离二进制文件中的符号提供给连接到正在运行的进程的 gdb? 最佳答案
我偶然发现了gdb的自动显示功能,该功能非常强大且方便。打电话后 (gdb) display/i $pc (gdb) display $rax 监视的值将在每个步骤后自动显示: (gdb) si 0x
我知道 Linux 等现代操作系统并不总是在应用程序最初链接的同一地址执行应用程序。但是,当调试器开始四处查看时,它需要知道原始链接地址和最终执行地址之间的关系。 GDB如何计算偏移量? 澄清:我不是
我想知道是否有可能从GDB本身获取已调试应用程序已打开但未关闭的文件/目录的列表? 当前,我设置了一个断点,然后使用lsof这样的外部程序来检查打开的文件。 但是这种方法确实很烦人。 环境:Debia
我想执行非常简单的命令 print var1, var2, var3, var4 在 gdb 中不时检查变量的值。 我不想使用显示,因为它会扰乱我的 View 。 我该如何做到这一点?现在我能做的就是
这个问题已经有答案了: gdb scripting: execute commands at selected breakpoint (1 个回答) 已关闭 8 年前。 我需要检查一个变量以确定它是否
在命令行下,我知道使用 echo $?给我退出代码。在gdb中,我使用“r”来运行程序,程序终止,那么gdb是如何得到这个退出码的呢? gdb 里面有什么命令吗? 谢谢! 最佳答案 当程序退出时,gd
我遇到了核心,无法从中获取回溯。我有两个问题。 我可以从以下位置找出导致崩溃的行或崩溃发生的位置吗列出命令输出? 否则如何处理。我应该将 heuristic-fence-post 设置为多少才能得到一
调试时加断点,运行bt可以看到栈帧。 通过运行信息寄存器选择帧时,可以看到特定帧上的寄存器值。 例如,考虑在第 5 帧设置断点。当断点被击中时,进入第 3 帧,可以看到查看寄存器值。 在第 5 帧设置
gdb 如何打印结构?来自 zengr 在 how does gdb work? 引用的“GDB 内部”文档看起来 GDB 使用 BFD 库从一个或多个符号表加载符号。如果是这种情况,gdb 怎么知道
我只是使用 gdb 逐行逐行执行代码,以了解它是如何工作的以及它在做什么。我第一次这样做时效果很好,但现在下一个命令无法正常工作。有时它前进,有时它倒退。这没有意义。每次我这样做似乎都是相同的模式。下
当我执行以下命令时,我得到不同的 function() 地址 (gdb) 中断函数() function() 0x804834a 处的断点 1。 (gdb) 打印函数() function() 0x8
我已经安装了 (OSX Mojave 10.14.6.) Eclipse CDT 和 GNU MCU Eclipse plugin最后 GNU Tools for ARM .我的目标是使用 GDB (
我必须对文件(main 和 functions)进行 cpp,然后让它们构建一个 exe 文件(代码)和两个目标文件(main.o 和 functions.o)。 如何从 gdb 命令行调试特定文件“
我是一名优秀的程序员,十分优秀!