mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-03 14:49:22 +00:00
Addressing feedback from the PR
1. using fmt::format instead of std 2. naming convention text_code instead of textCode 3. Removed temporary scope for CPUThreadGuard
This commit is contained in:
parent
c0d2295d4e
commit
d6066f190c
1 changed files with 7 additions and 9 deletions
|
@ -831,25 +831,23 @@ void CodeViewWidget::OnCopyWholeLine()
|
||||||
{
|
{
|
||||||
const u32 addr = GetContextAddress();
|
const u32 addr = GetContextAddress();
|
||||||
|
|
||||||
const std::string textCode = [this, addr] {
|
Core::CPUThreadGuard guard(m_system);
|
||||||
Core::CPUThreadGuard guard(m_system);
|
|
||||||
return m_system.GetPowerPC().GetDebugInterface().Disassemble(&guard, addr);
|
|
||||||
}();
|
|
||||||
|
|
||||||
std::string wholeLineText = std::format("{:08x} {}", addr, textCode);
|
std::string text_code = m_system.GetPowerPC().GetDebugInterface().Disassemble(&guard, addr);
|
||||||
|
std::string whole_line = fmt::format("{:08x} {}", addr, text_code);
|
||||||
|
|
||||||
if (IsInstructionLoadStore(textCode))
|
if (IsInstructionLoadStore(text_code))
|
||||||
{
|
{
|
||||||
const std::optional<u32> target_addr =
|
const std::optional<u32> target_addr =
|
||||||
m_system.GetPowerPC().GetDebugInterface().GetMemoryAddressFromInstruction(textCode);
|
m_system.GetPowerPC().GetDebugInterface().GetMemoryAddressFromInstruction(text_code);
|
||||||
|
|
||||||
if (target_addr)
|
if (target_addr)
|
||||||
{
|
{
|
||||||
wholeLineText += std::format(" targetting {:08x}", *target_addr);
|
whole_line += fmt::format(" targetting {:08x}", *target_addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QApplication::clipboard()->setText(QString::fromStdString(wholeLineText));
|
QApplication::clipboard()->setText(QString::fromStdString(whole_line));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeViewWidget::OnCopyFunction()
|
void CodeViewWidget::OnCopyFunction()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue