如何使GDB识别双向代码? [英] How to make GDB recognize bi-endian code?

查看:264
本文介绍了如何使GDB识别双向代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试调试使用Intel Bi-Endian编译器编译的代码时,我无法查看数据。
这似乎是我的数据被标记为大端字节。

When trying to debug code that was compiled with Intel Bi-Endian compiler, I am having trouble viewing data. This seems like my data was marked as big-endian.

我要查看的数据是 __ be_x ,其中 x int

The data I am trying to view is with __be_x, where x is an int.

尝试打印 x 当它的值是1时,我得到了这个值,可能是因为这个值被插入为小端而不是大端:

Trying to print x when its value is one, I get this value, probably because this value is being interpeted as little endian instead of big:

(gdb) p __be_x
$4 = 16777216
(gdb) x /4b
0xf850aa0 <__be_x>:    0x00    0x00    0x00    0x01

因此,被解释为big-endian的值是1。

So the value, interpreted as big-endian, is 1.

我认为GDB为此提供了某种补丁,但是我似乎找不到它。
您知道如何使GDB识别数据吗?

I think GDB has some kind of patch for this, but I can't seem to find it. Do you know how to make GDB recognize the data?

推荐答案

我不知道此功能-我认为,如果您可以在同一程序中同时使用大尾数类型和小尾数类型,则将需要DWARF扩展-但您可以尝试设置尾数。

I don't know of a feature for this -- I think it would require DWARF extensions if you can use both big- and little-endian types in the same program -- but you might try "set endian".

您可能还喜欢 apropos命令,该命令搜索gdb的帮助文本。您可以使用 apropos endian轻松找到上述命令。

You might also like the "apropos" command, which searches gdb's help text. You can find the above command quite easily with "apropos endian".

这篇关于如何使GDB识别双向代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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