如何print/examine浮点寄存器?

How to print/examine floating point registers?

假设我有以下内容:

c: .float 3.14
movss c(%rip), %xmm0

如何以可读的方式检查该寄存器?例如,我可以获得整个调试输出,而不仅仅是一个友好的数字:

>>> p/f $xmm0
 = {
  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

您可以使用dot-notation打印特定项目。例如,要打印 floatdouble 值:

>>> p $xmm0.v4_float[0]
 = 3.1400001
>>> p $xmm0.v2_double[0]
 = 5.3286132608536752e-315

显然 double 在这里没有意义,但用来表明 v4_floatv2_doublev16_int8、...中的任何一个都应该有效。