From 759d3799ad21f5e4b72ff6178afc82a1f635d677 Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Thu, 13 Jun 2024 21:32:08 -0700 Subject: [PATCH] stack-walker: Remove obsolete library This code was only portable to 32-bit x86 (without frame pointer elimination). Portable backtraces are now provided by the run-time via libunwind. * sources/lib/stack-walker/*: Remove. * sources/registry/*/stack-walker: Remove * sources/environment/dswank/library.dylan: Remove (commented-out) reference to the stack-walker library. * OVERVIEW.txt: Remove mention of the stack-walker library. * documentation/source/release-notes/2024.2.rst: Note removal of the stack-walker library. --- OVERVIEW.txt | 2 -- documentation/source/release-notes/2024.2.rst | 5 +++ sources/environment/dswank/library.dylan | 2 -- sources/lib/stack-walker/getebp.c | 35 ------------------- sources/lib/stack-walker/library.dylan | 19 ---------- sources/lib/stack-walker/stack-walker.dylan | 9 ----- sources/lib/stack-walker/stack-walker.lid | 9 ----- sources/registry/aarch64-linux/stack-walker | 1 - sources/registry/arm-linux/stack-walker | 1 - sources/registry/riscv64-linux/stack-walker | 1 - sources/registry/x86-freebsd/stack-walker | 1 - sources/registry/x86-linux/stack-walker | 1 - sources/registry/x86-netbsd/stack-walker | 1 - sources/registry/x86_64-linux/stack-walker | 1 - 14 files changed, 5 insertions(+), 83 deletions(-) delete mode 100644 sources/lib/stack-walker/getebp.c delete mode 100644 sources/lib/stack-walker/library.dylan delete mode 100644 sources/lib/stack-walker/stack-walker.dylan delete mode 100644 sources/lib/stack-walker/stack-walker.lid delete mode 100644 sources/registry/aarch64-linux/stack-walker delete mode 100644 sources/registry/arm-linux/stack-walker delete mode 100644 sources/registry/riscv64-linux/stack-walker delete mode 100644 sources/registry/x86-freebsd/stack-walker delete mode 100644 sources/registry/x86-linux/stack-walker delete mode 100644 sources/registry/x86-netbsd/stack-walker delete mode 100644 sources/registry/x86_64-linux/stack-walker diff --git a/OVERVIEW.txt b/OVERVIEW.txt index a0768923e2..4b88d052a0 100644 --- a/OVERVIEW.txt +++ b/OVERVIEW.txt @@ -94,8 +94,6 @@ sources jam - Jam script interpreter. parser-run-time - Support for parsers. source-records - Reads source files and tracks location. - stack-walker - Debugging on UNIX by walking the stack. Nowadays - directly in the run-time. walker - Build has-a tree. project-manager - Takes care about dependencies of projects and actual invocation of linker, etc. diff --git a/documentation/source/release-notes/2024.2.rst b/documentation/source/release-notes/2024.2.rst index 2d7715a16d..e45a75bd36 100644 --- a/documentation/source/release-notes/2024.2.rst +++ b/documentation/source/release-notes/2024.2.rst @@ -54,6 +54,11 @@ System :const:`$machine-architecture`. The old name will remain, for backward compatibility. +Other +----- + +* The obsolete (32-bit x86-only) ``stack-walker`` library was removed. + Contributors ============ diff --git a/sources/environment/dswank/library.dylan b/sources/environment/dswank/library.dylan index 20f5e8fcb7..73664829f8 100644 --- a/sources/environment/dswank/library.dylan +++ b/sources/environment/dswank/library.dylan @@ -19,7 +19,6 @@ define library dswank use file-source-records; use system; use registry-projects; - //use stack-walker; use release-info; use dfmc-back-end-implementations; end library; @@ -46,7 +45,6 @@ define module dswank use file-system; use locators; use registry-projects; - //use stack-walker; use release-info; use operating-system; end module; diff --git a/sources/lib/stack-walker/getebp.c b/sources/lib/stack-walker/getebp.c deleted file mode 100644 index 4d263d7fa6..0000000000 --- a/sources/lib/stack-walker/getebp.c +++ /dev/null @@ -1,35 +0,0 @@ -#include -#define __USE_GNU -#include - -int getebp () { - int ebp; - asm("mov (%%ebp), %0" - :"=r"(ebp)); - return ebp; -}; - -void walkstack() { - int ebp = getebp(); - int eip; - int rc; - Dl_info info; - - while(ebp) { - eip = *((int*)ebp + 1); - rc = dladdr((void*)eip, &info); - if (!rc||(!info.dli_sname && !info.dli_fname)) { - printf("0x%x (unknown)\n"); - } else { - if (!info.dli_sname) { - printf("0x%x (%s)\n", eip, info.dli_fname); - } else { - printf("%s+%i (%s)\n", - info.dli_sname, - eip - (int)info.dli_saddr, - info.dli_fname); - } - } - ebp = *((int*)ebp); - } -} diff --git a/sources/lib/stack-walker/library.dylan b/sources/lib/stack-walker/library.dylan deleted file mode 100644 index ca3b616a4f..0000000000 --- a/sources/lib/stack-walker/library.dylan +++ /dev/null @@ -1,19 +0,0 @@ -module: dylan-user -copyright: Original Code is Copyright (c) 2007 Dylan Hackers; - All rights reversed. -License: See License.txt in this distribution for details. -Warranty: Distributed WITHOUT WARRANTY OF ANY KIND - -define library stack-walker - use common-dylan; - use c-ffi; - - export stack-walker; -end; - -define module stack-walker - use common-dylan; - use c-ffi; - - export walk-stack; -end; diff --git a/sources/lib/stack-walker/stack-walker.dylan b/sources/lib/stack-walker/stack-walker.dylan deleted file mode 100644 index afcf18b9ef..0000000000 --- a/sources/lib/stack-walker/stack-walker.dylan +++ /dev/null @@ -1,9 +0,0 @@ -module: stack-walker -copyright: Original Code is Copyright (c) 2007 Dylan Hackers; - All rights reversed. -License: See License.txt in this distribution for details. -Warranty: Distributed WITHOUT WARRANTY OF ANY KIND - -define C-function walk-stack - c-name: "walkstack" -end; diff --git a/sources/lib/stack-walker/stack-walker.lid b/sources/lib/stack-walker/stack-walker.lid deleted file mode 100644 index 73c189ec52..0000000000 --- a/sources/lib/stack-walker/stack-walker.lid +++ /dev/null @@ -1,9 +0,0 @@ -library: stack-walker -c-source-files: getebp.c -files: library - stack-walker -Platforms: arm-linux - x86-freebsd - x86-linux - x86-netbsd - x86_64-linux diff --git a/sources/registry/aarch64-linux/stack-walker b/sources/registry/aarch64-linux/stack-walker deleted file mode 100644 index 262021218e..0000000000 --- a/sources/registry/aarch64-linux/stack-walker +++ /dev/null @@ -1 +0,0 @@ -abstract://dylan/lib/stack-walker/stack-walker.lid diff --git a/sources/registry/arm-linux/stack-walker b/sources/registry/arm-linux/stack-walker deleted file mode 100644 index 262021218e..0000000000 --- a/sources/registry/arm-linux/stack-walker +++ /dev/null @@ -1 +0,0 @@ -abstract://dylan/lib/stack-walker/stack-walker.lid diff --git a/sources/registry/riscv64-linux/stack-walker b/sources/registry/riscv64-linux/stack-walker deleted file mode 100644 index 262021218e..0000000000 --- a/sources/registry/riscv64-linux/stack-walker +++ /dev/null @@ -1 +0,0 @@ -abstract://dylan/lib/stack-walker/stack-walker.lid diff --git a/sources/registry/x86-freebsd/stack-walker b/sources/registry/x86-freebsd/stack-walker deleted file mode 100644 index 262021218e..0000000000 --- a/sources/registry/x86-freebsd/stack-walker +++ /dev/null @@ -1 +0,0 @@ -abstract://dylan/lib/stack-walker/stack-walker.lid diff --git a/sources/registry/x86-linux/stack-walker b/sources/registry/x86-linux/stack-walker deleted file mode 100644 index 262021218e..0000000000 --- a/sources/registry/x86-linux/stack-walker +++ /dev/null @@ -1 +0,0 @@ -abstract://dylan/lib/stack-walker/stack-walker.lid diff --git a/sources/registry/x86-netbsd/stack-walker b/sources/registry/x86-netbsd/stack-walker deleted file mode 100644 index 262021218e..0000000000 --- a/sources/registry/x86-netbsd/stack-walker +++ /dev/null @@ -1 +0,0 @@ -abstract://dylan/lib/stack-walker/stack-walker.lid diff --git a/sources/registry/x86_64-linux/stack-walker b/sources/registry/x86_64-linux/stack-walker deleted file mode 100644 index 262021218e..0000000000 --- a/sources/registry/x86_64-linux/stack-walker +++ /dev/null @@ -1 +0,0 @@ -abstract://dylan/lib/stack-walker/stack-walker.lid