mbox series

[00/10] Unwinder interface consolidation

Message ID cover.1613577607.git.fweimer@redhat.com
Headers show
Series Unwinder interface consolidation | expand

Message

Florian Weimer Feb. 17, 2021, 4:02 p.m. UTC
This series is basically a repost.  I had to tweak it somewhat to pick
up the <unwind-arch.h> customization for MIPS.  I switched to reusing
that header for all customization.

This is a prequiste for consolidating and libc and nptl implementations
of unwinding, and moving the cancellation implementation into libc.

Thanks,
Florian

Florian Weimer (10):
  Implement <unwind-link.h> for dynamically loading the libgcc_s
    unwinder
  backtrace: Implement on top of <unwind-link.h>
  arm: Implement backtrace on top of <unwind-link.h>
  i386: Implement backtrace on top of <unwind-link.h>
  m68k: Implement backtrace on top of <unwind-link.h>
  sparc: Implement backtrace on top <unwind-link.h>
  __frame_state_for: Use <unwind-link.h> for unwinder access
  Move sysdeps/gnu/unwind-resume.c to sysdeps/generic/unwind-resume.c
  Implement _Unwind_Resume in libc on top of <unwind-link.h>
  nptl: Use <unwind-link.h> for accessing the libgcc_s unwinder

 debug/backtrace.c                             |  86 +++--------
 malloc/set-freeres.c                          |   5 +
 misc/Makefile                                 |   2 +-
 misc/Versions                                 |   1 +
 misc/unwind-link.c                            | 145 ++++++++++++++++++
 nptl/nptlfreeres.c                            |   1 -
 nptl/pthreadP.h                               |   6 +-
 nptl/pthread_cancel.c                         |   3 +-
 sysdeps/alpha/unwind-arch.h                   |  28 ++++
 sysdeps/arm/arm-unwind-resume.S               |  26 ++--
 sysdeps/arm/backtrace.c                       |  77 +++-------
 sysdeps/arm/nptl/unwind-forcedunwind.c        |  25 +++
 sysdeps/arm/pt-arm-unwind-resume.S            |  22 ++-
 sysdeps/arm/unwind-arch.h                     |  39 +++++
 sysdeps/arm/unwind-resume.c                   |  25 +++
 sysdeps/generic/framestate.c                  |  21 +--
 sysdeps/generic/unwind-arch.h                 |  27 ++--
 sysdeps/generic/unwind-link.h                 | 106 +++++++++++++
 sysdeps/generic/unwind-resume.c               |  46 ++++++
 sysdeps/gnu/unwind-resume.c                   |  83 ----------
 sysdeps/i386/backtrace.c                      |  82 +++-------
 sysdeps/i386/unwind-arch.h                    |  39 +++++
 sysdeps/ia64/unwind-arch.h                    |  32 ++++
 sysdeps/m68k/backtrace.c                      |  82 +++-------
 sysdeps/m68k/m680x0/unwind-arch.h             |  26 ++++
 sysdeps/m68k/unwind-arch.h                    |  35 +++++
 sysdeps/mach/hurd/fork.c                      |   3 +
 .../{unix/sysv/linux => }/mips/unwind-arch.h  |  17 +-
 sysdeps/nptl/fork.c                           |   3 +
 sysdeps/nptl/unwind-forcedunwind.c            | 115 ++------------
 sysdeps/powerpc/powerpc32/unwind-arch.h       |  28 ++++
 sysdeps/s390/unwind-arch.h                    |  28 ++++
 sysdeps/sh/unwind-arch.h                      |  28 ++++
 sysdeps/sparc/backtrace.c                     |  66 ++------
 sysdeps/sparc/unwind-arch.h                   |  28 ++++
 .../sysv/linux/ia64/unwind-forcedunwind.c     |  16 +-
 36 files changed, 852 insertions(+), 550 deletions(-)
 create mode 100644 misc/unwind-link.c
 create mode 100644 sysdeps/alpha/unwind-arch.h
 create mode 100644 sysdeps/arm/nptl/unwind-forcedunwind.c
 create mode 100644 sysdeps/arm/unwind-arch.h
 create mode 100644 sysdeps/arm/unwind-resume.c
 create mode 100644 sysdeps/generic/unwind-link.h
 create mode 100644 sysdeps/generic/unwind-resume.c
 delete mode 100644 sysdeps/gnu/unwind-resume.c
 create mode 100644 sysdeps/i386/unwind-arch.h
 create mode 100644 sysdeps/ia64/unwind-arch.h
 create mode 100644 sysdeps/m68k/m680x0/unwind-arch.h
 create mode 100644 sysdeps/m68k/unwind-arch.h
 rename sysdeps/{unix/sysv/linux => }/mips/unwind-arch.h (85%)
 create mode 100644 sysdeps/powerpc/powerpc32/unwind-arch.h
 create mode 100644 sysdeps/s390/unwind-arch.h
 create mode 100644 sysdeps/sh/unwind-arch.h
 create mode 100644 sysdeps/sparc/unwind-arch.h

Comments

