projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
64bit mac adaptions
[wxWidgets.git]
/
src
/
unix
/
stackwalk.cpp
diff --git
a/src/unix/stackwalk.cpp
b/src/unix/stackwalk.cpp
index 6b8b6051c197c958fe284e243816b87425d8b08a..62669bcf2d36235c1c0db6fd777c3e5d190e088e 100644
(file)
--- a/
src/unix/stackwalk.cpp
+++ b/
src/unix/stackwalk.cpp
@@
-239,8
+239,9
@@
int wxStackWalker::InitFrames(wxStackFrame *arr, size_t n, void **addresses, cha
// parse addr2line output (should be exactly 2 lines for each address)
// reusing the g_buf used for building the command line above
wxString name, filename;
// parse addr2line output (should be exactly 2 lines for each address)
// reusing the g_buf used for building the command line above
wxString name, filename;
- unsigned long line, curr=0;
- for (size_t i=0; i<n; i++)
+ unsigned long line = 0,
+ curr = 0;
+ for ( size_t i = 0; i < n; i++ )
{
// 1st line has function name
if ( fgets(g_buf, WXSIZEOF(g_buf), fp) )
{
// 1st line has function name
if ( fgets(g_buf, WXSIZEOF(g_buf), fp) )
@@
-253,7
+254,8
@@
int wxStackWalker::InitFrames(wxStackFrame *arr, size_t n, void **addresses, cha
}
else
{
}
else
{
- wxLogDebug(_T("cannot read addr2line output for %d-th stack frame!"), i);
+ wxLogDebug(_T("cannot read addr2line output for stack frame #%lu"),
+ (unsigned long)i);
return false;
}
return false;
}
@@
-266,10
+268,9
@@
int wxStackWalker::InitFrames(wxStackFrame *arr, size_t n, void **addresses, cha
const size_t posColon = filename.find(_T(':'));
if ( posColon != wxString::npos )
{
const size_t posColon = filename.find(_T(':'));
if ( posColon != wxString::npos )
{
- // parse line number
- if ( !wxString(filename, posColon + 1, wxString::npos).
- ToULong(&line) )
- line = 0;
+ // parse line number (it's ok if it fails, this will just leave
+ // line at its current, invalid, 0 value)
+ wxString(filename, posColon + 1, wxString::npos).ToULong(&line);
// remove line number from 'filename'
filename.erase(posColon);
// remove line number from 'filename'
filename.erase(posColon);