What I am doing: I am writing a program in C that makes extern calls to assembly programs. I use SSE instructions and initially want to use only xmm registers. In order to effectively debug the program I have to keep an eye on the floating point calculations, and I am facing problems doing that in gdb.
What is my setup: after setting the breakpoints for assembly calls in gdb I run the program. In gdb I start tui and set the layout as follows:
layout regs
focus regs
tui reg all
This allows me to track all the registers and the assembly code.
What are my problems:
The information about the ymm registers is cut at the end of the screen:
I am not able to view the whole information. I have searched through the documentation and I have not found any instruction that tells gdb to wrap lines in the register group windows after a certain amount of characters. Is there a way to force the line breaking?
In this certain program I pass a float
value -0.2
into the assembly function. According to the calling conventions this value should be stored in xmm0. With p $xmm0
and p $ymm0
I can look at these registers in the command line:
At this point I am expecting to see -0.2
in the lowest part of the xmm0 register, but this is actually printed as if it were in the highest part of the register. Why does it happen?
As you can see in these both pictures, the register window shows me that my ymm0 register is empty, but printing it with p $ymm0
reveals that it has -0.200000003
in one of its part. Why these displayed values are different?
Result: I cannot debug the floating point calculations. Would you have any suggestions about how to configure the gdb for tracking these calculations?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…