Support saving asm range.

This commit is contained in:
Bartosz Taudul 2020-05-11 21:12:43 +02:00
parent 9d5d116014
commit 0790e92cad
2 changed files with 9 additions and 3 deletions

View File

@ -3421,8 +3421,11 @@ void SourceView::CheckWrite( int line, RegsX86 reg, int limit )
}
}
void SourceView::Save( const Worker& worker )
void SourceView::Save( const Worker& worker, size_t start, size_t stop )
{
assert( start < m_asm.size() );
assert( start < stop );
nfdchar_t* fn;
auto res = NFD_SaveDialog( "asm", nullptr, &fn );
if( res == NFD_OKAY )
@ -3465,8 +3468,10 @@ void SourceView::Save( const Worker& worker )
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" );
for( auto& v : m_asm )
const auto end = m_asm.size() < stop ? m_asm.size() : stop;
for( size_t i=start; i<end; i++ )
{
const auto& v = m_asm[i];
auto it = m_locMap.find( v.addr );
if( it != m_locMap.end() )
{

View File

@ -1,6 +1,7 @@
#ifndef __TRACYSOURCEVIEW_HPP__
#define __TRACYSOURCEVIEW_HPP__
#include <limits>
#include <string>
#include <vector>
@ -167,7 +168,7 @@ private:
void CheckRead( int line, RegsX86 reg, int limit );
void CheckWrite( int line, RegsX86 reg, int limit );
void Save( const Worker& worker );
void Save( const Worker& worker, size_t start = 0, size_t stop = std::numeric_limits<size_t>::max() );
struct TokenizerState
{