Re: [kvm-unit-tests 4/5] lib: dump stack on abort()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



subject should be "[kvm-unit-tests 4/5] lib: dump stack on failed assert()"

On Tue, Mar 1, 2016 at 1:27 PM, Peter Feiner <pfeiner@xxxxxxxxxx> wrote:
> Signed-off-by: Peter Feiner <pfeiner@xxxxxxxxxx>
> ---
>  lib/libcflat.h | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lib/libcflat.h b/lib/libcflat.h
> index 42c94df..1798716 100644
> --- a/lib/libcflat.h
> +++ b/lib/libcflat.h
> @@ -77,10 +77,12 @@ void dump_current_stack(void);
>
>  #define assert(cond)                                                   \
>  do {                                                                   \
> -       if (!(cond))                                                    \
> +       if (!(cond)) {                                                  \
>                 printf("%s:%d: assert failed: %s\n",                    \
> -                      __FILE__, __LINE__, #cond),                      \
> +                      __FILE__, __LINE__, #cond);                      \
> +               dump_current_stack();                                   \
>                 abort();                                                \
> +       }                                                               \
>  } while (0)
>
>  #endif
> --
> 2.7.0.rc3.207.g0ac5344
>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux