Gitweb links:

...log 
http://git.netsurf-browser.org/toolchains.git/shortlog/7f53178a4cdbed363328a5fa60bead742bd628aa
...commit 
http://git.netsurf-browser.org/toolchains.git/commit/7f53178a4cdbed363328a5fa60bead742bd628aa
...tree 
http://git.netsurf-browser.org/toolchains.git/tree/7f53178a4cdbed363328a5fa60bead742bd628aa

The branch, jmb/arm-riscos-gnueabihf has been updated
       via  7f53178a4cdbed363328a5fa60bead742bd628aa (commit)
      from  98fc44e4b6b635bbf261c03038d470e19a468ba6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/toolchains.git/commit/?id=7f53178a4cdbed363328a5fa60bead742bd628aa
commit 7f53178a4cdbed363328a5fa60bead742bd628aa
Author: John-Mark Bell <[email protected]>
Commit: John-Mark Bell <[email protected]>

    Fix stack backtraces from UnixLib
    
    The frame pointer to the signal stack frame was off-by-one
    resulting in unwinding terminating early. Additionally, we can
    dump the register state at the point of the abort now.

diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p 
b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p
new file mode 100644
index 0000000..2c971cd
--- /dev/null
+++ b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p
@@ -0,0 +1,37 @@
+--- libunixlib/signal/post.c   2021-06-15 21:42:03.000000000 +0100
++++ libunixlib/signal/post.c   2022-06-03 19:52:18.316234729 +0100
+@@ -307,6 +307,7 @@
+       }
+ 
+ #ifdef __ARM_EABI__
++      const unsigned int *pc = NULL;
+       const unsigned int * const lr = (unsigned int *)fp[LR_OFFSET];
+       fprintf (stderr, "  (%8x) lr: %8x",
+              (unsigned int)fp, (unsigned int)lr);
+@@ -350,7 +351,6 @@
+ #endif
+       oldfp = fp;
+       fp = (const unsigned int *)fp[FP_OFFSET];
+-#ifndef __ARM_EABI__
+       if (__ul_callbackfp != NULL && fp == __ul_callbackfp)
+       {
+         /* At &oldfp[1] = cpsr, a1-a4, v1-v6, sl, fp, ip, sp, lr, pc */
+@@ -424,7 +424,6 @@
+ 
+         fputs ("\n\n", stderr);
+       }
+-#endif
+     }
+ 
+   fputc ('\n', stderr);
+--- libunixlib/signal/_signal.s        2020-05-31 20:11:06.000000000 +0100
++++ libunixlib/signal/_signal.s        2022-06-03 19:45:32.872892834 +0100
+@@ -761,7 +761,7 @@
+       LDR     a3, [sp, #14*4 + 4]     @ saved USR lr
+       LDR     a1, [sp, #11*4 + 4]     @ saved USR fp
+       STMFD   sp!, {a1, a3}           @ create signal frame
+-      MOV     fp, sp                  @ FIXME: check this with compiler 
output for similar function
++      ADD     fp, sp, #4              @ FIXME: check this with compiler 
output for similar function
+ #else
+       @ Create an APCS-32 compilant signal stack frame
+       ADR     a4, __h_cback + 4*3     @ point at handler name for backtrace


-----------------------------------------------------------------------

Summary of changes:
 .../recipes/patches/gccsdk/unixlib-backtrace.p     |   37 ++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 
arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p

diff --git a/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p 
b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p
new file mode 100644
index 0000000..2c971cd
--- /dev/null
+++ b/arm-riscos-gnueabihf/recipes/patches/gccsdk/unixlib-backtrace.p
@@ -0,0 +1,37 @@
+--- libunixlib/signal/post.c   2021-06-15 21:42:03.000000000 +0100
++++ libunixlib/signal/post.c   2022-06-03 19:52:18.316234729 +0100
+@@ -307,6 +307,7 @@
+       }
+ 
+ #ifdef __ARM_EABI__
++      const unsigned int *pc = NULL;
+       const unsigned int * const lr = (unsigned int *)fp[LR_OFFSET];
+       fprintf (stderr, "  (%8x) lr: %8x",
+              (unsigned int)fp, (unsigned int)lr);
+@@ -350,7 +351,6 @@
+ #endif
+       oldfp = fp;
+       fp = (const unsigned int *)fp[FP_OFFSET];
+-#ifndef __ARM_EABI__
+       if (__ul_callbackfp != NULL && fp == __ul_callbackfp)
+       {
+         /* At &oldfp[1] = cpsr, a1-a4, v1-v6, sl, fp, ip, sp, lr, pc */
+@@ -424,7 +424,6 @@
+ 
+         fputs ("\n\n", stderr);
+       }
+-#endif
+     }
+ 
+   fputc ('\n', stderr);
+--- libunixlib/signal/_signal.s        2020-05-31 20:11:06.000000000 +0100
++++ libunixlib/signal/_signal.s        2022-06-03 19:45:32.872892834 +0100
+@@ -761,7 +761,7 @@
+       LDR     a3, [sp, #14*4 + 4]     @ saved USR lr
+       LDR     a1, [sp, #11*4 + 4]     @ saved USR fp
+       STMFD   sp!, {a1, a3}           @ create signal frame
+-      MOV     fp, sp                  @ FIXME: check this with compiler 
output for similar function
++      ADD     fp, sp, #4              @ FIXME: check this with compiler 
output for similar function
+ #else
+       @ Create an APCS-32 compilant signal stack frame
+       ADR     a4, __h_cback + 4*3     @ point at handler name for backtrace


-- 
Cross-compilation toolchains and environments
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to