Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Aug 2018 12:40:05 +0000
From:      Andrew Duane <aduane@juniper.net>
To:        Pratyush Yadav <pratyush@freebsd.org>, "khanzf@gmail.com" <khanzf@gmail.com>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   RE: addr2line with FreeBSD kernel failing
Message-ID:  <BN6PR05MB347567C102E52EC43FEF1D0DCE200@BN6PR05MB3475.namprd05.prod.outlook.com>
In-Reply-To: <CA%2BX=3TKuA_PMfrTKT159Xp=ngCNAY%2ByCKXb=9GzTD%2BVdk%2BStgg@mail.gmail.com>
References:  <CAFd4kYCAwKKNNsZJ49aa4YUT3fQ-PqS1Dymc27LO_hXXqbedfA@mail.gmail.com> <CA%2BX=3TKuA_PMfrTKT159Xp=ngCNAY%2ByCKXb=9GzTD%2BVdk%2BStgg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
addr2line is only for functions, though the manual page could do a more exp=
licit job of saying that....

....................................
Andrew L. Duane - Principal Resident Engineer
AT&T Advanced Services Technical Lead
Juniper Quality Ambassador
m=A0=A0=A0+1 603.770.7088
o    +1 408.933.6944 (2-6944)
skype: andrewlduane
aduane@juniper.net

-----Original Message-----
From: owner-freebsd-hackers@freebsd.org <owner-freebsd-hackers@freebsd.org>=
 On Behalf Of Pratyush Yadav
Sent: Monday, August 6, 2018 4:33 AM
To: khanzf@gmail.com
Cc: freebsd-hackers@freebsd.org
Subject: Re: addr2line with FreeBSD kernel failing

On Mon, Aug 6, 2018 at 7:04 AM Farhan Khan <khanzf@gmail.com> wrote:
>
> Hi all,
>
> Is there a way to go from a memory address to a kernel symbol?
>
> I am working with a subsystem that uses a lot of function pointers,=20
> and I am not certain which particular function is being called. I have
> dtrace(1) printing out the memory address of the function, like this:
>
> printf("Runs vap->iv_newstate: 0x%p", vap->iv_newstate);
>
> The resulting memory address will be 0xffffffff834fa6d0. I was told I=20
> can use addr2line(1), but it seems to fail, as follows:
>
> # addr2line -e /usr/obj/usr/src/amd64.amd64/sys/GENERIC/kernel.full
> ffffffff834fa6d0
> ??:0
>
> Am I doing something wrong? Also, if I can do this directly in=20
> dtrace(1), that would be much much better. This is definitely the=20
> installed kernel, so there is no kernel mismatch. I have also tried=20
> using kernel.debug and kernel, same result.

I usually do:

addr2line -e /usr/lib/debug/boot/kernel/kernel.debug <address>

Try that, maybe it will work for you.


PS: I'm not sure addr2line would work for runtime pointers. I use it to tra=
nslate the instruction pointer addresses to lines.

--
Regards,
Pratyush Yadav
_______________________________________________
freebsd-hackers@freebsd.org mailing list https://urldefense.proofpoint.com/=
v2/url?u=3Dhttps-3A__lists.freebsd.org_mailman_listinfo_freebsd-2Dhackers&d=
=3DDwICAg&c=3DHAkYuh63rsuhr6Scbfh0UjBXeMK-ndb3voDTXcWzoCI&r=3DwLJwfiB7xHha-=
-tSRcWA32FYxcFX_lWIGi9GfFIoeMU&m=3DSbDSmhLSCCkuf6AV9WJwhdV7kvwBzHhPpHbDdo-g=
mvg&s=3DczXR1n_2hmwkrSdY5pwfPJqoKjz48iQJJIhQaeFe-zQ&e=3D
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BN6PR05MB347567C102E52EC43FEF1D0DCE200>