Thank you Ed! You're a swell guy, as they say in the 50's.

I will reply to you next week, when I get a chance to actually perform
these steps.

--Sam

On Mon, May 16, 2016 at 12:25 PM, Ed Maste <ema...@freebsd.org> wrote:
> On 15 May 2016 at 22:05, Sam Habiel <sam.hab...@gmail.com> wrote:
>>
>> Having said that though, I don't have enough experience in FreeBSD to
>> be able to answer all your questions; and I never had to use gdb to
>> debug a linked library before. Let me answer and ask in turns:
>
> Sorry about that - I wasn't sure how much or little detail to provide.
> I'm happy to work through the details with you.
>
>> 1. I downloaded FreeBSD 10.3 and libelf came with the system without
>> me installing anything. I presume then it's in the FreeBSD source tree
>> since I didn't install that one from the ports tree, correct?
>
> That's correct.
>
> jkoshy@ and others developed the BSD-licensed libelf in FreeBSD
> starting in the mid-2000s, and it's still that version that's in
> FreeBSD 10.
>
> libelf and other tools moved from FreeBSD to the ELF Tool Chain
> project  out to ELF Tool Chain later on, and were reimported into
> FreeBSD for FreeBSD 11.
>
>> 2. Where is the upstream version? And how can I compile it to replace
>> the ones that my makefile grabs? (I think I can figure this one out,
>> but a hint will help).
>
> You can get it here:
> svn checkout svn://svn.code.sf.net/p/elftoolchain/code/trunk elftoolchain-code
> A top level 'make' will build libelf, libdwarf, and ELF Tool Chain
> versions of strip, nm, size, etc.
>
> Adding -L (and -I) options to CFLAGS when building your software
> should be sufficient to pick it up. You mentioned that it works with a
> libelf from ports, and the same scheme used to build against that one
> should work for your own elftoolchain build.
>
>> 3. How do use gdb to step into such a library? Would just typing "s"
>> take you into the code if everything else is in place?
>
> Yes. You can build the library with -g, and -O0 to make debugging work
> better. E.g., with flags for 2. and 3.:
> CFLAGS="-g -O0 -L/example/src/elftoolchain/libelf
> -I/example/src/elftoolchain/libelf" make
>
> You can set a breakpoint on elf_update, and then step through to find
> out where the error is returned.



-- 
Sam Habiel, Pharm.D.
VISTA Expertise Network

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Elftoolchain-developers mailing list
Elftoolchain-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/elftoolchain-developers

Reply via email to