1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-01 05:03:53 +00:00

Remove support for AT&T assembly syntax.

This commit is contained in:
Bartosz Taudul 2023-02-10 20:41:03 +01:00
parent 0d6fb703b4
commit 55823df56a
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 49 additions and 60 deletions

View File

@ -257,7 +257,6 @@ SourceView::SourceView()
, m_asmBytes( false ) , m_asmBytes( false )
, m_asmShowSourceLocation( true ) , m_asmShowSourceLocation( true )
, m_calcInlineStats( true ) , m_calcInlineStats( true )
, m_atnt( false )
, m_hwSamples( true ) , m_hwSamples( true )
, m_hwSamplesRelative( true ) , m_hwSamplesRelative( true )
, m_childCalls( false ) , m_childCalls( false )
@ -706,7 +705,7 @@ bool SourceView::Disassemble( uint64_t symAddr, const Worker& worker )
} }
if( rval != CS_ERR_OK ) return false; if( rval != CS_ERR_OK ) return false;
cs_option( handle, CS_OPT_DETAIL, CS_OPT_ON ); cs_option( handle, CS_OPT_DETAIL, CS_OPT_ON );
cs_option( handle, CS_OPT_SYNTAX, m_atnt ? CS_OPT_SYNTAX_ATT : CS_OPT_SYNTAX_INTEL ); cs_option( handle, CS_OPT_SYNTAX, CS_OPT_SYNTAX_INTEL );
cs_insn* insn; cs_insn* insn;
size_t cnt = cs_disasm( handle, (const uint8_t*)code, len, symAddr, 0, &insn ); size_t cnt = cs_disasm( handle, (const uint8_t*)code, len, symAddr, 0, &insn );
if( cnt > 0 ) if( cnt > 0 )
@ -879,9 +878,8 @@ bool SourceView::Disassemble( uint64_t symAddr, const Worker& worker )
if( ( m_cpuArch == CpuArchX64 || m_cpuArch == CpuArchX86 ) && op.id == X86_INS_LEA ) if( ( m_cpuArch == CpuArchX64 || m_cpuArch == CpuArchX86 ) && op.id == X86_INS_LEA )
{ {
assert( op.detail->x86.op_count == 2 ); assert( op.detail->x86.op_count == 2 );
const auto opidx = m_atnt ? 0 : 1; assert( op.detail->x86.operands[1].type == X86_OP_MEM );
assert( op.detail->x86.operands[opidx].type == X86_OP_MEM ); auto& mem = op.detail->x86.operands[1].mem;
auto& mem = op.detail->x86.operands[opidx].mem;
if( mem.base == X86_REG_INVALID ) if( mem.base == X86_REG_INVALID )
{ {
if( mem.index == X86_REG_INVALID ) if( mem.index == X86_REG_INVALID )
@ -2359,13 +2357,6 @@ uint64_t SourceView::RenderSymbolAsmView( const AddrStatData& as, Worker& worker
SmallCheckbox( ICON_FA_SHARE " Jumps", &m_showJumps ); SmallCheckbox( ICON_FA_SHARE " Jumps", &m_showJumps );
if( m_cpuArch == CpuArchX64 || m_cpuArch == CpuArchX86 ) if( m_cpuArch == CpuArchX64 || m_cpuArch == CpuArchX86 )
{
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();
if( SmallCheckbox( "AT&T", &m_atnt ) ) Disassemble( m_baseAddr, worker );
if( !m_atnt )
{ {
ImGui::SameLine(); ImGui::SameLine();
ImGui::Spacing(); ImGui::Spacing();
@ -2420,7 +2411,6 @@ uint64_t SourceView::RenderSymbolAsmView( const AddrStatData& as, Worker& worker
} }
ImGui::PopStyleVar(); ImGui::PopStyleVar();
} }
}
ImGui::SameLine(); ImGui::SameLine();
ImGui::Spacing(); ImGui::Spacing();
@ -3936,7 +3926,7 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
int opdesc = 0; int opdesc = 0;
const AsmVar* asmVar = nullptr; const AsmVar* asmVar = nullptr;
if( !m_atnt && ( m_cpuArch == CpuArchX64 || m_cpuArch == CpuArchX86 ) ) if( m_cpuArch == CpuArchX64 || m_cpuArch == CpuArchX86 )
{ {
auto uarch = MicroArchitectureData[m_idxMicroArch]; auto uarch = MicroArchitectureData[m_idxMicroArch];
char tmp[32]; char tmp[32];
@ -5569,7 +5559,7 @@ void SourceView::Save( const Worker& worker, size_t start, size_t stop )
symName = worker.GetString( sym->name ); symName = worker.GetString( sym->name );
} }
fprintf( f, "# Tracy Profiler disassembly of symbol %s [%s]\n\n", symName, worker.GetCaptureProgram().c_str() ); fprintf( f, "# Tracy Profiler disassembly of symbol %s [%s]\n\n", symName, worker.GetCaptureProgram().c_str() );
if( !m_atnt ) fprintf( f, ".intel_syntax\n\n" ); fprintf( f, ".intel_syntax\n\n" );
const auto end = m_asm.size() < stop ? m_asm.size() : stop; const auto end = m_asm.size() < stop ? m_asm.size() : stop;
for( size_t i=start; i<end; i++ ) for( size_t i=start; i<end; i++ )

View File

@ -235,7 +235,6 @@ private:
bool m_asmShowSourceLocation; bool m_asmShowSourceLocation;
bool m_calcInlineStats; bool m_calcInlineStats;
uint8_t m_maxAsmBytes; uint8_t m_maxAsmBytes;
bool m_atnt;
uint64_t m_jumpPopupAddr; uint64_t m_jumpPopupAddr;
const CallstackFrameData* m_localCallstackPopup; const CallstackFrameData* m_localCallstackPopup;
bool m_hwSamples, m_hwSamplesRelative; bool m_hwSamples, m_hwSamplesRelative;