Re: [PATCH,RFC] Make libbacktrace more standalone

2013-05-21 Thread Ian Lance Taylor
On Tue, May 21, 2013 at 9:52 AM, Alexander Monakov wrote: > > 1. The documentation does not say whether reusing "state" objects is allowed. > For instance, I'm using backtrace_simple, and then in the callback I'm > invoking dladdr and backtrace_pcinfo to gather file-line info if available. > Looks

Re: [PATCH,RFC] Make libbacktrace more standalone

2013-05-21 Thread Alexander Monakov
On Mon, 20 May 2013, Ian Lance Taylor wrote: > To be clear: are you withdrawing your earlier patch? Yes; at this point I don't think it improves anything sufficiently to spend more time on it. Forgive me a digression, but having now actually used libbacktrace, I have the following questions. 1.

Re: [PATCH,RFC] Make libbacktrace more standalone

2013-05-20 Thread Ian Lance Taylor
On Mon, May 20, 2013 at 10:07 AM, Alexander Monakov wrote: > I now realize that a less intrusive approach is available: just provide > replacement filenames.h, dwarf2.h in a separate directory and pick up those > headers for a standalone build. In replacement dwarf2.h, include system > dwarf.h, #

Re: [PATCH,RFC] Make libbacktrace more standalone

2013-05-20 Thread Alexander Monakov
I now realize that a less intrusive approach is available: just provide replacement filenames.h, dwarf2.h in a separate directory and pick up those headers for a standalone build. In replacement dwarf2.h, include system dwarf.h, #define potentially missing enum values and provide dummy enum tags.

Re: [PATCH,RFC] Make libbacktrace more standalone

2013-05-14 Thread Alexander Monakov
> > In the case where IN_GCC is defined, where are the types > > dwarf_attribute, dwarf_form, and dwarf_tag defined? > > In GCC's own dwarf2.h as enum tags; dwarf.h uses anonymous enums. Ah, I still should have typedef'ed those types to enum tags when IN_GCC. I've verified the following patch bo

Re: [PATCH,RFC] Make libbacktrace more standalone

2013-05-13 Thread Alexander Monakov
On Tue, May 14, 2013 at 12:45 AM, Tom Tromey wrote: >> "Alexander" == Alexander Monakov writes: > > Alexander> In GCC's own dwarf2.h as enum tags; dwarf.h uses anonymous enums. > > I'm curious to know which dwarf2.h you are testing against and/or intend > to support. I think there is more th

Re: [PATCH,RFC] Make libbacktrace more standalone

2013-05-13 Thread Tom Tromey
> "Alexander" == Alexander Monakov writes: Alexander> In GCC's own dwarf2.h as enum tags; dwarf.h uses anonymous enums. I'm curious to know which dwarf2.h you are testing against and/or intend to support. I think there is more than one. Tom

Re: [PATCH,RFC] Make libbacktrace more standalone

2013-05-13 Thread Alexander Monakov
On Wed, 8 May 2013, Ian Lance Taylor wrote: > > +#ifdef IN_GCC > > Where is IN_GCC defined? I've amended configure.ac to provide a new configuration flag ('--enable-standalone') and add -DIN_GCC to EXTRA_FLAGS unless that flag is given. Previously I've misread grep output and thought that IN_GCC

Re: [PATCH,RFC] Make libbacktrace more standalone

2013-05-08 Thread Ian Lance Taylor
On Wed, May 8, 2013 at 2:35 PM, Ondřej Bílka wrote: > > Is it possible to link staticaly without external dependencies? This > simplifies generating backtrace when inside linker. I'm not sure I understand the question. Is it possible to link libbacktrace statically? Sure. That is what happens

Re: [PATCH,RFC] Make libbacktrace more standalone

2013-05-08 Thread Ondřej Bílka
On Wed, May 08, 2013 at 07:56:18PM +0400, Alexander Monakov wrote: > Hello, > > I'd like to make libbacktrace easier to import for use in other software. > Right now it's mostly standalone, but depends on rest of GCC in the following: > > 1. Build system. > 2. Trivially depends on "filenames.h".

Re: [PATCH,RFC] Make libbacktrace more standalone

2013-05-08 Thread Ian Lance Taylor
On Wed, May 8, 2013 at 8:56 AM, Alexander Monakov wrote: > > I'd like to make libbacktrace easier to import for use in other software. > Comments? > +#ifdef IN_GCC Where is IN_GCC defined? > +# Test if DWARF2 extensions enumeration values are declared > +if test -n "${with_target_subdir}"; th