Linux 汇编程序在GDB中找不到调试符号
所以我第一次尝试组装。我有一个演示程序,它只是设置一些值,然后在内存位置和寄存器之间移动它们。 简单 问题是,当我试图在Linux 汇编程序在GDB中找不到调试符号,linux,assembly,gdb,Linux,Assembly,Gdb,所以我第一次尝试组装。我有一个演示程序,它只是设置一些值,然后在内存位置和寄存器之间移动它们。 简单 问题是,当我试图在gdb中分析程序时,我得到以下错误: 正在从数据类型读取符号。。。(未找到调试符号)。。。完成 GDB配置为i686 linux gnu,并在承载Windows 10的VMWare实例中的Kali linux上运行。 uname-a:Linux-Kali 4.17.0-kali1-686-pae#1 SMP-Debian 4.17.8-1kali1(2018-07-04)i68
gdb
中分析程序时,我得到以下错误:
正在从数据类型读取符号。。。(未找到调试符号)。。。完成
GDB配置为i686 linux gnu
,并在承载Windows 10的VMWare实例中的Kali linux上运行。
uname-a:Linux-Kali 4.17.0-kali1-686-pae#1 SMP-Debian 4.17.8-1kali1(2018-07-04)i686 GNU-Linux
我的代码
# Demo program to show how to use Data types and MOVx instructions
.data
HelloWorld:
.ascii "Hello World!"
ByteLocation:
.byte 10
Int32:
.int 2
Int16:
.short 3
Float:
.float 10.23
IntegerArray:
.int 10,20,30,40,50
.bss
.comm LargeBuffer, 10000
.text
.globl _start
_start:
nop
# 1. MOV immediate value into register
movl $10, %eax
# 2. MOV immediate value into memory location
movw $50, Int16
# 3. MOV data between registers
movl %eax, %ebx
# 4. MOV data from memory to register
movl Int32, %eax
# 5. MOV data from register to memory
movb $3, %al
movb %al, ByteLocation
# 6. MOV data into an indexed memory location
# Location is decided by BaseAddress(Offset, Index, DataSize)
# Offset and Index must be registers, Datasize can be a numerical value
movl $0, %ecx
movl $2, %edi
movl $22, IntegerArray(%ecx,%edi , 4)
# 7. Indirect addressing using registers
movl $Int32, %eax
movl (%eax), %ebx
movl $9, (%eax)
# Exit syscall to exit the program
movl $1, %eax
movl $0, %ebx
int $0x80
因此,根据
我使用-g
标志以as
重新运行编译
as-g-o数据类型.o数据类型.s
联系
ld-o数据类型DataTypes.o
冉GDB
gdb./DataTypes
这本身不是一个错误,gdb仍然可以工作。但是,如果使用调试信息(线和符号)进行组装,确实会更方便。您没有显示您使用的命令,但例如,as-g
或gcc-g-nostdlib
可以工作。@Jester-g
标记对其进行排序。谢谢