Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9561 from sepalani/fix-watches
Watches: Fix Save and Load from strings
  • Loading branch information
leoetlino committed Mar 4, 2021
2 parents 19c5a19 + 6786340 commit 1e3e568
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Source/Core/Common/Debug/Watches.cpp
Expand Up @@ -5,6 +5,7 @@
#include "Common/Debug/Watches.h"

#include <algorithm>
#include <locale>
#include <sstream>

namespace Common::Debug
Expand Down Expand Up @@ -88,11 +89,11 @@ void Watches::LoadFromStrings(const std::vector<std::string>& watches)
{
for (const std::string& watch : watches)
{
std::stringstream ss;
std::istringstream ss(watch);
ss.imbue(std::locale::classic());
u32 address;
std::string name;
ss << std::hex << watch;
ss >> address;
ss >> std::hex >> address;
ss >> std::ws;
std::getline(ss, name);
SetWatch(address, name);
Expand All @@ -105,6 +106,7 @@ std::vector<std::string> Watches::SaveToStrings() const
for (const auto& watch : m_watches)
{
std::ostringstream ss;
ss.imbue(std::locale::classic());
ss << std::hex << watch.address << " " << watch.name;
watches.push_back(ss.str());
}
Expand Down

0 comments on commit 1e3e568

Please sign in to comment.