我可以在gdb下打印gdtr和gdt描述符吗? [英] Can I print the gdtr and gdt descriptor under gdb?

查看:2294
本文介绍了我可以在gdb下打印gdtr和gdt描述符吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 我想用gdb查看我的GDTR / LDTR / TTR和段寄存器

不可见部分(x86)
在gdb中输入p / x $ gdtr.... etc
但结果是$ 6 =值无法转换为整数
,在gdb中输入p / x $ cs
唯一的结果是CS,只是可见的部分

pre > 谁能告诉我如何查看这些值?

感谢您的回答

解决方案

如果GDB有这样一个函数,那么这个函数只有在GDB能够使用SGDT指令读取GDTR时才有效。这意味着GDB必须运行在响铃0中。



Linux和Windows都不允许运行应用程序(如GDB),因此它不适用于本地应用程序。



如果您使用远程调试(使用RS-232或TCP / IP连接调试另一台计算机或虚拟机):用于远程调试不指定读取GDTR的数据包。



在远程调试情况下,后端(调试计算机上的一段代码)可能会使用监视命令。您可以使用像monitor readspr gdtr这样的命令来实现这样的功能。


I want to use gdb to see my GDTR/LDTR/TTR and segment register

invisiable part(x86) so in gdb I enter "p/x $gdtr"....etc but the result is "$6 = Value can't be converted to integer" and in gdb I enter "p/x $cs" the only result is the CS, just visiable part

can anyone tell me how to view these value??

thanks for your answer

解决方案

If GDB had such a function then this function would only work if GDB was able to read the GDTR using the SGDT instruction. This would mean that GDB had to run in ring 0.

Neither Linux nor Windows nor Mac OS allows running applications (like GDB) in ring 0 so it will not work for local applications.

If you use remote debugging (you debug another computer or a virtual machine using an RS-232 or TCP/IP connection): The default protocol used for remote debugging does not specify packets for reading the GDTR.

In the case of remote debugging the backend (piece of code on the debugged computer) may define non-standard features using the "monitor" command. You would be able to implement such a feature using a command like "monitor readspr gdtr".

这篇关于我可以在gdb下打印gdtr和gdt描述符吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