RabbitCommon v2.3.3
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
RabbitCommon::CCallTrace Class Reference

Get call stack. More...

#include <StackTrace.h>

Inheritance diagram for RabbitCommon::CCallTrace:

Public Member Functions

 CCallTrace (QObject *parent=nullptr)
 
QString GetStack (uint index=5)
 

Private Member Functions

QStringList GetStack (uint index, unsigned int max_frames)
 Print a demangled stack backtrace of the caller function to FILE* out.
 

Private Attributes

Qt::HANDLE m_hMainThread
 

Detailed Description

Get call stack.

Definition at line 16 of file StackTrace.h.

Constructor & Destructor Documentation

◆ CCallTrace()

RabbitCommon::CCallTrace::CCallTrace ( QObject *  parent = nullptr)
explicit
Parameters
hMainThreadMain(UI) thread id. If you are use ShowCoreDialog(). The call must be in the main(UI) thread.

Member Function Documentation

◆ GetStack() [1/2]

QStringList RabbitCommon::CCallTrace::GetStack ( uint  index,
unsigned int  max_frames 
)
private

Print a demangled stack backtrace of the caller function to FILE* out.

~/english resolve addresses into strings containing "filename(function+address)", this array must be free()-ed

~/chinese 接受 backtrace 返回的 buffer 和 size, 将每一个函数地址通过符号表进行翻译,生成一个包含函数名, 内部指令偏移和实际返回地址的字符串, 并返回一个malloc出来的字符串数组,用户需要手工释放数组本身, 但是数组的每一个指针本身则不必被用户释放

Definition at line 301 of file StackTrace.cpp.

◆ GetStack() [2/2]

QString RabbitCommon::CCallTrace::GetStack ( uint  index = 5)

Definition at line 109 of file StackTrace.cpp.

Member Data Documentation

◆ m_hMainThread

Qt::HANDLE RabbitCommon::CCallTrace::m_hMainThread
private

Definition at line 58 of file StackTrace.h.


The documentation for this class was generated from the following files: