|
From: Leung Ngai-H. Z. <leu...@co...> - 2006-03-03 05:33:49
|
Hi,
I instrumented each basic block such that I call this function whenever I
encounter a load instruction:
static VG_REGPARM(1) void trace_load(Addr addr)
{
VG_(printf)("r %p %d\n", addr, VG_(seginfo_sect_kind)(addr));
}
It gives me the output I want, mostly. I can't understand though why I
get output like the following:
r 0x45BE31 1
r 0x45F248 0
r 0x8048114 1
If my understanding is correct, 1 means it's the text region. 0 should
mean that it's either the stack or the heap. The first instruction looks
like the text region, the second looks like the heap, but the third one
doesn't at all look like the text region though it's labelled as such.
Any idea what happened?
Zac
|
|
From: Tom H. <to...@co...> - 2006-03-03 08:31:41
|
In message <Pin...@sf...>
Leung Ngai-Hang Zachary <leu...@co...> wrote:
> I instrumented each basic block such that I call this function whenever I
> encounter a load instruction:
>
> static VG_REGPARM(1) void trace_load(Addr addr)
> {
> VG_(printf)("r %p %d\n", addr, VG_(seginfo_sect_kind)(addr));
> }
>
> It gives me the output I want, mostly. I can't understand though why I
> get output like the following:
>
> r 0x45BE31 1
> r 0x45F248 0
> r 0x8048114 1
>
> If my understanding is correct, 1 means it's the text region. 0 should
> mean that it's either the stack or the heap. The first instruction looks
> like the text region, the second looks like the heap, but the third one
> doesn't at all look like the text region though it's labelled as such.
> Any idea what happened?
Why doesn't it look like the text region? That looks like exactly the
sort of address that a 32 bit program loads at on x86 to me.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Julian S. <js...@ac...> - 2006-03-03 11:48:22
|
> > r 0x45BE31 1 > > r 0x45F248 0 > > r 0x8048114 1 > > > > If my understanding is correct, 1 means it's the text region. 0 should > > mean that it's either the stack or the heap. The first instruction looks > > like the text region, the second looks like the heap, but the third one > > doesn't at all look like the text region though it's labelled as such. > > Any idea what happened? > > Why doesn't it look like the text region? That looks like exactly the > sort of address that a 32 bit program loads at on x86 to me. Indeed, 0x8048xxx is the classic text region on x86-linux. Try running with -d -d. This will show the memory layout at client startup, which might make more sense of it. I'd guess 0x45xxxx is your ld.so and 0x8048xxx is the executable. J |
|
From: Leung Ngai-H. Z. <leu...@co...> - 2006-03-04 01:18:17
|
On Fri, 3 Mar 2006, Julian Seward wrote: > > > > r 0x45BE31 1 > > > r 0x45F248 0 > > Why doesn't it look like the text region? That looks like exactly the > > sort of address that a 32 bit program loads at on x86 to me. > > Indeed, 0x8048xxx is the classic text region on x86-linux. > > Try running with -d -d. This will show the memory layout at > client startup, which might make more sense of it. I'd guess > 0x45xxxx is your ld.so and 0x8048xxx is the executable. Oh, I understand now. I was confused because there are two text regions: ld.so and the executable. Thanks for your help! Zac |