More style.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
namespace xe {
|
||||
namespace debug {
|
||||
|
||||
using namespace xe::debug::proto;
|
||||
using namespace xe::debug::proto; // NOLINT(build/namespaces)
|
||||
|
||||
constexpr size_t kReceiveBufferSize = 1 * 1024 * 1024;
|
||||
constexpr size_t kTransmitBufferSize = 1 * 1024 * 1024;
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "xenia/base/socket.h"
|
||||
#include "xenia/base/threading.h"
|
||||
|
||||
@@ -24,8 +24,11 @@ DEFINE_int32(debug_server_port, 9002, "Debugger XDP server TCP port.");
|
||||
namespace xe {
|
||||
namespace debug {
|
||||
|
||||
using namespace xe::debug::proto;
|
||||
using namespace xe::kernel;
|
||||
using namespace xe::debug::proto; // NOLINT(build/namespaces)
|
||||
|
||||
using xe::kernel::XModule;
|
||||
using xe::kernel::XObject;
|
||||
using xe::kernel::XThread;
|
||||
|
||||
constexpr size_t kReceiveBufferSize = 32 * 1024;
|
||||
constexpr size_t kReadBufferSize = 1 * 1024 * 1024;
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "xenia/base/socket.h"
|
||||
#include "xenia/base/threading.h"
|
||||
@@ -31,7 +33,7 @@ class Debugger;
|
||||
|
||||
class DebugServer {
|
||||
public:
|
||||
DebugServer(Debugger* debugger);
|
||||
explicit DebugServer(Debugger* debugger);
|
||||
~DebugServer();
|
||||
|
||||
Debugger* debugger() const { return debugger_; }
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <gflags/gflags.h>
|
||||
|
||||
#include <mutex>
|
||||
#include <utility>
|
||||
|
||||
#include "xenia/base/filesystem.h"
|
||||
#include "xenia/base/logging.h"
|
||||
@@ -44,9 +45,9 @@ DEFINE_bool(exit_with_debugger, true, "Exit whe the debugger disconnects.");
|
||||
namespace xe {
|
||||
namespace debug {
|
||||
|
||||
using namespace xe::kernel;
|
||||
|
||||
using xe::cpu::ThreadState;
|
||||
using xe::kernel::XObject;
|
||||
using xe::kernel::XThread;
|
||||
|
||||
Breakpoint::Breakpoint(Type type, uint32_t address)
|
||||
: type_(type), address_(address) {}
|
||||
@@ -235,10 +236,10 @@ int Debugger::RemoveBreakpoint(Breakpoint* breakpoint) {
|
||||
}
|
||||
|
||||
void Debugger::FindBreakpoints(uint32_t address,
|
||||
std::vector<Breakpoint*>& out_breakpoints) {
|
||||
std::vector<Breakpoint*>* out_breakpoints) {
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex_);
|
||||
|
||||
out_breakpoints.clear();
|
||||
out_breakpoints->clear();
|
||||
|
||||
auto range = breakpoints_.equal_range(address);
|
||||
if (range.first == range.second) {
|
||||
@@ -247,7 +248,7 @@ void Debugger::FindBreakpoints(uint32_t address,
|
||||
|
||||
for (auto it = range.first; it != range.second; ++it) {
|
||||
Breakpoint* breakpoint = it->second;
|
||||
out_breakpoints.push_back(breakpoint);
|
||||
out_breakpoints->push_back(breakpoint);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ enum class ExecutionState {
|
||||
|
||||
class Debugger {
|
||||
public:
|
||||
Debugger(Emulator* emulator);
|
||||
explicit Debugger(Emulator* emulator);
|
||||
~Debugger();
|
||||
|
||||
Emulator* emulator() const { return emulator_; }
|
||||
@@ -69,7 +69,7 @@ class Debugger {
|
||||
int AddBreakpoint(Breakpoint* breakpoint);
|
||||
int RemoveBreakpoint(Breakpoint* breakpoint);
|
||||
void FindBreakpoints(uint32_t address,
|
||||
std::vector<Breakpoint*>& out_breakpoints);
|
||||
std::vector<Breakpoint*>* out_breakpoints);
|
||||
|
||||
// TODO(benvanik): utility functions for modification (make function ignored,
|
||||
// etc).
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace proto {
|
||||
|
||||
class PacketReader {
|
||||
public:
|
||||
PacketReader(size_t buffer_capacity) : buffer_(buffer_capacity) {}
|
||||
explicit PacketReader(size_t buffer_capacity) : buffer_(buffer_capacity) {}
|
||||
|
||||
const uint8_t* buffer() { return buffer_.data(); }
|
||||
size_t buffer_capacity() const { return buffer_.size(); }
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace proto {
|
||||
|
||||
class PacketWriter {
|
||||
public:
|
||||
PacketWriter(size_t buffer_capacity) : buffer_(buffer_capacity) {}
|
||||
explicit PacketWriter(size_t buffer_capacity) : buffer_(buffer_capacity) {}
|
||||
|
||||
uint8_t* buffer() { return buffer_.data(); }
|
||||
size_t buffer_capacity() const { return buffer_.size(); }
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace proto {
|
||||
|
||||
struct varint_t {
|
||||
varint_t() = default;
|
||||
varint_t(uint64_t value) : value_(value) {}
|
||||
varint_t(uint64_t value) : value_(value) {} // NOLINT(runtime/explicit)
|
||||
varint_t(const varint_t& other) : value_(other.value_) {}
|
||||
|
||||
operator uint64_t() const { return value_; }
|
||||
|
||||
@@ -42,9 +42,9 @@ bool MainWindow::Initialize() {
|
||||
|
||||
window_->on_closed.AddListener(std::bind(&MainWindow::OnClose, this));
|
||||
|
||||
window_->on_key_down.AddListener([this](xe::ui::KeyEvent& e) {
|
||||
window_->on_key_down.AddListener([this](xe::ui::KeyEvent* e) {
|
||||
bool handled = true;
|
||||
switch (e.key_code()) {
|
||||
switch (e->key_code()) {
|
||||
case 0x1B: { // VK_ESCAPE
|
||||
// Allow users to escape fullscreen (but not enter it).
|
||||
if (window_->is_fullscreen()) {
|
||||
@@ -58,7 +58,7 @@ bool MainWindow::Initialize() {
|
||||
|
||||
default: { handled = false; } break;
|
||||
}
|
||||
e.set_handled(handled);
|
||||
e->set_handled(handled);
|
||||
});
|
||||
|
||||
// Main menu.
|
||||
@@ -93,7 +93,7 @@ bool MainWindow::Initialize() {
|
||||
}
|
||||
|
||||
void MainWindow::BuildUI() {
|
||||
using namespace el::dsl;
|
||||
using namespace el::dsl; // NOLINT(build/namespaces)
|
||||
el::AnimationBlocker animation_blocker;
|
||||
|
||||
auto root_element = window_->root_element();
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace ui {
|
||||
|
||||
class MainWindow {
|
||||
public:
|
||||
MainWindow(Application* app);
|
||||
explicit MainWindow(Application* app);
|
||||
~MainWindow();
|
||||
|
||||
Application* app() const { return app_; }
|
||||
|
||||
@@ -24,7 +24,7 @@ class System;
|
||||
|
||||
class Module {
|
||||
public:
|
||||
Module(System* system) : system_(system) {}
|
||||
explicit Module(System* system) : system_(system) {}
|
||||
|
||||
bool is_dead() const { return is_dead_; }
|
||||
void set_dead(bool is_dead) { is_dead_ = is_dead; }
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace debug {
|
||||
namespace ui {
|
||||
namespace model {
|
||||
|
||||
using namespace xe::debug::proto;
|
||||
using namespace xe::debug::proto; // NOLINT(build/namespaces)
|
||||
|
||||
System::System(xe::ui::Loop* loop, DebugClient* client)
|
||||
: loop_(loop), client_(client) {
|
||||
|
||||
@@ -36,7 +36,7 @@ class View {
|
||||
virtual void Setup(xe::debug::DebugClient* client) = 0;
|
||||
|
||||
protected:
|
||||
View(std::string name) : name_(name) {}
|
||||
explicit View(std::string name) : name_(name) {}
|
||||
|
||||
std::string name_;
|
||||
el::LayoutBox root_element_;
|
||||
|
||||
@@ -22,7 +22,7 @@ CpuView::CpuView() : View("CPU") {}
|
||||
CpuView::~CpuView() = default;
|
||||
|
||||
el::Element* CpuView::BuildUI() {
|
||||
using namespace el::dsl;
|
||||
using namespace el::dsl; // NOLINT(build/namespaces)
|
||||
el::AnimationBlocker animation_blocker;
|
||||
|
||||
auto functions_node =
|
||||
@@ -197,7 +197,7 @@ void CpuView::UpdateModuleList() {
|
||||
module_items->push_back(std::move(item));
|
||||
}
|
||||
if (is_first) {
|
||||
module_dropdown->set_value(int(module_items->size() - 1));
|
||||
module_dropdown->set_value(static_cast<int>(module_items->size() - 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ void CpuView::UpdateThreadList() {
|
||||
thread_items->push_back(std::move(item));
|
||||
}
|
||||
if (is_first) {
|
||||
thread_dropdown->set_value(int(thread_items->size() - 1));
|
||||
thread_dropdown->set_value(static_cast<int>(thread_items->size() - 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ GpuView::GpuView() : View("GPU") {}
|
||||
GpuView::~GpuView() = default;
|
||||
|
||||
el::Element* GpuView::BuildUI() {
|
||||
using namespace el::dsl;
|
||||
using namespace el::dsl; // NOLINT(build/namespaces)
|
||||
el::AnimationBlocker animation_blocker;
|
||||
|
||||
auto node = LabelNode("TODO");
|
||||
|
||||
Reference in New Issue
Block a user