假设我有以下内容:
c: .float 3.14
movss c(%rip), %xmm0
如何以可读的方式检查该寄存器?例如,我可以获得整个调试输出,但不仅仅是一个友好的数字:
>>> p/f $xmm0
$2 = {
v4_float = {[0] = 3.1400001, [1.40129846e-45] = 0, [2.80259693e-45] = 0, [4.20389539e-45] = 0},
v2_double = {[0] = 5.3286132608536752e-315, [1.40129846e-45] = 0},
v16_int8 = {[0] = -61, [1.40129846e-45] = -11, [2.80259693e-45] = 72, [4.20389539e-45] = 64, [5.60519386e-45] = 0 <repeats 12 times>},
v8_int16 = {[0] = -2621, [1.40129846e-45] = 16456, [2.80259693e-45] = 0, [4.20389539e-45] = 0, [5.60519386e-45] = 0, [7.00649232e-45] = 0, [8.40779079e-45] = 0, [9.80908925e-45] = 0},
v4_int32 = {[0] = 3.1400001, [1.40129846e-45] = 0, [2.80259693e-45] = 0, [4.20389539e-45] = 0},
v2_int64 = {[0] = 5.3286132608536752e-315, [1.40129846e-45] = 0},
uint128 = 3.93143274128552720884e-4942
}
在没有所有其他输出行的情况下,我如何获得值3.14
?
希望我能从检查变量本身中得到一些类似的东西:
>>> x/f &c
0x6000df: 3.1400001
您可以使用点符号来打印特定项目。例如,要打印float
和double
值:
>>> p $xmm0.v4_float[0]
$4 = 3.1400001
>>> p $xmm0.v2_double[0]
$5 = 5.3286132608536752e-315
显然,double
在这里是没有意义的,但用来表明v4_float
、v2_double
、v16_int8
、。。。应该起作用。