Carlos O'Donell March 1, 2021, 1:54 p.m. UTC | #1
On 2/17/21 11:02 AM, Florian Weimer via Libc-alpha wrote:
> This series is basically a repost.  I had to tweak it somewhat to pick
> up the <unwind-arch.h> customization for MIPS.  I switched to reusing
> that header for all customization.
> 
> This is a prequiste for consolidating and libc and nptl implementations
> of unwinding, and moving the cancellation implementation into libc.

This is a great idea. It has been a long standing problem that we have
two distinct copies of unwinding for backtrace and cancellation and
that they are not harmonized to avoid duplication or mistakes.

Thank you for tackling this cleanup.

The series as a whole looks good to me.

Reviewed-by: Carlos <carlos@redhat.com>
 
> Thanks,
> Florian
> 
> Florian Weimer (10):
>   Implement <unwind-link.h> for dynamically loading the libgcc_s
>     unwinder
>   backtrace: Implement on top of <unwind-link.h>
>   arm: Implement backtrace on top of <unwind-link.h>
>   i386: Implement backtrace on top of <unwind-link.h>
>   m68k: Implement backtrace on top of <unwind-link.h>
>   sparc: Implement backtrace on top <unwind-link.h>
>   __frame_state_for: Use <unwind-link.h> for unwinder access
>   Move sysdeps/gnu/unwind-resume.c to sysdeps/generic/unwind-resume.c
>   Implement _Unwind_Resume in libc on top of <unwind-link.h>
>   nptl: Use <unwind-link.h> for accessing the libgcc_s unwinder
> 
>  debug/backtrace.c                             |  86 +++--------
>  malloc/set-freeres.c                          |   5 +
>  misc/Makefile                                 |   2 +-
>  misc/Versions                                 |   1 +
>  misc/unwind-link.c                            | 145 ++++++++++++++++++
>  nptl/nptlfreeres.c                            |   1 -
>  nptl/pthreadP.h                               |   6 +-
>  nptl/pthread_cancel.c                         |   3 +-
>  sysdeps/alpha/unwind-arch.h                   |  28 ++++
>  sysdeps/arm/arm-unwind-resume.S               |  26 ++--
>  sysdeps/arm/backtrace.c                       |  77 +++-------
>  sysdeps/arm/nptl/unwind-forcedunwind.c        |  25 +++
>  sysdeps/arm/pt-arm-unwind-resume.S            |  22 ++-
>  sysdeps/arm/unwind-arch.h                     |  39 +++++
>  sysdeps/arm/unwind-resume.c                   |  25 +++
>  sysdeps/generic/framestate.c                  |  21 +--
>  sysdeps/generic/unwind-arch.h                 |  27 ++--
>  sysdeps/generic/unwind-link.h                 | 106 +++++++++++++
>  sysdeps/generic/unwind-resume.c               |  46 ++++++
>  sysdeps/gnu/unwind-resume.c                   |  83 ----------
>  sysdeps/i386/backtrace.c                      |  82 +++-------
>  sysdeps/i386/unwind-arch.h                    |  39 +++++
>  sysdeps/ia64/unwind-arch.h                    |  32 ++++
>  sysdeps/m68k/backtrace.c                      |  82 +++-------
>  sysdeps/m68k/m680x0/unwind-arch.h             |  26 ++++
>  sysdeps/m68k/unwind-arch.h                    |  35 +++++
>  sysdeps/mach/hurd/fork.c                      |   3 +
>  .../{unix/sysv/linux => }/mips/unwind-arch.h  |  17 +-
>  sysdeps/nptl/fork.c                           |   3 +
>  sysdeps/nptl/unwind-forcedunwind.c            | 115 ++------------
>  sysdeps/powerpc/powerpc32/unwind-arch.h       |  28 ++++
>  sysdeps/s390/unwind-arch.h                    |  28 ++++
>  sysdeps/sh/unwind-arch.h                      |  28 ++++
>  sysdeps/sparc/backtrace.c                     |  66 ++------
>  sysdeps/sparc/unwind-arch.h                   |  28 ++++
>  .../sysv/linux/ia64/unwind-forcedunwind.c     |  16 +-
>  36 files changed, 852 insertions(+), 550 deletions(-)
>  create mode 100644 misc/unwind-link.c
>  create mode 100644 sysdeps/alpha/unwind-arch.h
>  create mode 100644 sysdeps/arm/nptl/unwind-forcedunwind.c
>  create mode 100644 sysdeps/arm/unwind-arch.h
>  create mode 100644 sysdeps/arm/unwind-resume.c
>  create mode 100644 sysdeps/generic/unwind-link.h
>  create mode 100644 sysdeps/generic/unwind-resume.c
>  delete mode 100644 sysdeps/gnu/unwind-resume.c
>  create mode 100644 sysdeps/i386/unwind-arch.h
>  create mode 100644 sysdeps/ia64/unwind-arch.h
>  create mode 100644 sysdeps/m68k/m680x0/unwind-arch.h
>  create mode 100644 sysdeps/m68k/unwind-arch.h
>  rename sysdeps/{unix/sysv/linux => }/mips/unwind-arch.h (85%)
>  create mode 100644 sysdeps/powerpc/powerpc32/unwind-arch.h
>  create mode 100644 sysdeps/s390/unwind-arch.h
>  create mode 100644 sysdeps/sh/unwind-arch.h
>  create mode 100644 sysdeps/sparc/unwind-arch.h
>