Esempio n. 1
0
    virtual void OnStackFrame(const wxStackFrame& frame)
    {
        printf("[%2d] ", (int) frame.GetLevel());

        wxString name = frame.GetName();
        if ( !name.empty() )
        {
            printf("%-20.40s", (const char*)name.mb_str());
        }
        else
        {
            printf("0x%08lx", (unsigned long)frame.GetAddress());
        }

        if ( frame.HasSourceLocation() )
        {
            printf("\t%s:%d",
                   (const char*)frame.GetFileName().mb_str(),
                   (int)frame.GetLine());
        }

        puts("");

        wxString type, val;
        for ( size_t n = 0; frame.GetParam(n, &type, &name, &val); n++ )
        {
            printf("\t%s %s = %s\n", (const char*)type.mb_str(),
                                     (const char*)name.mb_str(),
                                     (const char*)val.mb_str());
        }
    }
Esempio n. 2
0
        virtual void OnStackFrame(const wxStackFrame& frame)
        {
            m_stackTrace << wxString::Format(_T("[%02d] "), frame.GetLevel());

            wxString name = frame.GetName();
            if ( !name.empty() )
            {
                m_stackTrace << wxString::Format(_T("%-40s"), name.c_str());
            }
            else
            {
                m_stackTrace << wxString::Format
                                (
                                    _T("0x%08lx"),
                                    (unsigned long)frame.GetAddress()
                                );
            }

            if ( frame.HasSourceLocation() )
            {
                m_stackTrace << _T('\t')
                             << frame.GetFileName()
                             << _T(':')
                             << frame.GetLine();
            }

            m_stackTrace << _T('\n');
        }
Esempio n. 3
0
void StackWalker::OnStackFrame(const wxStackFrame &frame) {
	wxString dst = wxString::Format(_T("%03i - 0x%08X: "),frame.GetLevel(),frame.GetAddress()) + frame.GetName() + _T(" on ") + frame.GetFileName() + wxString::Format(_T(":%i"),frame.GetLine());
	char temp[2048];
	if (file.is_open()) {
		strcpy(temp,dst.mb_str());
		file << temp << std::endl;
	}
	else wxLogMessage(dst);
}
Esempio n. 4
0
	void OnStackFrame(const wxStackFrame& frame)
	{
		wxString line = wxString::Format(_T("\n\t%03i - "),frame.GetLevel()) + frame.GetName();
		if (frame.HasSourceLocation()) {
			wxFileName fn(frame.GetFileName());
			line += _T(" (") + fn.GetFullName() + wxString::Format(_T(":%i)"),frame.GetLine());
		}
		str += line.mb_str(wxConvUTF8);
	}
Esempio n. 5
0
void Error::StackWalker::OnStackFrame(const wxStackFrame & frame)
{
#ifdef _DEBUG
	wxString l;
	l.Printf(_T("%d %s:%d %s"), frame.GetLevel(), frame.GetFileName().c_str(), frame.GetLine(), frame.GetName().c_str());
//	l = wxString(frame.GetName().c_str();
	wxLogDebug(l);
#endif
}
Esempio n. 6
0
	void OnStackFrame(const wxStackFrame& frame)
	{
		string location = "[unknown location] ";
		if (frame.HasSourceLocation())
			location = S_FMT("(%s:%d) ", frame.GetFileName(), frame.GetLine());

		wxUIntPtr address = wxPtrToUInt(frame.GetAddress());
		string func_name = frame.GetName();
		if (func_name.IsEmpty())
			func_name = S_FMT("[unknown:%d]", address);

		stack_trace.Append(S_FMT("%d: %s%s\n", frame.GetLevel(), location, func_name));
	}
Esempio n. 7
0
void XmlStackWalker::OnStackFrame(const wxStackFrame& frame)
{
    m_isOk = true;

    wxXmlNode *nodeFrame = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("frame"));
    m_nodeStack->AddChild(nodeFrame);

    NumProperty(nodeFrame, wxT("level"), frame.GetLevel());
    wxString func = frame.GetName();
    if ( !func.empty() )
    {
        nodeFrame->AddAttribute(wxT("function"), func);
        HexProperty(nodeFrame, wxT("offset"), frame.GetOffset());
    }

    if ( frame.HasSourceLocation() )
    {
        nodeFrame->AddAttribute(wxT("file"), frame.GetFileName());
        NumProperty(nodeFrame, wxT("line"), frame.GetLine());
    }

    const size_t nParams = frame.GetParamCount();
    if ( nParams )
    {
        wxXmlNode *nodeParams = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("parameters"));
        nodeFrame->AddChild(nodeParams);

        for ( size_t n = 0; n < nParams; n++ )
        {
            wxXmlNode *
                nodeParam = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("parameter"));
            nodeParams->AddChild(nodeParam);

            NumProperty(nodeParam, wxT("number"), n);

            wxString type, name, value;
            if ( !frame.GetParam(n, &type, &name, &value) )
                continue;

            if ( !type.empty() )
                TextElement(nodeParam, wxT("type"), type);

            if ( !name.empty() )
                TextElement(nodeParam, wxT("name"), name);

            if ( !value.empty() )
                TextElement(nodeParam, wxT("value"), value);
        }
    }
}