不同的GDB寄存器名称 [英] Different gdb registers names

查看:209
本文介绍了不同的GDB寄存器名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在学汇编,这是我的问题。

I'm learning Assembler and this is my problem.

当我使用gdb的我看到寄存器具有以下名称:

When i use gdb i see the registers with the following names:

 Dump of assembler code for function return_input:
 0x000000000040053d <+0>:   push   %rbp
 0x000000000040053e <+1>:   mov    %rsp,%rbp
 0x0000000000400541 <+4>:   sub    $0x20,%rsp
 0x0000000000400545 <+8>:   lea    -0x20(%rbp),%rax
 0x0000000000400549 <+12>:  mov    %rax,%rdi
 0x000000000040054c <+15>:  callq  0x400440 <gets@plt>
 0x0000000000400551 <+20>:  lea    -0x20(%rbp),%rax
 0x0000000000400555 <+24>:  mov    %rax,%rdi
 0x0000000000400558 <+27>:  callq  0x400410 <puts@plt>
 0x000000000040055d <+32>:  leaveq 
 0x000000000040055e <+33>:  retq   
 End of assembler dump.

不过,我想看看他们这些名称:

But i wanna see them with those names:

(gdb) disas return_input
Dump of assembler code for function return_input:
0x080483c4 <return_input+0>:    push   %ebp
0x080483c5 <return_input+1>:    mov    %esp,%ebp
0x080483c7 <return_input+3>:    sub    $0x28,%esp
0x080483ca <return_input+6>:    lea    0xffffffe0(%ebp),%eax
0x080483cd <return_input+9>:    mov    %eax,(%esp)
0x080483d0 <return_input+12>:   call   0x80482c4 <_init+40>
0x080483d5 <return_input+17>:   lea    0xffffffe0(%ebp),%eax
0x080483d8 <return_input+20>:   mov    %eax,0x4(%esp)
0x080483dc <return_input+24>:   movl   $0x8048514,(%esp)
0x080483e3 <return_input+31>:   call   0x80482e4 <_init+72>
0x080483e8 <return_input+36>:   leave
0x080483e9 <return_input+37>:   ret
End of assembler dump.

我使用Arch Linux的采用Intel处理器。

I'm using Arch Linux with an Intel processor.

上的名字真是天壤之别让我更加努力的工作。
感谢您的时间。

The difference on the names is really making me harder the work. Thank you for your time.

推荐答案

名称依赖于架构和处理器的位大小(32位或64位)结果寄存器
为您编译您的code和运行。只要你想,你不能改变寄存器名称。

Register names are depending on the architecture and processor bit size(32 or 64 bit)
for which you compiled your code and running. You can't change register names as you want.

这篇关于不同的GDB寄存器名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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