mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 06:51:26 +12:00
Move debugger functions to emu_utils.cpp
This commit is contained in:
parent
709e3d2822
commit
3c576da42f
6 changed files with 55 additions and 35 deletions
|
@ -48,6 +48,7 @@ target_include_directories(rpcs3_emu
|
||||||
target_sources(rpcs3_emu PRIVATE
|
target_sources(rpcs3_emu PRIVATE
|
||||||
../util/atomic.cpp
|
../util/atomic.cpp
|
||||||
../util/console.cpp
|
../util/console.cpp
|
||||||
|
../util/emu_utils.cpp
|
||||||
../util/media_utils.cpp
|
../util/media_utils.cpp
|
||||||
../util/video_provider.cpp
|
../util/video_provider.cpp
|
||||||
../util/logs.cpp
|
../util/logs.cpp
|
||||||
|
|
|
@ -1302,7 +1302,7 @@ cpu_thread* cpu_thread::get_next_cpu()
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<CPUDisAsm> make_disasm(const cpu_thread* cpu, shared_ptr<cpu_thread> handle);
|
extern std::shared_ptr<CPUDisAsm> make_disasm(const cpu_thread* cpu, shared_ptr<cpu_thread> handle);
|
||||||
|
|
||||||
void cpu_thread::dump_all(std::string& ret) const
|
void cpu_thread::dump_all(std::string& ret) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -180,6 +180,7 @@
|
||||||
<ClCompile Include="Emu\NP\ip_address.cpp" />
|
<ClCompile Include="Emu\NP\ip_address.cpp" />
|
||||||
<ClCompile Include="Emu\vfs_config.cpp" />
|
<ClCompile Include="Emu\vfs_config.cpp" />
|
||||||
<ClCompile Include="Loader\disc.cpp" />
|
<ClCompile Include="Loader\disc.cpp" />
|
||||||
|
<ClCompile Include="util\emu_utils.cpp" />
|
||||||
<ClCompile Include="util\serialization_ext.cpp">
|
<ClCompile Include="util\serialization_ext.cpp">
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
|
@ -1342,6 +1342,9 @@
|
||||||
<ClCompile Include="Emu\RSX\Program\FragmentProgramRegister.cpp">
|
<ClCompile Include="Emu\RSX\Program\FragmentProgramRegister.cpp">
|
||||||
<Filter>Emu\GPU\RSX\Program</Filter>
|
<Filter>Emu\GPU\RSX\Program</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="util\emu_utils.cpp">
|
||||||
|
<Filter>Utilities</Filter>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="..\Utilities\date_time.cpp">
|
<ClCompile Include="..\Utilities\date_time.cpp">
|
||||||
<Filter>Utilities</Filter>
|
<Filter>Utilities</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
|
@ -44,41 +44,9 @@ extern atomic_t<bool> g_debugger_pause_all_threads_on_bp;
|
||||||
|
|
||||||
extern const ppu_decoder<ppu_itype> g_ppu_itype;
|
extern const ppu_decoder<ppu_itype> g_ppu_itype;
|
||||||
|
|
||||||
extern bool is_using_interpreter(thread_class t_class)
|
extern bool is_using_interpreter(thread_class t_class);
|
||||||
{
|
|
||||||
switch (t_class)
|
|
||||||
{
|
|
||||||
case thread_class::ppu: return g_cfg.core.ppu_decoder != ppu_decoder_type::llvm;
|
|
||||||
case thread_class::spu: return g_cfg.core.spu_decoder != spu_decoder_type::asmjit && g_cfg.core.spu_decoder != spu_decoder_type::llvm;
|
|
||||||
default: return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
extern std::shared_ptr<CPUDisAsm> make_disasm(const cpu_thread* cpu, shared_ptr<cpu_thread> handle)
|
extern std::shared_ptr<CPUDisAsm> make_disasm(const cpu_thread* cpu, shared_ptr<cpu_thread> handle);
|
||||||
{
|
|
||||||
if (!handle)
|
|
||||||
{
|
|
||||||
switch (cpu->get_class())
|
|
||||||
{
|
|
||||||
case thread_class::ppu: handle = idm::get_unlocked<named_thread<ppu_thread>>(cpu->id); break;
|
|
||||||
case thread_class::spu: handle = idm::get_unlocked<named_thread<spu_thread>>(cpu->id); break;
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<CPUDisAsm> result;
|
|
||||||
|
|
||||||
switch (cpu->get_class())
|
|
||||||
{
|
|
||||||
case thread_class::ppu: result = std::make_shared<PPUDisAsm>(cpu_disasm_mode::interpreter, vm::g_sudo_addr); break;
|
|
||||||
case thread_class::spu: result = std::make_shared<SPUDisAsm>(cpu_disasm_mode::interpreter, static_cast<const spu_thread*>(cpu)->ls); break;
|
|
||||||
case thread_class::rsx: result = std::make_shared<RSXDisAsm>(cpu_disasm_mode::interpreter, vm::g_sudo_addr, 0, cpu); break;
|
|
||||||
default: return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
result->set_cpu_handle(std::move(handle));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
debugger_frame::debugger_frame(std::shared_ptr<gui_settings> gui_settings, QWidget *parent)
|
debugger_frame::debugger_frame(std::shared_ptr<gui_settings> gui_settings, QWidget *parent)
|
||||||
: custom_dock_widget(tr("Debugger [Press F1 for Help]"), parent)
|
: custom_dock_widget(tr("Debugger [Press F1 for Help]"), parent)
|
||||||
|
|
47
rpcs3/util/emu_utils.cpp
Normal file
47
rpcs3/util/emu_utils.cpp
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
#include "Emu/IdManager.h"
|
||||||
|
#include "Emu/system_config.h"
|
||||||
|
#include "Emu/Cell/PPUDisAsm.h"
|
||||||
|
#include "Emu/Cell/SPUDisAsm.h"
|
||||||
|
#include "Emu/Cell/SPUThread.h"
|
||||||
|
#include "Emu/Cell/PPUThread.h"
|
||||||
|
#include "Emu/RSX/RSXDisAsm.h"
|
||||||
|
#include "Emu/Memory/vm.h"
|
||||||
|
#include "Utilities/Thread.h"
|
||||||
|
|
||||||
|
bool is_using_interpreter(thread_class t_class)
|
||||||
|
{
|
||||||
|
switch (t_class)
|
||||||
|
{
|
||||||
|
case thread_class::ppu: return g_cfg.core.ppu_decoder != ppu_decoder_type::llvm;
|
||||||
|
case thread_class::spu: return g_cfg.core.spu_decoder != spu_decoder_type::asmjit && g_cfg.core.spu_decoder != spu_decoder_type::llvm;
|
||||||
|
default: return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<CPUDisAsm> make_disasm(const cpu_thread* cpu, shared_ptr<cpu_thread> handle)
|
||||||
|
{
|
||||||
|
if (!handle)
|
||||||
|
{
|
||||||
|
switch (cpu->get_class())
|
||||||
|
{
|
||||||
|
case thread_class::ppu: handle = idm::get_unlocked<named_thread<ppu_thread>>(cpu->id); break;
|
||||||
|
case thread_class::spu: handle = idm::get_unlocked<named_thread<spu_thread>>(cpu->id); break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<CPUDisAsm> result;
|
||||||
|
|
||||||
|
switch (cpu->get_class())
|
||||||
|
{
|
||||||
|
case thread_class::ppu: result = std::make_shared<PPUDisAsm>(cpu_disasm_mode::interpreter, vm::g_sudo_addr); break;
|
||||||
|
case thread_class::spu: result = std::make_shared<SPUDisAsm>(cpu_disasm_mode::interpreter, static_cast<const spu_thread*>(cpu)->ls); break;
|
||||||
|
case thread_class::rsx: result = std::make_shared<RSXDisAsm>(cpu_disasm_mode::interpreter, vm::g_sudo_addr, 0, cpu); break;
|
||||||
|
default: return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
result->set_cpu_handle(std::move(handle));
|
||||||
|
return result;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue