[Spice-devel] [PATCH v2] common: add backtrace via gstack or glibc backtrace

Alon Levy alevy at redhat.com
Mon Jul 18 09:28:07 PDT 2011


On Mon, Jul 18, 2011 at 06:21:43PM +0200, Christophe Fergeau wrote:
> On Mon, Jul 18, 2011 at 06:42:14PM +0300, Alon Levy wrote:
> > diff --git a/common/spice_common.h b/common/spice_common.h
> > index bc74486..6c5154c 100644
> > --- a/common/spice_common.h
> > +++ b/common/spice_common.h
> > @@ -22,9 +22,11 @@
> >  #include <stdint.h>
> >  #include <time.h>
> >  #include <stdlib.h>
> > +#include "backtrace.h"
> >  
> >  #define ASSERT(x) if (!(x)) {                               \
> >      printf("%s: ASSERT %s failed\n", __FUNCTION__, #x);     \
> > +    spice_backtrace();                                      \
> >      abort();                                                \
> >  }
> 
> Given that it's the only change in existing code, and that it's only
> trigger right before an abort(), no need to go over this series for days
> and days imo ;) What happens on Windows though? Shouldn't we have an empty
> stub for spice_backtrace() there?

I think it would work as is because both the define won't be there and the
access call will fail. And if you build with mingw then maybe backtrace is
there (should be I guess).

> 
> Christophe




More information about the Spice-devel mailing list