This is the mail archive of the
mailing list for the binutils project.
Re: preprocessor macro to identify binutils version?
- From: Burlen Loring <bloring at lbl dot gov>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: Andrew Pinski <pinskia at gmail dot com>, binutils <binutils at sourceware dot org>
- Date: Fri, 02 Aug 2013 14:24:19 -0700
- Subject: Re: preprocessor macro to identify binutils version?
- References: <51FBFF22 dot 6050107 at lbl dot gov> <CA+=Sn1=T5pOiTqwYSj1Y251b=hMCrXRojF=ONxQUgmObcG4w1g at mail dot gmail dot com> <CAKOQZ8w_tD+_eY3hDUi5S65reApWubuxfsBRSVaTOhArXe8-kA at mail dot gmail dot com>
On 08/02/2013 01:27 PM, Ian Lance Taylor wrote:
Got it. I'm abandoning the libbfd based code. I'm glad I didn't try to
push it into our code base!
On Fri, Aug 2, 2013 at 11:46 AM, Andrew Pinski <firstname.lastname@example.org> wrote:
On Fri, Aug 2, 2013 at 11:49 AM, Burlen Loring <email@example.com> wrote:
This is my first binutils foray. I'm making use of libbfd to provide
detailed stack trace in an app if it crashes. In testing I've found
systems[*] with older binutils where bfd_find_nearest_line segv's. I'd like
to configure my app to disable the stack trace feature on systems with the
older binutils. Is there a preprocessor macro that can be used to idnetify
the binutils release? if not what's the best way to determine the binutils
Won't it be better to use libdwarf and not use bfd?
BFD is not designed to be used outside of binutils/gdb. Any use
outside of it I consider it a bug.
Another option, specifically designed for getting a stack trace in a
running program, is to use libbacktrace. It can be found in the gcc
repository. It only works for DWARF, though, which means that it
probably won't work on Windows unless you only compile with GCC.
I agree with Andrew that libbfd is unfortunately best avoided.
Thanks for the ideas and feedback