[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta/kdeutil/kde/os
From:       Tim Jansen <tim () tjansen ! de>
Date:       2003-11-09 22:09:43
[Download RAW message or body]

CVS commit by tjansen: 

avoid helper functions to make backtrace more predictable


  M +6 -10     runtime.cpp   1.3


--- kdenonbeta/kdeutil/kde/os/runtime.cpp  #1.2:1.3
@@ -26,13 +26,8 @@ using namespace KDE::OS;
 static const int MaxBacktraces = 100;
 
-static char **getBacktraceSymbols(int &n) {
-        void *adrBuf[MaxBacktraces];
-        n = backtrace(adrBuf, MaxBacktraces);
-        return backtrace_symbols(adrBuf, n);
-}
-
 QStringList Runtime::backtraceList(int skip) {
-        int n;
-        char **s = getBacktraceSymbols(n);
+        void *adrBuf[MaxBacktraces];
+        int n = ::backtrace(adrBuf, MaxBacktraces);
+        char **s = backtrace_symbols(adrBuf, n);
         QStringList l;
         for (int i = skip; i < n; i++)
@@ -43,6 +38,7 @@ QStringList Runtime::backtraceList(int s
 
 QString Runtime::backtrace(int skip) {
-        int n;
-        char **s = getBacktraceSymbols(n);
+        void *adrBuf[MaxBacktraces];
+        int n = ::backtrace(adrBuf, MaxBacktraces);
+        char **s = backtrace_symbols(adrBuf, n);
         QString l;
         for (int i = skip; i < n; i++) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic