16

I can dump the all the integer registers in gdb with just:

info registers

for the xmm registers (intel) I need a file like:

print $xmm0
print $xmm1
...
print $xmm15

and then source that file. Is there an easier way?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Peeter Joot
  • 7,848
  • 7
  • 48
  • 82
  • Semi-related: MMX registers work less easily in GDB, because they alias with the x87 stack regs: [why does GDB not tab-complete mmx register name(mm0-mm7)](https://stackoverflow.com/q/68109381) – Peter Cordes Jan 01 '23 at 08:42

3 Answers3

13
(gdb) apropos registers
collect -- Specify one or more data items to be collected at a tracepoint
core-file -- Use FILE as core dump for examining memory and registers
info all-registers -- List of all registers and their contents
...

The last one is the one you want.

See also this answer below.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
  • I'd tried apropos xmm, but didn't think of registers. Thanks. – Peeter Joot Mar 30 '12 at 20:22
  • 1
    Is there a way to dump just MMX registers? `info mmx` and `info mmx-registers` did not work for me. I guess I ask, is it all or nothing? Otherwise, that pager stops my workflow. – jww Sep 22 '15 at 10:35
  • @jww: `info reg vec` dumps the full-width registers, which could be cluttered if they're ZMM or YMM but you're only working on code that uses the XMM low 128-bits. – Peter Cordes Sep 24 '21 at 12:55
8

The fine manual says:

(gdb) info all-registers
Nikolai Fetissov
  • 82,306
  • 11
  • 110
  • 171
7

If you want to print out only the xmm registers then you can use info registers sse (or the abbreviation i r sse or even i r s).

Similarly to print out only the fpu registers you can use info registers float (or i r f).

(In the above commands, sse and float are register groups, which you can list using maintenance print reggroups.)

Ben C
  • 658
  • 6
  • 18