patches/gcc/4.2.4/220-libstdc++-namespace.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
parent 687 b2b6b1d46aa1
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)
yann@687
     1
diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
yann@687
     2
--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
yann@687
     3
+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:35:40.000000000 +0200
yann@687
     4
@@ -32,7 +32,8 @@
yann@687
     5
 //
yann@687
     6
 
yann@687
     7
 // Written by Benjamin Kosnik <bkoz@redhat.com>
yann@687
     8
-
yann@687
     9
+namespace std
yann@687
    10
+{
yann@687
    11
 #ifdef __UCLIBC_MJN3_ONLY__
yann@687
    12
 #warning fix prototypes for *textdomain funcs
yann@687
    13
 #endif
yann@687
    14
@@ -115,3 +116,4 @@
yann@687
    15
 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
yann@687
    16
 	 }
yann@687
    17
      }
yann@687
    18
+}
yann@687
    19
diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
yann@687
    20
--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
yann@687
    21
+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:35:40.000000000 +0200
yann@687
    22
@@ -33,7 +33,8 @@
yann@687
    23
 //
yann@687
    24
 
yann@687
    25
 // Written by Benjamin Kosnik <bkoz@redhat.com>
yann@687
    26
-
yann@687
    27
+namespace std
yann@687
    28
+{
yann@687
    29
   template<typename _CharT>
yann@687
    30
     __timepunct<_CharT>::__timepunct(size_t __refs) 
yann@687
    31
     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
yann@687
    32
@@ -74,3 +75,4 @@
yann@687
    33
       delete _M_data; 
yann@687
    34
       _S_destroy_c_locale(_M_c_locale_timepunct); 
yann@687
    35
     }
yann@687
    36
+}