如何在gdb中使用逻辑地址? [英] How to use a logical address in gdb?
问题描述
(gdb)x / 1wx 0x080483e4
0x80483e4< main> ;: 0x83e58955
(gdb)
但你如何指定一个逻辑地址?我来到以下指令:
0x0804841a< + 6>:mov%gs:0x14,%eax
如何在gdb的%gs:0x14处读取内存,或将此逻辑地址转换为线性地址我可以在 x
命令中使用吗?
注意:我知道我可以在此指令后简单读取%eax ,但这不是我关心的问题。 gdb中的0x14
您不能:GDB无法知道%gs
指已设置。
或将此逻辑地址转换为线性地址,即i可以在x命令中使用
同样,你不能一般这样做。但是,您似乎在32位x86 Linux上,并且可以 set_thread_area
系统调用。
您可以执行 gdb provides functionality to read or write to a specific linear address, for example: but how do you specify a logical address ? I came accross the following instruction: how can i read the memory at "%gs:0x14" in gdb, or translate this logical address to a linear address that i could use in note: i know that i could simply read %eax after this instruction, but that is not my concern how can i read the memory at "%gs:0x14" in gdb You can't: there is no way for GDB to know how the segment to which or translate this logical address to a linear address that i could use in x command Again, you can't do this in general. However, you appear to be on 32-bit x86 Linux, and there you can do that -- the You can do 这篇关于如何在gdb中使用逻辑地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! catch syscall set_thread_area
在GDB中,并检查参数(每个线程将有一个这样的调用)。实际执行的代码是这里。一旦你知道如何设置
%gs
,只需将0x14加入 base_addr
中即可。 / p> (gdb) x/1wx 0x080483e4
0x80483e4 <main>: 0x83e58955
(gdb)
0x0804841a <+6>: mov %gs:0x14,%eax
x
command ?
%gs
refers to has been set up.
%gs
is set up to point to the thread descriptor via set_thread_area
system call.catch syscall set_thread_area
in GDB, and examine the parameters (each thread will have one such call). The code to actually do that is here. Once you know how %gs
has been set up, just add 0x14 to the base_addr
, and you are done.