Skip to content

Commit

Permalink
Fixed nits
Browse files Browse the repository at this point in the history
  • Loading branch information
theIDinside committed Nov 19, 2024
1 parent 25c7506 commit 1155d34
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
8 changes: 5 additions & 3 deletions src/TargetDescription.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- Mode: C++; tab-width: 8; c-basic-offset: 2; indent-tabs-mode: nil; -*- */

#include "TargetDescription.h"
#include "GdbServerConnection.h"
#include "kernel_abi.h"
Expand All @@ -7,13 +9,13 @@ namespace rr {

class FeatureStream {
public:
std::string result() { return stream.str(); }
string result() { return stream.str(); }

template <typename Any>
friend FeatureStream& operator<<(FeatureStream& stream, Any any);

private:
std::stringstream stream;
stringstream stream;
const char* arch_prefix;
};

Expand Down Expand Up @@ -115,7 +117,7 @@ static const char header[] = R"(<?xml version="1.0"?>
<target>
)";

std::string TargetDescription::to_xml() const {
string TargetDescription::to_xml() const {
FeatureStream fs;
fs << header << arch << "<osabi>GNU/Linux</osabi>\n";
for (const auto feature : target_features) {
Expand Down
23 changes: 15 additions & 8 deletions src/TargetDescription.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#pragma once
/* -*- Mode: C++; tab-width: 8; c-basic-offset: 2; indent-tabs-mode: nil; -*- */

#ifndef RR_TARGET_DESCRIPTION_H_
#define RR_TARGET_DESCRIPTION_H_

#include "kernel_abi.h"
#include <cstdint>

namespace rr {
using namespace std;

struct GdbServerRegisterValue;
namespace rr {

enum class TargetFeature : uint32_t {
Core = 0,
Expand All @@ -17,11 +21,14 @@ enum class TargetFeature : uint32_t {
};

class TargetDescription {
SupportedArch arch;
std::vector<TargetFeature> target_features;

public:
explicit TargetDescription(rr::SupportedArch arch, uint32_t cpu_features);
std::string to_xml() const;
string to_xml() const;

private:
SupportedArch arch;
vector<TargetFeature> target_features;
};
} // namespace rr
} // namespace rr

#endif /* RR_TARGET_DESCRIPTION_H_ */

0 comments on commit 1155d34

Please sign in to comment.