patches/uClibc/0.9.30.2/290-blackfin-nommu-fork-stub.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Dec 13 23:32:39 2011 +0100 (2011-12-13)
branch1.13
changeset 2847 c0bf2319af08
permissions -rw-r--r--
scripts: fix dumping execution backtrace

Dumping the backtrace has been broken since changeset #652e56d6d35a:
scripts: execute each steps in a subshell

We can spawn sub-sub-shells in some cases.

The way the fault handler works is to dump the backtrace, but to avoid
printing it once for every sub-shell (which could get quite confusing),
it simply exits when it detects that it is being run in a sub-shell,
leaving to the top-level shell the work to dump the backtrace.

Because each step is executed in its own sub-shell, the variable arrays
that contain the step name, the source file and line number, are lost
when exiting the per-step sub-shell.

Hence, the backtrace is currently limited to printing only the top-level
main procedure of the shell.

Fix this thus:
- when dumping the bckatraces for the steps & the functions, remember
it was dumped, and only dump it if it was not already dumped
- at the top-level shell, print the hints

Also, rename the top-level step label.

Reported-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 4193d6e6a17430a177fa88c287879c2c35e319f3)
thomas@1910
     1
From: Jie Zhang <jie.zhang@analog.com>
thomas@1910
     2
Date: Mon, 1 Jun 2009 07:25:42 +0000 (+0000)
thomas@1910
     3
Subject: Backport UCLIBC_HAS_STUBS config option from the upstream. This option makes uClibc... 
thomas@1910
     4
X-Git-Url: http://blackfin.uclinux.org/git/?p=readonly-mirrors%2Ftoolchain.git;a=commitdiff_plain;h=cacea6b12bae6f6cfd08e2bbec536e9b23b342f5
thomas@1910
     5
thomas@1910
     6
Backport UCLIBC_HAS_STUBS config option from the upstream. This option makes uClibc provide fork() stub on NOMMU targets. It's default off.
thomas@1910
     7
thomas@1910
     8
thomas@1910
     9
git-svn-id: svn://localhost/svn/toolchain/trunk@3417 2adf4935-75e9-4407-93b2-34b21a1880a4
thomas@1910
    10
---
thomas@1910
    11
thomas@1910
    12
Index: uClibc-0.9.30.2/libc/unistd/daemon.c
thomas@1910
    13
===================================================================
thomas@1910
    14
--- uClibc-0.9.30.2.orig/libc/unistd/daemon.c	2010-01-13 22:22:31.000000000 +0100
thomas@1910
    15
+++ uClibc-0.9.30.2/libc/unistd/daemon.c	2010-04-06 22:04:11.000000000 +0200
thomas@1910
    16
@@ -55,7 +55,6 @@
thomas@1910
    17
 libc_hidden_proto(dup2)
thomas@1910
    18
 libc_hidden_proto(setsid)
thomas@1910
    19
 libc_hidden_proto(chdir)
thomas@1910
    20
-libc_hidden_proto(fork)
thomas@1910
    21
 
thomas@1910
    22
 #ifndef __ARCH_USE_MMU__
thomas@1910
    23
 #include <sys/syscall.h>
thomas@1910
    24
@@ -85,6 +84,8 @@
thomas@1910
    25
 	return ret;
thomas@1910
    26
 }
thomas@1910
    27
 #else
thomas@1910
    28
+libc_hidden_proto(fork)
thomas@1910
    29
+
thomas@1910
    30
 static inline pid_t fork_parent(void)
thomas@1910
    31
 {
thomas@1910
    32
 	switch (fork()) {