mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Store CPU architecture.
This commit is contained in:
parent
5ae2c415b7
commit
dba594a857
@ -42,6 +42,7 @@ SourceView::SourceView( ImFont* font )
|
|||||||
, m_asmShowSourceLocation( true )
|
, m_asmShowSourceLocation( true )
|
||||||
, m_calcInlineStats( true )
|
, m_calcInlineStats( true )
|
||||||
, m_showJumps( true )
|
, m_showJumps( true )
|
||||||
|
, m_cpuArch( CpuArchUnknown )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,15 +150,15 @@ bool SourceView::Disassemble( uint64_t symAddr, const Worker& worker )
|
|||||||
m_jumpOut.clear();
|
m_jumpOut.clear();
|
||||||
m_maxJumpLevel = 0;
|
m_maxJumpLevel = 0;
|
||||||
if( symAddr == 0 ) return false;
|
if( symAddr == 0 ) return false;
|
||||||
const auto arch = worker.GetCpuArch();
|
m_cpuArch = worker.GetCpuArch();
|
||||||
if( arch == CpuArchUnknown ) return false;
|
if( m_cpuArch == CpuArchUnknown ) return false;
|
||||||
uint32_t len;
|
uint32_t len;
|
||||||
auto code = worker.GetSymbolCode( symAddr, len );
|
auto code = worker.GetSymbolCode( symAddr, len );
|
||||||
if( !code ) return false;
|
if( !code ) return false;
|
||||||
m_disasmFail = -1;
|
m_disasmFail = -1;
|
||||||
csh handle;
|
csh handle;
|
||||||
cs_err rval = CS_ERR_ARCH;
|
cs_err rval = CS_ERR_ARCH;
|
||||||
switch( arch )
|
switch( m_cpuArch )
|
||||||
{
|
{
|
||||||
case CpuArchX86:
|
case CpuArchX86:
|
||||||
rval = cs_open( CS_ARCH_X86, CS_MODE_32, &handle );
|
rval = cs_open( CS_ARCH_X86, CS_MODE_32, &handle );
|
||||||
@ -201,7 +202,7 @@ bool SourceView::Disassemble( uint64_t symAddr, const Worker& worker )
|
|||||||
uint64_t jumpAddr = 0;
|
uint64_t jumpAddr = 0;
|
||||||
if( hasJump )
|
if( hasJump )
|
||||||
{
|
{
|
||||||
switch( arch )
|
switch( m_cpuArch )
|
||||||
{
|
{
|
||||||
case CpuArchX86:
|
case CpuArchX86:
|
||||||
case CpuArchX64:
|
case CpuArchX64:
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "tracy_robin_hood.h"
|
#include "tracy_robin_hood.h"
|
||||||
#include "TracyDecayValue.hpp"
|
#include "TracyDecayValue.hpp"
|
||||||
|
#include "../common/TracyProtocol.hpp"
|
||||||
|
|
||||||
struct ImFont;
|
struct ImFont;
|
||||||
|
|
||||||
@ -151,6 +152,8 @@ private:
|
|||||||
int m_maxMnemonicLen;
|
int m_maxMnemonicLen;
|
||||||
|
|
||||||
TokenizerState m_tokenizer;
|
TokenizerState m_tokenizer;
|
||||||
|
|
||||||
|
CpuArchitecture m_cpuArch;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user