Formatting: force pointers to the left side.

This commit is contained in:
Ben Vanik 2015-06-30 16:16:33 -07:00
parent 90e86d0172
commit d7a5c74bf3
12 changed files with 478 additions and 481 deletions

View File

@ -1,2 +1,4 @@
--- ---
BasedOnStyle: Google BasedOnStyle: Google
DerivePointerAlignment: false
PointerAlignment: Left

View File

@ -52,7 +52,7 @@ XmaContext::~XmaContext() {
} }
} }
int XmaContext::Setup(uint32_t id, Memory *memory, uint32_t guest_ptr) { int XmaContext::Setup(uint32_t id, Memory* memory, uint32_t guest_ptr) {
id_ = id; id_ = id;
memory_ = memory; memory_ = memory;
guest_ptr_ = guest_ptr; guest_ptr_ = guest_ptr;
@ -94,7 +94,7 @@ int XmaContext::Setup(uint32_t id, Memory *memory, uint32_t guest_ptr) {
extra_data_.decode_flags = 0x10D6; extra_data_.decode_flags = 0x10D6;
context_->extradata_size = sizeof(extra_data_); context_->extradata_size = sizeof(extra_data_);
context_->extradata = (uint8_t *)&extra_data_; context_->extradata = (uint8_t*)&extra_data_;
// Current frame stuff whatever // Current frame stuff whatever
// samples per frame * 2 max channels * output bytes // samples per frame * 2 max channels * output bytes
@ -204,7 +204,7 @@ int XmaContext::GetSampleRate(int id) {
return 0; return 0;
} }
void XmaContext::DecodePackets(XMA_CONTEXT_DATA &data) { void XmaContext::DecodePackets(XMA_CONTEXT_DATA& data) {
SCOPE_profile_cpu_f("apu"); SCOPE_profile_cpu_f("apu");
// What I see: // What I see:
@ -236,7 +236,7 @@ void XmaContext::DecodePackets(XMA_CONTEXT_DATA &data) {
// Output buffers are in raw PCM samples, 256 bytes per block. // Output buffers are in raw PCM samples, 256 bytes per block.
// Output buffer is a ring buffer. We need to write from the write offset // Output buffer is a ring buffer. We need to write from the write offset
// to the read offset. // to the read offset.
uint8_t *output_buffer = memory()->TranslatePhysical(data.output_buffer_ptr); uint8_t* output_buffer = memory()->TranslatePhysical(data.output_buffer_ptr);
uint32_t output_capacity = data.output_buffer_block_count * kBytesPerSubframe; uint32_t output_capacity = data.output_buffer_block_count * kBytesPerSubframe;
uint32_t output_read_offset = uint32_t output_read_offset =
data.output_buffer_read_offset * kBytesPerSubframe; data.output_buffer_read_offset * kBytesPerSubframe;
@ -315,12 +315,12 @@ void XmaContext::DecodePackets(XMA_CONTEXT_DATA &data) {
data.output_buffer_valid = 0; data.output_buffer_valid = 0;
} }
int XmaContext::StartPacket(XMA_CONTEXT_DATA &data) { int XmaContext::StartPacket(XMA_CONTEXT_DATA& data) {
// Translate pointers for future use. // Translate pointers for future use.
uint8_t *in0 = data.input_buffer_0_valid uint8_t* in0 = data.input_buffer_0_valid
? memory()->TranslatePhysical(data.input_buffer_0_ptr) ? memory()->TranslatePhysical(data.input_buffer_0_ptr)
: nullptr; : nullptr;
uint8_t *in1 = data.input_buffer_1_valid uint8_t* in1 = data.input_buffer_1_valid
? memory()->TranslatePhysical(data.input_buffer_1_ptr) ? memory()->TranslatePhysical(data.input_buffer_1_ptr)
: nullptr; : nullptr;
@ -373,7 +373,7 @@ int XmaContext::StartPacket(XMA_CONTEXT_DATA &data) {
return input_remaining_bytes; return input_remaining_bytes;
} }
int XmaContext::PreparePacket(uint8_t *input, size_t seq_offset, size_t size, int XmaContext::PreparePacket(uint8_t* input, size_t seq_offset, size_t size,
int sample_rate, int channels) { int sample_rate, int channels) {
if (size != kBytesPerPacket) { if (size != kBytesPerPacket) {
// Invalid packet size! // Invalid packet size!
@ -388,8 +388,8 @@ int XmaContext::PreparePacket(uint8_t *input, size_t seq_offset, size_t size,
std::memcpy(packet_data_, input, size); std::memcpy(packet_data_, input, size);
// Modify the packet header so it's WMAPro compatible // Modify the packet header so it's WMAPro compatible
*((int *)packet_data_) = (((seq_offset & 0x7800) | 0x400) >> 7) | *((int*)packet_data_) = (((seq_offset & 0x7800) | 0x400) >> 7) |
(*((int *)packet_data_) & 0xFFFEFF08); (*((int*)packet_data_) & 0xFFFEFF08);
packet_->data = packet_data_; packet_->data = packet_data_;
packet_->size = kBytesPerPacket; packet_->size = kBytesPerPacket;
@ -422,7 +422,7 @@ void XmaContext::DiscardPacket() {
} }
} }
int XmaContext::DecodePacket(uint8_t *output, size_t output_offset, int XmaContext::DecodePacket(uint8_t* output, size_t output_offset,
size_t output_size) { size_t output_size) {
size_t to_copy = 0; size_t to_copy = 0;
size_t original_offset = output_offset; size_t original_offset = output_offset;
@ -478,7 +478,7 @@ int XmaContext::DecodePacket(uint8_t *output, size_t output_offset,
for (int i = 0; i < decoded_frame_->nb_samples; i++) { for (int i = 0; i < decoded_frame_->nb_samples; i++) {
for (int j = 0; j < context_->channels; j++) { for (int j = 0; j < context_->channels; j++) {
// Select the appropriate array based on the current channel. // Select the appropriate array based on the current channel.
float *sample_array = (float *)decoded_frame_->data[j]; float* sample_array = (float*)decoded_frame_->data[j];
// Raw sample should be within [-1, 1]. // Raw sample should be within [-1, 1].
// Clamp it, just in case. // Clamp it, just in case.

View File

@ -61,12 +61,12 @@ inline uint64_t byte_swap(uint64_t value) {
return XENIA_BASE_BYTE_SWAP_64(value); return XENIA_BASE_BYTE_SWAP_64(value);
} }
inline float byte_swap(float value) { inline float byte_swap(float value) {
uint32_t temp = byte_swap(*reinterpret_cast<uint32_t *>(&value)); uint32_t temp = byte_swap(*reinterpret_cast<uint32_t*>(&value));
return *reinterpret_cast<float *>(&temp); return *reinterpret_cast<float*>(&temp);
} }
inline double byte_swap(double value) { inline double byte_swap(double value) {
uint64_t temp = byte_swap(*reinterpret_cast<uint64_t *>(&value)); uint64_t temp = byte_swap(*reinterpret_cast<uint64_t*>(&value));
return *reinterpret_cast<double *>(&temp); return *reinterpret_cast<double*>(&temp);
} }
template <typename T> template <typename T>
inline T byte_swap(T value) { inline T byte_swap(T value) {
@ -80,19 +80,19 @@ inline T byte_swap(T value) {
template <typename T> template <typename T>
struct be { struct be {
be() = default; be() = default;
be(const T &src) : value(xe::byte_swap(src)) {} be(const T& src) : value(xe::byte_swap(src)) {}
be(const be &other) { value = other.value; } be(const be& other) { value = other.value; }
operator T() const { return xe::byte_swap(value); } operator T() const { return xe::byte_swap(value); }
be<T> &operator+=(int a) { be<T>& operator+=(int a) {
*this = *this + a; *this = *this + a;
return *this; return *this;
} }
be<T> &operator-=(int a) { be<T>& operator-=(int a) {
*this = *this - a; *this = *this - a;
return *this; return *this;
} }
be<T> &operator++() { be<T>& operator++() {
*this += 1; *this += 1;
return *this; return *this;
} // ++a } // ++a
@ -100,7 +100,7 @@ struct be {
*this += 1; *this += 1;
return (*this - 1); return (*this - 1);
} // a++ } // a++
be<T> &operator--() { be<T>& operator--() {
*this -= 1; *this -= 1;
return *this; return *this;
} // --a } // --a

View File

@ -25,7 +25,7 @@ bool IsDebuggerAttached();
// If no debugger is present, a signal will be raised. // If no debugger is present, a signal will be raised.
void Break(); void Break();
void DebugPrint(const char *fmt, ...); void DebugPrint(const char* fmt, ...);
} // namespace debugging } // namespace debugging
} // namespace xe } // namespace xe

View File

@ -19,7 +19,7 @@ bool IsDebuggerAttached() { return IsDebuggerPresent() ? true : false; }
void Break() { __debugbreak(); } void Break() { __debugbreak(); }
void DebugPrint(const char *fmt, ...) { void DebugPrint(const char* fmt, ...) {
StringBuffer buff; StringBuffer buff;
va_list va; va_list va;

View File

@ -16,7 +16,7 @@ namespace xe {
// Copyright (c) Microsoft Corporation. All rights reserved. // Copyright (c) Microsoft Corporation. All rights reserved.
uint16_t float_to_half(float value) { uint16_t float_to_half(float value) {
uint32_t Result; uint32_t Result;
uint32_t IValue = ((uint32_t *)(&value))[0]; uint32_t IValue = ((uint32_t*)(&value))[0];
uint32_t Sign = (IValue & 0x80000000U) >> 16U; uint32_t Sign = (IValue & 0x80000000U) >> 16U;
IValue = IValue & 0x7FFFFFFFU; // Hack off the sign IValue = IValue & 0x7FFFFFFFU; // Hack off the sign
if (IValue > 0x47FFEFFFU) { if (IValue > 0x47FFEFFFU) {
@ -63,7 +63,7 @@ float half_to_float(uint16_t value) {
uint32_t Result = ((value & 0x8000) << 16) | // Sign uint32_t Result = ((value & 0x8000) << 16) | // Sign
((Exponent + 112) << 23) | // Exponent ((Exponent + 112) << 23) | // Exponent
(Mantissa << 13); // Mantissa (Mantissa << 13); // Mantissa
return *(float *)&Result; return *(float*)&Result;
} }
} // namespace xe } // namespace xe

View File

@ -43,20 +43,20 @@ STRUCT_END(Breakpoint, 4);
struct ListBreakpointsRequest FLATBUFFERS_FINAL_CLASS struct ListBreakpointsRequest FLATBUFFERS_FINAL_CLASS
: private flatbuffers::Table { : private flatbuffers::Table {
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && verifier.EndTable(); return VerifyTableStart(verifier) && verifier.EndTable();
} }
}; };
struct ListBreakpointsRequestBuilder { struct ListBreakpointsRequestBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
ListBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) ListBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb)
: fbb_(_fbb) { : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
ListBreakpointsRequestBuilder &operator=( ListBreakpointsRequestBuilder& operator=(
const ListBreakpointsRequestBuilder &); const ListBreakpointsRequestBuilder&);
flatbuffers::Offset<ListBreakpointsRequest> Finish() { flatbuffers::Offset<ListBreakpointsRequest> Finish() {
auto o = auto o =
flatbuffers::Offset<ListBreakpointsRequest>(fbb_.EndTable(start_, 0)); flatbuffers::Offset<ListBreakpointsRequest>(fbb_.EndTable(start_, 0));
@ -65,17 +65,17 @@ struct ListBreakpointsRequestBuilder {
}; };
inline flatbuffers::Offset<ListBreakpointsRequest> CreateListBreakpointsRequest( inline flatbuffers::Offset<ListBreakpointsRequest> CreateListBreakpointsRequest(
flatbuffers::FlatBufferBuilder &_fbb) { flatbuffers::FlatBufferBuilder& _fbb) {
ListBreakpointsRequestBuilder builder_(_fbb); ListBreakpointsRequestBuilder builder_(_fbb);
return builder_.Finish(); return builder_.Finish();
} }
struct ListBreakpointsResponse FLATBUFFERS_FINAL_CLASS struct ListBreakpointsResponse FLATBUFFERS_FINAL_CLASS
: private flatbuffers::Table { : private flatbuffers::Table {
const flatbuffers::Vector<const Breakpoint *> *breakpoints() const { const flatbuffers::Vector<const Breakpoint*>* breakpoints() const {
return GetPointer<const flatbuffers::Vector<const Breakpoint *> *>(4); return GetPointer<const flatbuffers::Vector<const Breakpoint*>*>(4);
} }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* breakpoints */) && VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* breakpoints */) &&
verifier.Verify(breakpoints()) && verifier.EndTable(); verifier.Verify(breakpoints()) && verifier.EndTable();
@ -83,18 +83,18 @@ struct ListBreakpointsResponse FLATBUFFERS_FINAL_CLASS
}; };
struct ListBreakpointsResponseBuilder { struct ListBreakpointsResponseBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_breakpoints(flatbuffers::Offset< void add_breakpoints(
flatbuffers::Vector<const Breakpoint *>> breakpoints) { flatbuffers::Offset<flatbuffers::Vector<const Breakpoint*>> breakpoints) {
fbb_.AddOffset(4, breakpoints); fbb_.AddOffset(4, breakpoints);
} }
ListBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) ListBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb)
: fbb_(_fbb) { : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
ListBreakpointsResponseBuilder &operator=( ListBreakpointsResponseBuilder& operator=(
const ListBreakpointsResponseBuilder &); const ListBreakpointsResponseBuilder&);
flatbuffers::Offset<ListBreakpointsResponse> Finish() { flatbuffers::Offset<ListBreakpointsResponse> Finish() {
auto o = auto o =
flatbuffers::Offset<ListBreakpointsResponse>(fbb_.EndTable(start_, 1)); flatbuffers::Offset<ListBreakpointsResponse>(fbb_.EndTable(start_, 1));
@ -104,8 +104,8 @@ struct ListBreakpointsResponseBuilder {
inline flatbuffers::Offset<ListBreakpointsResponse> inline flatbuffers::Offset<ListBreakpointsResponse>
CreateListBreakpointsResponse( CreateListBreakpointsResponse(
flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::FlatBufferBuilder& _fbb,
flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints = flatbuffers::Offset<flatbuffers::Vector<const Breakpoint*>> breakpoints =
0) { 0) {
ListBreakpointsResponseBuilder builder_(_fbb); ListBreakpointsResponseBuilder builder_(_fbb);
builder_.add_breakpoints(breakpoints); builder_.add_breakpoints(breakpoints);
@ -114,10 +114,10 @@ CreateListBreakpointsResponse(
struct AddBreakpointsRequest FLATBUFFERS_FINAL_CLASS struct AddBreakpointsRequest FLATBUFFERS_FINAL_CLASS
: private flatbuffers::Table { : private flatbuffers::Table {
const flatbuffers::Vector<const Breakpoint *> *breakpoints() const { const flatbuffers::Vector<const Breakpoint*>* breakpoints() const {
return GetPointer<const flatbuffers::Vector<const Breakpoint *> *>(4); return GetPointer<const flatbuffers::Vector<const Breakpoint*>*>(4);
} }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* breakpoints */) && VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* breakpoints */) &&
verifier.Verify(breakpoints()) && verifier.EndTable(); verifier.Verify(breakpoints()) && verifier.EndTable();
@ -125,17 +125,17 @@ struct AddBreakpointsRequest FLATBUFFERS_FINAL_CLASS
}; };
struct AddBreakpointsRequestBuilder { struct AddBreakpointsRequestBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_breakpoints(flatbuffers::Offset< void add_breakpoints(
flatbuffers::Vector<const Breakpoint *>> breakpoints) { flatbuffers::Offset<flatbuffers::Vector<const Breakpoint*>> breakpoints) {
fbb_.AddOffset(4, breakpoints); fbb_.AddOffset(4, breakpoints);
} }
AddBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) AddBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb)
: fbb_(_fbb) { : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
AddBreakpointsRequestBuilder &operator=(const AddBreakpointsRequestBuilder &); AddBreakpointsRequestBuilder& operator=(const AddBreakpointsRequestBuilder&);
flatbuffers::Offset<AddBreakpointsRequest> Finish() { flatbuffers::Offset<AddBreakpointsRequest> Finish() {
auto o = auto o =
flatbuffers::Offset<AddBreakpointsRequest>(fbb_.EndTable(start_, 1)); flatbuffers::Offset<AddBreakpointsRequest>(fbb_.EndTable(start_, 1));
@ -144,8 +144,8 @@ struct AddBreakpointsRequestBuilder {
}; };
inline flatbuffers::Offset<AddBreakpointsRequest> CreateAddBreakpointsRequest( inline flatbuffers::Offset<AddBreakpointsRequest> CreateAddBreakpointsRequest(
flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::FlatBufferBuilder& _fbb,
flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints = flatbuffers::Offset<flatbuffers::Vector<const Breakpoint*>> breakpoints =
0) { 0) {
AddBreakpointsRequestBuilder builder_(_fbb); AddBreakpointsRequestBuilder builder_(_fbb);
builder_.add_breakpoints(breakpoints); builder_.add_breakpoints(breakpoints);
@ -154,20 +154,20 @@ inline flatbuffers::Offset<AddBreakpointsRequest> CreateAddBreakpointsRequest(
struct AddBreakpointsResponse FLATBUFFERS_FINAL_CLASS struct AddBreakpointsResponse FLATBUFFERS_FINAL_CLASS
: private flatbuffers::Table { : private flatbuffers::Table {
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && verifier.EndTable(); return VerifyTableStart(verifier) && verifier.EndTable();
} }
}; };
struct AddBreakpointsResponseBuilder { struct AddBreakpointsResponseBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
AddBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) AddBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb)
: fbb_(_fbb) { : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
AddBreakpointsResponseBuilder &operator=( AddBreakpointsResponseBuilder& operator=(
const AddBreakpointsResponseBuilder &); const AddBreakpointsResponseBuilder&);
flatbuffers::Offset<AddBreakpointsResponse> Finish() { flatbuffers::Offset<AddBreakpointsResponse> Finish() {
auto o = auto o =
flatbuffers::Offset<AddBreakpointsResponse>(fbb_.EndTable(start_, 0)); flatbuffers::Offset<AddBreakpointsResponse>(fbb_.EndTable(start_, 0));
@ -176,17 +176,17 @@ struct AddBreakpointsResponseBuilder {
}; };
inline flatbuffers::Offset<AddBreakpointsResponse> CreateAddBreakpointsResponse( inline flatbuffers::Offset<AddBreakpointsResponse> CreateAddBreakpointsResponse(
flatbuffers::FlatBufferBuilder &_fbb) { flatbuffers::FlatBufferBuilder& _fbb) {
AddBreakpointsResponseBuilder builder_(_fbb); AddBreakpointsResponseBuilder builder_(_fbb);
return builder_.Finish(); return builder_.Finish();
} }
struct UpdateBreakpointsRequest FLATBUFFERS_FINAL_CLASS struct UpdateBreakpointsRequest FLATBUFFERS_FINAL_CLASS
: private flatbuffers::Table { : private flatbuffers::Table {
const flatbuffers::Vector<const Breakpoint *> *breakpoints() const { const flatbuffers::Vector<const Breakpoint*>* breakpoints() const {
return GetPointer<const flatbuffers::Vector<const Breakpoint *> *>(4); return GetPointer<const flatbuffers::Vector<const Breakpoint*>*>(4);
} }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* breakpoints */) && VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* breakpoints */) &&
verifier.Verify(breakpoints()) && verifier.EndTable(); verifier.Verify(breakpoints()) && verifier.EndTable();
@ -194,18 +194,18 @@ struct UpdateBreakpointsRequest FLATBUFFERS_FINAL_CLASS
}; };
struct UpdateBreakpointsRequestBuilder { struct UpdateBreakpointsRequestBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_breakpoints(flatbuffers::Offset< void add_breakpoints(
flatbuffers::Vector<const Breakpoint *>> breakpoints) { flatbuffers::Offset<flatbuffers::Vector<const Breakpoint*>> breakpoints) {
fbb_.AddOffset(4, breakpoints); fbb_.AddOffset(4, breakpoints);
} }
UpdateBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) UpdateBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb)
: fbb_(_fbb) { : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
UpdateBreakpointsRequestBuilder &operator=( UpdateBreakpointsRequestBuilder& operator=(
const UpdateBreakpointsRequestBuilder &); const UpdateBreakpointsRequestBuilder&);
flatbuffers::Offset<UpdateBreakpointsRequest> Finish() { flatbuffers::Offset<UpdateBreakpointsRequest> Finish() {
auto o = auto o =
flatbuffers::Offset<UpdateBreakpointsRequest>(fbb_.EndTable(start_, 1)); flatbuffers::Offset<UpdateBreakpointsRequest>(fbb_.EndTable(start_, 1));
@ -215,8 +215,8 @@ struct UpdateBreakpointsRequestBuilder {
inline flatbuffers::Offset<UpdateBreakpointsRequest> inline flatbuffers::Offset<UpdateBreakpointsRequest>
CreateUpdateBreakpointsRequest( CreateUpdateBreakpointsRequest(
flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::FlatBufferBuilder& _fbb,
flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints = flatbuffers::Offset<flatbuffers::Vector<const Breakpoint*>> breakpoints =
0) { 0) {
UpdateBreakpointsRequestBuilder builder_(_fbb); UpdateBreakpointsRequestBuilder builder_(_fbb);
builder_.add_breakpoints(breakpoints); builder_.add_breakpoints(breakpoints);
@ -225,20 +225,20 @@ CreateUpdateBreakpointsRequest(
struct UpdateBreakpointsResponse FLATBUFFERS_FINAL_CLASS struct UpdateBreakpointsResponse FLATBUFFERS_FINAL_CLASS
: private flatbuffers::Table { : private flatbuffers::Table {
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && verifier.EndTable(); return VerifyTableStart(verifier) && verifier.EndTable();
} }
}; };
struct UpdateBreakpointsResponseBuilder { struct UpdateBreakpointsResponseBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
UpdateBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) UpdateBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb)
: fbb_(_fbb) { : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
UpdateBreakpointsResponseBuilder &operator=( UpdateBreakpointsResponseBuilder& operator=(
const UpdateBreakpointsResponseBuilder &); const UpdateBreakpointsResponseBuilder&);
flatbuffers::Offset<UpdateBreakpointsResponse> Finish() { flatbuffers::Offset<UpdateBreakpointsResponse> Finish() {
auto o = flatbuffers::Offset<UpdateBreakpointsResponse>( auto o = flatbuffers::Offset<UpdateBreakpointsResponse>(
fbb_.EndTable(start_, 0)); fbb_.EndTable(start_, 0));
@ -247,17 +247,17 @@ struct UpdateBreakpointsResponseBuilder {
}; };
inline flatbuffers::Offset<UpdateBreakpointsResponse> inline flatbuffers::Offset<UpdateBreakpointsResponse>
CreateUpdateBreakpointsResponse(flatbuffers::FlatBufferBuilder &_fbb) { CreateUpdateBreakpointsResponse(flatbuffers::FlatBufferBuilder& _fbb) {
UpdateBreakpointsResponseBuilder builder_(_fbb); UpdateBreakpointsResponseBuilder builder_(_fbb);
return builder_.Finish(); return builder_.Finish();
} }
struct RemoveBreakpointsRequest FLATBUFFERS_FINAL_CLASS struct RemoveBreakpointsRequest FLATBUFFERS_FINAL_CLASS
: private flatbuffers::Table { : private flatbuffers::Table {
const flatbuffers::Vector<const Breakpoint *> *breakpoints() const { const flatbuffers::Vector<const Breakpoint*>* breakpoints() const {
return GetPointer<const flatbuffers::Vector<const Breakpoint *> *>(4); return GetPointer<const flatbuffers::Vector<const Breakpoint*>*>(4);
} }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* breakpoints */) && VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* breakpoints */) &&
verifier.Verify(breakpoints()) && verifier.EndTable(); verifier.Verify(breakpoints()) && verifier.EndTable();
@ -265,18 +265,18 @@ struct RemoveBreakpointsRequest FLATBUFFERS_FINAL_CLASS
}; };
struct RemoveBreakpointsRequestBuilder { struct RemoveBreakpointsRequestBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_breakpoints(flatbuffers::Offset< void add_breakpoints(
flatbuffers::Vector<const Breakpoint *>> breakpoints) { flatbuffers::Offset<flatbuffers::Vector<const Breakpoint*>> breakpoints) {
fbb_.AddOffset(4, breakpoints); fbb_.AddOffset(4, breakpoints);
} }
RemoveBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) RemoveBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb)
: fbb_(_fbb) { : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
RemoveBreakpointsRequestBuilder &operator=( RemoveBreakpointsRequestBuilder& operator=(
const RemoveBreakpointsRequestBuilder &); const RemoveBreakpointsRequestBuilder&);
flatbuffers::Offset<RemoveBreakpointsRequest> Finish() { flatbuffers::Offset<RemoveBreakpointsRequest> Finish() {
auto o = auto o =
flatbuffers::Offset<RemoveBreakpointsRequest>(fbb_.EndTable(start_, 1)); flatbuffers::Offset<RemoveBreakpointsRequest>(fbb_.EndTable(start_, 1));
@ -286,8 +286,8 @@ struct RemoveBreakpointsRequestBuilder {
inline flatbuffers::Offset<RemoveBreakpointsRequest> inline flatbuffers::Offset<RemoveBreakpointsRequest>
CreateRemoveBreakpointsRequest( CreateRemoveBreakpointsRequest(
flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::FlatBufferBuilder& _fbb,
flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints = flatbuffers::Offset<flatbuffers::Vector<const Breakpoint*>> breakpoints =
0) { 0) {
RemoveBreakpointsRequestBuilder builder_(_fbb); RemoveBreakpointsRequestBuilder builder_(_fbb);
builder_.add_breakpoints(breakpoints); builder_.add_breakpoints(breakpoints);
@ -296,20 +296,20 @@ CreateRemoveBreakpointsRequest(
struct RemoveBreakpointsResponse FLATBUFFERS_FINAL_CLASS struct RemoveBreakpointsResponse FLATBUFFERS_FINAL_CLASS
: private flatbuffers::Table { : private flatbuffers::Table {
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && verifier.EndTable(); return VerifyTableStart(verifier) && verifier.EndTable();
} }
}; };
struct RemoveBreakpointsResponseBuilder { struct RemoveBreakpointsResponseBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
RemoveBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) RemoveBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb)
: fbb_(_fbb) { : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
RemoveBreakpointsResponseBuilder &operator=( RemoveBreakpointsResponseBuilder& operator=(
const RemoveBreakpointsResponseBuilder &); const RemoveBreakpointsResponseBuilder&);
flatbuffers::Offset<RemoveBreakpointsResponse> Finish() { flatbuffers::Offset<RemoveBreakpointsResponse> Finish() {
auto o = flatbuffers::Offset<RemoveBreakpointsResponse>( auto o = flatbuffers::Offset<RemoveBreakpointsResponse>(
fbb_.EndTable(start_, 0)); fbb_.EndTable(start_, 0));
@ -318,7 +318,7 @@ struct RemoveBreakpointsResponseBuilder {
}; };
inline flatbuffers::Offset<RemoveBreakpointsResponse> inline flatbuffers::Offset<RemoveBreakpointsResponse>
CreateRemoveBreakpointsResponse(flatbuffers::FlatBufferBuilder &_fbb) { CreateRemoveBreakpointsResponse(flatbuffers::FlatBufferBuilder& _fbb) {
RemoveBreakpointsResponseBuilder builder_(_fbb); RemoveBreakpointsResponseBuilder builder_(_fbb);
return builder_.Finish(); return builder_.Finish();
} }

View File

@ -33,12 +33,12 @@ enum ContinueAction {
ContinueAction_ContinueTo = 1 ContinueAction_ContinueTo = 1
}; };
inline const char **EnumNamesContinueAction() { inline const char** EnumNamesContinueAction() {
static const char *names[] = {"Continue", "ContinueTo", nullptr}; static const char* names[] = {"Continue", "ContinueTo", nullptr};
return names; return names;
} }
inline const char *EnumNameContinueAction(ContinueAction e) { inline const char* EnumNameContinueAction(ContinueAction e) {
return EnumNamesContinueAction()[e]; return EnumNamesContinueAction()[e];
} }
@ -48,28 +48,28 @@ enum StepAction {
StepAction_StepOut = 2 StepAction_StepOut = 2
}; };
inline const char **EnumNamesStepAction() { inline const char** EnumNamesStepAction() {
static const char *names[] = {"StepIn", "StepOver", "StepOut", nullptr}; static const char* names[] = {"StepIn", "StepOver", "StepOut", nullptr};
return names; return names;
} }
inline const char *EnumNameStepAction(StepAction e) { inline const char* EnumNameStepAction(StepAction e) {
return EnumNamesStepAction()[e]; return EnumNamesStepAction()[e];
} }
struct StopRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct StopRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && verifier.EndTable(); return VerifyTableStart(verifier) && verifier.EndTable();
} }
}; };
struct StopRequestBuilder { struct StopRequestBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
StopRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { StopRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
StopRequestBuilder &operator=(const StopRequestBuilder &); StopRequestBuilder& operator=(const StopRequestBuilder&);
flatbuffers::Offset<StopRequest> Finish() { flatbuffers::Offset<StopRequest> Finish() {
auto o = flatbuffers::Offset<StopRequest>(fbb_.EndTable(start_, 0)); auto o = flatbuffers::Offset<StopRequest>(fbb_.EndTable(start_, 0));
return o; return o;
@ -77,24 +77,24 @@ struct StopRequestBuilder {
}; };
inline flatbuffers::Offset<StopRequest> CreateStopRequest( inline flatbuffers::Offset<StopRequest> CreateStopRequest(
flatbuffers::FlatBufferBuilder &_fbb) { flatbuffers::FlatBufferBuilder& _fbb) {
StopRequestBuilder builder_(_fbb); StopRequestBuilder builder_(_fbb);
return builder_.Finish(); return builder_.Finish();
} }
struct StopResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct StopResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && verifier.EndTable(); return VerifyTableStart(verifier) && verifier.EndTable();
} }
}; };
struct StopResponseBuilder { struct StopResponseBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
StopResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { StopResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
StopResponseBuilder &operator=(const StopResponseBuilder &); StopResponseBuilder& operator=(const StopResponseBuilder&);
flatbuffers::Offset<StopResponse> Finish() { flatbuffers::Offset<StopResponse> Finish() {
auto o = flatbuffers::Offset<StopResponse>(fbb_.EndTable(start_, 0)); auto o = flatbuffers::Offset<StopResponse>(fbb_.EndTable(start_, 0));
return o; return o;
@ -102,24 +102,24 @@ struct StopResponseBuilder {
}; };
inline flatbuffers::Offset<StopResponse> CreateStopResponse( inline flatbuffers::Offset<StopResponse> CreateStopResponse(
flatbuffers::FlatBufferBuilder &_fbb) { flatbuffers::FlatBufferBuilder& _fbb) {
StopResponseBuilder builder_(_fbb); StopResponseBuilder builder_(_fbb);
return builder_.Finish(); return builder_.Finish();
} }
struct BreakRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct BreakRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && verifier.EndTable(); return VerifyTableStart(verifier) && verifier.EndTable();
} }
}; };
struct BreakRequestBuilder { struct BreakRequestBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
BreakRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { BreakRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
BreakRequestBuilder &operator=(const BreakRequestBuilder &); BreakRequestBuilder& operator=(const BreakRequestBuilder&);
flatbuffers::Offset<BreakRequest> Finish() { flatbuffers::Offset<BreakRequest> Finish() {
auto o = flatbuffers::Offset<BreakRequest>(fbb_.EndTable(start_, 0)); auto o = flatbuffers::Offset<BreakRequest>(fbb_.EndTable(start_, 0));
return o; return o;
@ -127,24 +127,24 @@ struct BreakRequestBuilder {
}; };
inline flatbuffers::Offset<BreakRequest> CreateBreakRequest( inline flatbuffers::Offset<BreakRequest> CreateBreakRequest(
flatbuffers::FlatBufferBuilder &_fbb) { flatbuffers::FlatBufferBuilder& _fbb) {
BreakRequestBuilder builder_(_fbb); BreakRequestBuilder builder_(_fbb);
return builder_.Finish(); return builder_.Finish();
} }
struct BreakResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct BreakResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && verifier.EndTable(); return VerifyTableStart(verifier) && verifier.EndTable();
} }
}; };
struct BreakResponseBuilder { struct BreakResponseBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
BreakResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { BreakResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
BreakResponseBuilder &operator=(const BreakResponseBuilder &); BreakResponseBuilder& operator=(const BreakResponseBuilder&);
flatbuffers::Offset<BreakResponse> Finish() { flatbuffers::Offset<BreakResponse> Finish() {
auto o = flatbuffers::Offset<BreakResponse>(fbb_.EndTable(start_, 0)); auto o = flatbuffers::Offset<BreakResponse>(fbb_.EndTable(start_, 0));
return o; return o;
@ -152,7 +152,7 @@ struct BreakResponseBuilder {
}; };
inline flatbuffers::Offset<BreakResponse> CreateBreakResponse( inline flatbuffers::Offset<BreakResponse> CreateBreakResponse(
flatbuffers::FlatBufferBuilder &_fbb) { flatbuffers::FlatBufferBuilder& _fbb) {
BreakResponseBuilder builder_(_fbb); BreakResponseBuilder builder_(_fbb);
return builder_.Finish(); return builder_.Finish();
} }
@ -162,7 +162,7 @@ struct ContinueRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
return static_cast<ContinueAction>(GetField<int8_t>(4, 0)); return static_cast<ContinueAction>(GetField<int8_t>(4, 0));
} }
uint32_t target_address() const { return GetField<uint32_t>(6, 0); } uint32_t target_address() const { return GetField<uint32_t>(6, 0); }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<int8_t>(verifier, 4 /* action */) && VerifyField<int8_t>(verifier, 4 /* action */) &&
VerifyField<uint32_t>(verifier, 6 /* target_address */) && VerifyField<uint32_t>(verifier, 6 /* target_address */) &&
@ -171,7 +171,7 @@ struct ContinueRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
}; };
struct ContinueRequestBuilder { struct ContinueRequestBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_action(ContinueAction action) { void add_action(ContinueAction action) {
fbb_.AddElement<int8_t>(4, static_cast<int8_t>(action), 0); fbb_.AddElement<int8_t>(4, static_cast<int8_t>(action), 0);
@ -179,10 +179,10 @@ struct ContinueRequestBuilder {
void add_target_address(uint32_t target_address) { void add_target_address(uint32_t target_address) {
fbb_.AddElement<uint32_t>(6, target_address, 0); fbb_.AddElement<uint32_t>(6, target_address, 0);
} }
ContinueRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { ContinueRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
ContinueRequestBuilder &operator=(const ContinueRequestBuilder &); ContinueRequestBuilder& operator=(const ContinueRequestBuilder&);
flatbuffers::Offset<ContinueRequest> Finish() { flatbuffers::Offset<ContinueRequest> Finish() {
auto o = flatbuffers::Offset<ContinueRequest>(fbb_.EndTable(start_, 2)); auto o = flatbuffers::Offset<ContinueRequest>(fbb_.EndTable(start_, 2));
return o; return o;
@ -190,7 +190,7 @@ struct ContinueRequestBuilder {
}; };
inline flatbuffers::Offset<ContinueRequest> CreateContinueRequest( inline flatbuffers::Offset<ContinueRequest> CreateContinueRequest(
flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::FlatBufferBuilder& _fbb,
ContinueAction action = ContinueAction_Continue, ContinueAction action = ContinueAction_Continue,
uint32_t target_address = 0) { uint32_t target_address = 0) {
ContinueRequestBuilder builder_(_fbb); ContinueRequestBuilder builder_(_fbb);
@ -200,18 +200,18 @@ inline flatbuffers::Offset<ContinueRequest> CreateContinueRequest(
} }
struct ContinueResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct ContinueResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && verifier.EndTable(); return VerifyTableStart(verifier) && verifier.EndTable();
} }
}; };
struct ContinueResponseBuilder { struct ContinueResponseBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
ContinueResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { ContinueResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
ContinueResponseBuilder &operator=(const ContinueResponseBuilder &); ContinueResponseBuilder& operator=(const ContinueResponseBuilder&);
flatbuffers::Offset<ContinueResponse> Finish() { flatbuffers::Offset<ContinueResponse> Finish() {
auto o = flatbuffers::Offset<ContinueResponse>(fbb_.EndTable(start_, 0)); auto o = flatbuffers::Offset<ContinueResponse>(fbb_.EndTable(start_, 0));
return o; return o;
@ -219,7 +219,7 @@ struct ContinueResponseBuilder {
}; };
inline flatbuffers::Offset<ContinueResponse> CreateContinueResponse( inline flatbuffers::Offset<ContinueResponse> CreateContinueResponse(
flatbuffers::FlatBufferBuilder &_fbb) { flatbuffers::FlatBufferBuilder& _fbb) {
ContinueResponseBuilder builder_(_fbb); ContinueResponseBuilder builder_(_fbb);
return builder_.Finish(); return builder_.Finish();
} }
@ -229,7 +229,7 @@ struct StepRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
return static_cast<StepAction>(GetField<int8_t>(4, 0)); return static_cast<StepAction>(GetField<int8_t>(4, 0));
} }
uint32_t thread_id() const { return GetField<uint32_t>(6, 0); } uint32_t thread_id() const { return GetField<uint32_t>(6, 0); }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<int8_t>(verifier, 4 /* action */) && VerifyField<int8_t>(verifier, 4 /* action */) &&
VerifyField<uint32_t>(verifier, 6 /* thread_id */) && VerifyField<uint32_t>(verifier, 6 /* thread_id */) &&
@ -238,7 +238,7 @@ struct StepRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
}; };
struct StepRequestBuilder { struct StepRequestBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_action(StepAction action) { void add_action(StepAction action) {
fbb_.AddElement<int8_t>(4, static_cast<int8_t>(action), 0); fbb_.AddElement<int8_t>(4, static_cast<int8_t>(action), 0);
@ -246,10 +246,10 @@ struct StepRequestBuilder {
void add_thread_id(uint32_t thread_id) { void add_thread_id(uint32_t thread_id) {
fbb_.AddElement<uint32_t>(6, thread_id, 0); fbb_.AddElement<uint32_t>(6, thread_id, 0);
} }
StepRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { StepRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
StepRequestBuilder &operator=(const StepRequestBuilder &); StepRequestBuilder& operator=(const StepRequestBuilder&);
flatbuffers::Offset<StepRequest> Finish() { flatbuffers::Offset<StepRequest> Finish() {
auto o = flatbuffers::Offset<StepRequest>(fbb_.EndTable(start_, 2)); auto o = flatbuffers::Offset<StepRequest>(fbb_.EndTable(start_, 2));
return o; return o;
@ -257,7 +257,7 @@ struct StepRequestBuilder {
}; };
inline flatbuffers::Offset<StepRequest> CreateStepRequest( inline flatbuffers::Offset<StepRequest> CreateStepRequest(
flatbuffers::FlatBufferBuilder &_fbb, StepAction action = StepAction_StepIn, flatbuffers::FlatBufferBuilder& _fbb, StepAction action = StepAction_StepIn,
uint32_t thread_id = 0) { uint32_t thread_id = 0) {
StepRequestBuilder builder_(_fbb); StepRequestBuilder builder_(_fbb);
builder_.add_thread_id(thread_id); builder_.add_thread_id(thread_id);
@ -266,18 +266,18 @@ inline flatbuffers::Offset<StepRequest> CreateStepRequest(
} }
struct StepResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct StepResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && verifier.EndTable(); return VerifyTableStart(verifier) && verifier.EndTable();
} }
}; };
struct StepResponseBuilder { struct StepResponseBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
StepResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { StepResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
StepResponseBuilder &operator=(const StepResponseBuilder &); StepResponseBuilder& operator=(const StepResponseBuilder&);
flatbuffers::Offset<StepResponse> Finish() { flatbuffers::Offset<StepResponse> Finish() {
auto o = flatbuffers::Offset<StepResponse>(fbb_.EndTable(start_, 0)); auto o = flatbuffers::Offset<StepResponse>(fbb_.EndTable(start_, 0));
return o; return o;
@ -285,7 +285,7 @@ struct StepResponseBuilder {
}; };
inline flatbuffers::Offset<StepResponse> CreateStepResponse( inline flatbuffers::Offset<StepResponse> CreateStepResponse(
flatbuffers::FlatBufferBuilder &_fbb) { flatbuffers::FlatBufferBuilder& _fbb) {
StepResponseBuilder builder_(_fbb); StepResponseBuilder builder_(_fbb);
return builder_.Finish(); return builder_.Finish();
} }
@ -293,7 +293,7 @@ inline flatbuffers::Offset<StepResponse> CreateStepResponse(
struct BreakpointEvent FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct BreakpointEvent FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
uint32_t thread_id() const { return GetField<uint32_t>(4, 0); } uint32_t thread_id() const { return GetField<uint32_t>(4, 0); }
uint32_t breakpoint_id() const { return GetField<uint32_t>(6, 0); } uint32_t breakpoint_id() const { return GetField<uint32_t>(6, 0); }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<uint32_t>(verifier, 4 /* thread_id */) && VerifyField<uint32_t>(verifier, 4 /* thread_id */) &&
VerifyField<uint32_t>(verifier, 6 /* breakpoint_id */) && VerifyField<uint32_t>(verifier, 6 /* breakpoint_id */) &&
@ -302,7 +302,7 @@ struct BreakpointEvent FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
}; };
struct BreakpointEventBuilder { struct BreakpointEventBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_thread_id(uint32_t thread_id) { void add_thread_id(uint32_t thread_id) {
fbb_.AddElement<uint32_t>(4, thread_id, 0); fbb_.AddElement<uint32_t>(4, thread_id, 0);
@ -310,10 +310,10 @@ struct BreakpointEventBuilder {
void add_breakpoint_id(uint32_t breakpoint_id) { void add_breakpoint_id(uint32_t breakpoint_id) {
fbb_.AddElement<uint32_t>(6, breakpoint_id, 0); fbb_.AddElement<uint32_t>(6, breakpoint_id, 0);
} }
BreakpointEventBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { BreakpointEventBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
BreakpointEventBuilder &operator=(const BreakpointEventBuilder &); BreakpointEventBuilder& operator=(const BreakpointEventBuilder&);
flatbuffers::Offset<BreakpointEvent> Finish() { flatbuffers::Offset<BreakpointEvent> Finish() {
auto o = flatbuffers::Offset<BreakpointEvent>(fbb_.EndTable(start_, 2)); auto o = flatbuffers::Offset<BreakpointEvent>(fbb_.EndTable(start_, 2));
return o; return o;
@ -321,7 +321,7 @@ struct BreakpointEventBuilder {
}; };
inline flatbuffers::Offset<BreakpointEvent> CreateBreakpointEvent( inline flatbuffers::Offset<BreakpointEvent> CreateBreakpointEvent(
flatbuffers::FlatBufferBuilder &_fbb, uint32_t thread_id = 0, flatbuffers::FlatBufferBuilder& _fbb, uint32_t thread_id = 0,
uint32_t breakpoint_id = 0) { uint32_t breakpoint_id = 0) {
BreakpointEventBuilder builder_(_fbb); BreakpointEventBuilder builder_(_fbb);
builder_.add_breakpoint_id(breakpoint_id); builder_.add_breakpoint_id(breakpoint_id);
@ -333,7 +333,7 @@ struct AccessViolationEvent FLATBUFFERS_FINAL_CLASS
: private flatbuffers::Table { : private flatbuffers::Table {
uint32_t thread_id() const { return GetField<uint32_t>(4, 0); } uint32_t thread_id() const { return GetField<uint32_t>(4, 0); }
uint32_t target_address() const { return GetField<uint32_t>(6, 0); } uint32_t target_address() const { return GetField<uint32_t>(6, 0); }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<uint32_t>(verifier, 4 /* thread_id */) && VerifyField<uint32_t>(verifier, 4 /* thread_id */) &&
VerifyField<uint32_t>(verifier, 6 /* target_address */) && VerifyField<uint32_t>(verifier, 6 /* target_address */) &&
@ -342,7 +342,7 @@ struct AccessViolationEvent FLATBUFFERS_FINAL_CLASS
}; };
struct AccessViolationEventBuilder { struct AccessViolationEventBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_thread_id(uint32_t thread_id) { void add_thread_id(uint32_t thread_id) {
fbb_.AddElement<uint32_t>(4, thread_id, 0); fbb_.AddElement<uint32_t>(4, thread_id, 0);
@ -350,11 +350,11 @@ struct AccessViolationEventBuilder {
void add_target_address(uint32_t target_address) { void add_target_address(uint32_t target_address) {
fbb_.AddElement<uint32_t>(6, target_address, 0); fbb_.AddElement<uint32_t>(6, target_address, 0);
} }
AccessViolationEventBuilder(flatbuffers::FlatBufferBuilder &_fbb) AccessViolationEventBuilder(flatbuffers::FlatBufferBuilder& _fbb)
: fbb_(_fbb) { : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
AccessViolationEventBuilder &operator=(const AccessViolationEventBuilder &); AccessViolationEventBuilder& operator=(const AccessViolationEventBuilder&);
flatbuffers::Offset<AccessViolationEvent> Finish() { flatbuffers::Offset<AccessViolationEvent> Finish() {
auto o = auto o =
flatbuffers::Offset<AccessViolationEvent>(fbb_.EndTable(start_, 2)); flatbuffers::Offset<AccessViolationEvent>(fbb_.EndTable(start_, 2));
@ -363,7 +363,7 @@ struct AccessViolationEventBuilder {
}; };
inline flatbuffers::Offset<AccessViolationEvent> CreateAccessViolationEvent( inline flatbuffers::Offset<AccessViolationEvent> CreateAccessViolationEvent(
flatbuffers::FlatBufferBuilder &_fbb, uint32_t thread_id = 0, flatbuffers::FlatBufferBuilder& _fbb, uint32_t thread_id = 0,
uint32_t target_address = 0) { uint32_t target_address = 0) {
AccessViolationEventBuilder builder_(_fbb); AccessViolationEventBuilder builder_(_fbb);
builder_.add_target_address(target_address); builder_.add_target_address(target_address);

View File

@ -98,8 +98,8 @@ enum RequestData {
RequestData_StepRequest = 14 RequestData_StepRequest = 14
}; };
inline const char **EnumNamesRequestData() { inline const char** EnumNamesRequestData() {
static const char *names[] = { static const char* names[] = {
"NONE", "AttachRequest", "ListBreakpointsRequest", "NONE", "AttachRequest", "ListBreakpointsRequest",
"AddBreakpointsRequest", "UpdateBreakpointsRequest", "AddBreakpointsRequest", "UpdateBreakpointsRequest",
"RemoveBreakpointsRequest", "ListModulesRequest", "GetModuleRequest", "RemoveBreakpointsRequest", "ListModulesRequest", "GetModuleRequest",
@ -108,12 +108,12 @@ inline const char **EnumNamesRequestData() {
return names; return names;
} }
inline const char *EnumNameRequestData(RequestData e) { inline const char* EnumNameRequestData(RequestData e) {
return EnumNamesRequestData()[e]; return EnumNamesRequestData()[e];
} }
inline bool VerifyRequestData(flatbuffers::Verifier &verifier, inline bool VerifyRequestData(flatbuffers::Verifier& verifier,
const void *union_obj, RequestData type); const void* union_obj, RequestData type);
enum ResponseData { enum ResponseData {
ResponseData_NONE = 0, ResponseData_NONE = 0,
@ -135,8 +135,8 @@ enum ResponseData {
ResponseData_AccessViolationEvent = 16 ResponseData_AccessViolationEvent = 16
}; };
inline const char **EnumNamesResponseData() { inline const char** EnumNamesResponseData() {
static const char *names[] = { static const char* names[] = {
"NONE", "AttachResponse", "ListBreakpointsResponse", "NONE", "AttachResponse", "ListBreakpointsResponse",
"AddBreakpointsResponse", "UpdateBreakpointsResponse", "AddBreakpointsResponse", "UpdateBreakpointsResponse",
"RemoveBreakpointsResponse", "ListModulesResponse", "GetModuleResponse", "RemoveBreakpointsResponse", "ListModulesResponse", "GetModuleResponse",
@ -146,26 +146,26 @@ inline const char **EnumNamesResponseData() {
return names; return names;
} }
inline const char *EnumNameResponseData(ResponseData e) { inline const char* EnumNameResponseData(ResponseData e) {
return EnumNamesResponseData()[e]; return EnumNamesResponseData()[e];
} }
inline bool VerifyResponseData(flatbuffers::Verifier &verifier, inline bool VerifyResponseData(flatbuffers::Verifier& verifier,
const void *union_obj, ResponseData type); const void* union_obj, ResponseData type);
struct AttachRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct AttachRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && verifier.EndTable(); return VerifyTableStart(verifier) && verifier.EndTable();
} }
}; };
struct AttachRequestBuilder { struct AttachRequestBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
AttachRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { AttachRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
AttachRequestBuilder &operator=(const AttachRequestBuilder &); AttachRequestBuilder& operator=(const AttachRequestBuilder&);
flatbuffers::Offset<AttachRequest> Finish() { flatbuffers::Offset<AttachRequest> Finish() {
auto o = flatbuffers::Offset<AttachRequest>(fbb_.EndTable(start_, 0)); auto o = flatbuffers::Offset<AttachRequest>(fbb_.EndTable(start_, 0));
return o; return o;
@ -173,27 +173,27 @@ struct AttachRequestBuilder {
}; };
inline flatbuffers::Offset<AttachRequest> CreateAttachRequest( inline flatbuffers::Offset<AttachRequest> CreateAttachRequest(
flatbuffers::FlatBufferBuilder &_fbb) { flatbuffers::FlatBufferBuilder& _fbb) {
AttachRequestBuilder builder_(_fbb); AttachRequestBuilder builder_(_fbb);
return builder_.Finish(); return builder_.Finish();
} }
struct AttachResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct AttachResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
const flatbuffers::String *memory_file() const { const flatbuffers::String* memory_file() const {
return GetPointer<const flatbuffers::String *>(4); return GetPointer<const flatbuffers::String*>(4);
} }
const flatbuffers::String *code_cache_file() const { const flatbuffers::String* code_cache_file() const {
return GetPointer<const flatbuffers::String *>(6); return GetPointer<const flatbuffers::String*>(6);
} }
uint32_t code_cache_base() const { return GetField<uint32_t>(8, 0); } uint32_t code_cache_base() const { return GetField<uint32_t>(8, 0); }
uint32_t code_cache_size() const { return GetField<uint32_t>(10, 0); } uint32_t code_cache_size() const { return GetField<uint32_t>(10, 0); }
const flatbuffers::String *functions_file() const { const flatbuffers::String* functions_file() const {
return GetPointer<const flatbuffers::String *>(12); return GetPointer<const flatbuffers::String*>(12);
} }
const flatbuffers::String *functions_trace_file() const { const flatbuffers::String* functions_trace_file() const {
return GetPointer<const flatbuffers::String *>(14); return GetPointer<const flatbuffers::String*>(14);
} }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* memory_file */) && VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* memory_file */) &&
verifier.Verify(memory_file()) && verifier.Verify(memory_file()) &&
@ -212,7 +212,7 @@ struct AttachResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
}; };
struct AttachResponseBuilder { struct AttachResponseBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_memory_file(flatbuffers::Offset<flatbuffers::String> memory_file) { void add_memory_file(flatbuffers::Offset<flatbuffers::String> memory_file) {
fbb_.AddOffset(4, memory_file); fbb_.AddOffset(4, memory_file);
@ -235,10 +235,10 @@ struct AttachResponseBuilder {
flatbuffers::Offset<flatbuffers::String> functions_trace_file) { flatbuffers::Offset<flatbuffers::String> functions_trace_file) {
fbb_.AddOffset(14, functions_trace_file); fbb_.AddOffset(14, functions_trace_file);
} }
AttachResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { AttachResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
AttachResponseBuilder &operator=(const AttachResponseBuilder &); AttachResponseBuilder& operator=(const AttachResponseBuilder&);
flatbuffers::Offset<AttachResponse> Finish() { flatbuffers::Offset<AttachResponse> Finish() {
auto o = flatbuffers::Offset<AttachResponse>(fbb_.EndTable(start_, 6)); auto o = flatbuffers::Offset<AttachResponse>(fbb_.EndTable(start_, 6));
return o; return o;
@ -246,7 +246,7 @@ struct AttachResponseBuilder {
}; };
inline flatbuffers::Offset<AttachResponse> CreateAttachResponse( inline flatbuffers::Offset<AttachResponse> CreateAttachResponse(
flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::FlatBufferBuilder& _fbb,
flatbuffers::Offset<flatbuffers::String> memory_file = 0, flatbuffers::Offset<flatbuffers::String> memory_file = 0,
flatbuffers::Offset<flatbuffers::String> code_cache_file = 0, flatbuffers::Offset<flatbuffers::String> code_cache_file = 0,
uint32_t code_cache_base = 0, uint32_t code_cache_size = 0, uint32_t code_cache_base = 0, uint32_t code_cache_size = 0,
@ -267,8 +267,8 @@ struct Request FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
RequestData request_data_type() const { RequestData request_data_type() const {
return static_cast<RequestData>(GetField<uint8_t>(6, 0)); return static_cast<RequestData>(GetField<uint8_t>(6, 0));
} }
const void *request_data() const { return GetPointer<const void *>(8); } const void* request_data() const { return GetPointer<const void*>(8); }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<uint32_t>(verifier, 4 /* id */) && VerifyField<uint32_t>(verifier, 4 /* id */) &&
VerifyField<uint8_t>(verifier, 6 /* request_data_type */) && VerifyField<uint8_t>(verifier, 6 /* request_data_type */) &&
@ -280,7 +280,7 @@ struct Request FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
}; };
struct RequestBuilder { struct RequestBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_id(uint32_t id) { fbb_.AddElement<uint32_t>(4, id, 0); } void add_id(uint32_t id) { fbb_.AddElement<uint32_t>(4, id, 0); }
void add_request_data_type(RequestData request_data_type) { void add_request_data_type(RequestData request_data_type) {
@ -289,10 +289,10 @@ struct RequestBuilder {
void add_request_data(flatbuffers::Offset<void> request_data) { void add_request_data(flatbuffers::Offset<void> request_data) {
fbb_.AddOffset(8, request_data); fbb_.AddOffset(8, request_data);
} }
RequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { RequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
RequestBuilder &operator=(const RequestBuilder &); RequestBuilder& operator=(const RequestBuilder&);
flatbuffers::Offset<Request> Finish() { flatbuffers::Offset<Request> Finish() {
auto o = flatbuffers::Offset<Request>(fbb_.EndTable(start_, 3)); auto o = flatbuffers::Offset<Request>(fbb_.EndTable(start_, 3));
return o; return o;
@ -300,7 +300,7 @@ struct RequestBuilder {
}; };
inline flatbuffers::Offset<Request> CreateRequest( inline flatbuffers::Offset<Request> CreateRequest(
flatbuffers::FlatBufferBuilder &_fbb, uint32_t id = 0, flatbuffers::FlatBufferBuilder& _fbb, uint32_t id = 0,
RequestData request_data_type = RequestData_NONE, RequestData request_data_type = RequestData_NONE,
flatbuffers::Offset<void> request_data = 0) { flatbuffers::Offset<void> request_data = 0) {
RequestBuilder builder_(_fbb); RequestBuilder builder_(_fbb);
@ -315,8 +315,8 @@ struct Response FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
ResponseData response_data_type() const { ResponseData response_data_type() const {
return static_cast<ResponseData>(GetField<uint8_t>(6, 0)); return static_cast<ResponseData>(GetField<uint8_t>(6, 0));
} }
const void *response_data() const { return GetPointer<const void *>(8); } const void* response_data() const { return GetPointer<const void*>(8); }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<uint32_t>(verifier, 4 /* id */) && VerifyField<uint32_t>(verifier, 4 /* id */) &&
VerifyField<uint8_t>(verifier, 6 /* response_data_type */) && VerifyField<uint8_t>(verifier, 6 /* response_data_type */) &&
@ -329,7 +329,7 @@ struct Response FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
}; };
struct ResponseBuilder { struct ResponseBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_id(uint32_t id) { fbb_.AddElement<uint32_t>(4, id, 0); } void add_id(uint32_t id) { fbb_.AddElement<uint32_t>(4, id, 0); }
void add_response_data_type(ResponseData response_data_type) { void add_response_data_type(ResponseData response_data_type) {
@ -338,10 +338,10 @@ struct ResponseBuilder {
void add_response_data(flatbuffers::Offset<void> response_data) { void add_response_data(flatbuffers::Offset<void> response_data) {
fbb_.AddOffset(8, response_data); fbb_.AddOffset(8, response_data);
} }
ResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { ResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
ResponseBuilder &operator=(const ResponseBuilder &); ResponseBuilder& operator=(const ResponseBuilder&);
flatbuffers::Offset<Response> Finish() { flatbuffers::Offset<Response> Finish() {
auto o = flatbuffers::Offset<Response>(fbb_.EndTable(start_, 3)); auto o = flatbuffers::Offset<Response>(fbb_.EndTable(start_, 3));
return o; return o;
@ -349,7 +349,7 @@ struct ResponseBuilder {
}; };
inline flatbuffers::Offset<Response> CreateResponse( inline flatbuffers::Offset<Response> CreateResponse(
flatbuffers::FlatBufferBuilder &_fbb, uint32_t id = 0, flatbuffers::FlatBufferBuilder& _fbb, uint32_t id = 0,
ResponseData response_data_type = ResponseData_NONE, ResponseData response_data_type = ResponseData_NONE,
flatbuffers::Offset<void> response_data = 0) { flatbuffers::Offset<void> response_data = 0) {
ResponseBuilder builder_(_fbb); ResponseBuilder builder_(_fbb);
@ -359,132 +359,132 @@ inline flatbuffers::Offset<Response> CreateResponse(
return builder_.Finish(); return builder_.Finish();
} }
inline bool VerifyRequestData(flatbuffers::Verifier &verifier, inline bool VerifyRequestData(flatbuffers::Verifier& verifier,
const void *union_obj, RequestData type) { const void* union_obj, RequestData type) {
switch (type) { switch (type) {
case RequestData_NONE: case RequestData_NONE:
return true; return true;
case RequestData_AttachRequest: case RequestData_AttachRequest:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const AttachRequest *>(union_obj)); reinterpret_cast<const AttachRequest*>(union_obj));
case RequestData_ListBreakpointsRequest: case RequestData_ListBreakpointsRequest:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::ListBreakpointsRequest *>( reinterpret_cast<const xe::debug::proto::ListBreakpointsRequest*>(
union_obj)); union_obj));
case RequestData_AddBreakpointsRequest: case RequestData_AddBreakpointsRequest:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::AddBreakpointsRequest *>( reinterpret_cast<const xe::debug::proto::AddBreakpointsRequest*>(
union_obj)); union_obj));
case RequestData_UpdateBreakpointsRequest: case RequestData_UpdateBreakpointsRequest:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::UpdateBreakpointsRequest *>( reinterpret_cast<const xe::debug::proto::UpdateBreakpointsRequest*>(
union_obj)); union_obj));
case RequestData_RemoveBreakpointsRequest: case RequestData_RemoveBreakpointsRequest:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::RemoveBreakpointsRequest *>( reinterpret_cast<const xe::debug::proto::RemoveBreakpointsRequest*>(
union_obj)); union_obj));
case RequestData_ListModulesRequest: case RequestData_ListModulesRequest:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::ListModulesRequest *>( reinterpret_cast<const xe::debug::proto::ListModulesRequest*>(
union_obj)); union_obj));
case RequestData_GetModuleRequest: case RequestData_GetModuleRequest:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::GetModuleRequest *>( reinterpret_cast<const xe::debug::proto::GetModuleRequest*>(
union_obj)); union_obj));
case RequestData_ListFunctionsRequest: case RequestData_ListFunctionsRequest:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::ListFunctionsRequest *>( reinterpret_cast<const xe::debug::proto::ListFunctionsRequest*>(
union_obj)); union_obj));
case RequestData_GetFunctionRequest: case RequestData_GetFunctionRequest:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::GetFunctionRequest *>( reinterpret_cast<const xe::debug::proto::GetFunctionRequest*>(
union_obj)); union_obj));
case RequestData_ListThreadsRequest: case RequestData_ListThreadsRequest:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::ListThreadsRequest *>( reinterpret_cast<const xe::debug::proto::ListThreadsRequest*>(
union_obj)); union_obj));
case RequestData_StopRequest: case RequestData_StopRequest:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::StopRequest *>(union_obj)); reinterpret_cast<const xe::debug::proto::StopRequest*>(union_obj));
case RequestData_BreakRequest: case RequestData_BreakRequest:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::BreakRequest *>(union_obj)); reinterpret_cast<const xe::debug::proto::BreakRequest*>(union_obj));
case RequestData_ContinueRequest: case RequestData_ContinueRequest:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::ContinueRequest *>( reinterpret_cast<const xe::debug::proto::ContinueRequest*>(
union_obj)); union_obj));
case RequestData_StepRequest: case RequestData_StepRequest:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::StepRequest *>(union_obj)); reinterpret_cast<const xe::debug::proto::StepRequest*>(union_obj));
default: default:
return false; return false;
} }
} }
inline bool VerifyResponseData(flatbuffers::Verifier &verifier, inline bool VerifyResponseData(flatbuffers::Verifier& verifier,
const void *union_obj, ResponseData type) { const void* union_obj, ResponseData type) {
switch (type) { switch (type) {
case ResponseData_NONE: case ResponseData_NONE:
return true; return true;
case ResponseData_AttachResponse: case ResponseData_AttachResponse:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const AttachResponse *>(union_obj)); reinterpret_cast<const AttachResponse*>(union_obj));
case ResponseData_ListBreakpointsResponse: case ResponseData_ListBreakpointsResponse:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::ListBreakpointsResponse *>( reinterpret_cast<const xe::debug::proto::ListBreakpointsResponse*>(
union_obj)); union_obj));
case ResponseData_AddBreakpointsResponse: case ResponseData_AddBreakpointsResponse:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::AddBreakpointsResponse *>( reinterpret_cast<const xe::debug::proto::AddBreakpointsResponse*>(
union_obj)); union_obj));
case ResponseData_UpdateBreakpointsResponse: case ResponseData_UpdateBreakpointsResponse:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::UpdateBreakpointsResponse *>( reinterpret_cast<const xe::debug::proto::UpdateBreakpointsResponse*>(
union_obj)); union_obj));
case ResponseData_RemoveBreakpointsResponse: case ResponseData_RemoveBreakpointsResponse:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::RemoveBreakpointsResponse *>( reinterpret_cast<const xe::debug::proto::RemoveBreakpointsResponse*>(
union_obj)); union_obj));
case ResponseData_ListModulesResponse: case ResponseData_ListModulesResponse:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::ListModulesResponse *>( reinterpret_cast<const xe::debug::proto::ListModulesResponse*>(
union_obj)); union_obj));
case ResponseData_GetModuleResponse: case ResponseData_GetModuleResponse:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::GetModuleResponse *>( reinterpret_cast<const xe::debug::proto::GetModuleResponse*>(
union_obj)); union_obj));
case ResponseData_ListFunctionsResponse: case ResponseData_ListFunctionsResponse:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::ListFunctionsResponse *>( reinterpret_cast<const xe::debug::proto::ListFunctionsResponse*>(
union_obj)); union_obj));
case ResponseData_GetFunctionResponse: case ResponseData_GetFunctionResponse:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::GetFunctionResponse *>( reinterpret_cast<const xe::debug::proto::GetFunctionResponse*>(
union_obj)); union_obj));
case ResponseData_ListThreadsResponse: case ResponseData_ListThreadsResponse:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::ListThreadsResponse *>( reinterpret_cast<const xe::debug::proto::ListThreadsResponse*>(
union_obj)); union_obj));
case ResponseData_StopResponse: case ResponseData_StopResponse:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::StopResponse *>(union_obj)); reinterpret_cast<const xe::debug::proto::StopResponse*>(union_obj));
case ResponseData_BreakResponse: case ResponseData_BreakResponse:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::BreakResponse *>(union_obj)); reinterpret_cast<const xe::debug::proto::BreakResponse*>(union_obj));
case ResponseData_ContinueResponse: case ResponseData_ContinueResponse:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::ContinueResponse *>( reinterpret_cast<const xe::debug::proto::ContinueResponse*>(
union_obj)); union_obj));
case ResponseData_StepResponse: case ResponseData_StepResponse:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::StepResponse *>(union_obj)); reinterpret_cast<const xe::debug::proto::StepResponse*>(union_obj));
case ResponseData_BreakpointEvent: case ResponseData_BreakpointEvent:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::BreakpointEvent *>( reinterpret_cast<const xe::debug::proto::BreakpointEvent*>(
union_obj)); union_obj));
case ResponseData_AccessViolationEvent: case ResponseData_AccessViolationEvent:
return verifier.VerifyTable( return verifier.VerifyTable(
reinterpret_cast<const xe::debug::proto::AccessViolationEvent *>( reinterpret_cast<const xe::debug::proto::AccessViolationEvent*>(
union_obj)); union_obj));
default: default:
return false; return false;

View File

@ -32,12 +32,12 @@ struct GetFunctionResponse;
enum ModuleType { ModuleType_Kernel = 0, ModuleType_User = 1 }; enum ModuleType { ModuleType_Kernel = 0, ModuleType_User = 1 };
inline const char **EnumNamesModuleType() { inline const char** EnumNamesModuleType() {
static const char *names[] = {"Kernel", "User", nullptr}; static const char* names[] = {"Kernel", "User", nullptr};
return names; return names;
} }
inline const char *EnumNameModuleType(ModuleType e) { inline const char* EnumNameModuleType(ModuleType e) {
return EnumNamesModuleType()[e]; return EnumNamesModuleType()[e];
} }
@ -59,19 +59,19 @@ MANUALLY_ALIGNED_STRUCT(4) ListModuleEntry FLATBUFFERS_FINAL_CLASS {
STRUCT_END(ListModuleEntry, 8); STRUCT_END(ListModuleEntry, 8);
struct Module FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct Module FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
const xe::debug::proto::XObject *object() const { const xe::debug::proto::XObject* object() const {
return GetStruct<const xe::debug::proto::XObject *>(4); return GetStruct<const xe::debug::proto::XObject*>(4);
} }
ModuleType type() const { ModuleType type() const {
return static_cast<ModuleType>(GetField<int8_t>(6, 0)); return static_cast<ModuleType>(GetField<int8_t>(6, 0));
} }
const flatbuffers::String *name() const { const flatbuffers::String* name() const {
return GetPointer<const flatbuffers::String *>(8); return GetPointer<const flatbuffers::String*>(8);
} }
const flatbuffers::String *path() const { const flatbuffers::String* path() const {
return GetPointer<const flatbuffers::String *>(10); return GetPointer<const flatbuffers::String*>(10);
} }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<xe::debug::proto::XObject>(verifier, 4 /* object */) && VerifyField<xe::debug::proto::XObject>(verifier, 4 /* object */) &&
VerifyField<int8_t>(verifier, 6 /* type */) && VerifyField<int8_t>(verifier, 6 /* type */) &&
@ -83,9 +83,9 @@ struct Module FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
}; };
struct ModuleBuilder { struct ModuleBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_object(const xe::debug::proto::XObject *object) { void add_object(const xe::debug::proto::XObject* object) {
fbb_.AddStruct(4, object); fbb_.AddStruct(4, object);
} }
void add_type(ModuleType type) { void add_type(ModuleType type) {
@ -97,10 +97,10 @@ struct ModuleBuilder {
void add_path(flatbuffers::Offset<flatbuffers::String> path) { void add_path(flatbuffers::Offset<flatbuffers::String> path) {
fbb_.AddOffset(10, path); fbb_.AddOffset(10, path);
} }
ModuleBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { ModuleBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
ModuleBuilder &operator=(const ModuleBuilder &); ModuleBuilder& operator=(const ModuleBuilder&);
flatbuffers::Offset<Module> Finish() { flatbuffers::Offset<Module> Finish() {
auto o = flatbuffers::Offset<Module>(fbb_.EndTable(start_, 4)); auto o = flatbuffers::Offset<Module>(fbb_.EndTable(start_, 4));
return o; return o;
@ -108,8 +108,8 @@ struct ModuleBuilder {
}; };
inline flatbuffers::Offset<Module> CreateModule( inline flatbuffers::Offset<Module> CreateModule(
flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::FlatBufferBuilder& _fbb,
const xe::debug::proto::XObject *object = 0, const xe::debug::proto::XObject* object = 0,
ModuleType type = ModuleType_Kernel, ModuleType type = ModuleType_Kernel,
flatbuffers::Offset<flatbuffers::String> name = 0, flatbuffers::Offset<flatbuffers::String> name = 0,
flatbuffers::Offset<flatbuffers::String> path = 0) { flatbuffers::Offset<flatbuffers::String> path = 0) {
@ -122,18 +122,18 @@ inline flatbuffers::Offset<Module> CreateModule(
} }
struct ListModulesRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct ListModulesRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && verifier.EndTable(); return VerifyTableStart(verifier) && verifier.EndTable();
} }
}; };
struct ListModulesRequestBuilder { struct ListModulesRequestBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
ListModulesRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { ListModulesRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
ListModulesRequestBuilder &operator=(const ListModulesRequestBuilder &); ListModulesRequestBuilder& operator=(const ListModulesRequestBuilder&);
flatbuffers::Offset<ListModulesRequest> Finish() { flatbuffers::Offset<ListModulesRequest> Finish() {
auto o = flatbuffers::Offset<ListModulesRequest>(fbb_.EndTable(start_, 0)); auto o = flatbuffers::Offset<ListModulesRequest>(fbb_.EndTable(start_, 0));
return o; return o;
@ -141,17 +141,17 @@ struct ListModulesRequestBuilder {
}; };
inline flatbuffers::Offset<ListModulesRequest> CreateListModulesRequest( inline flatbuffers::Offset<ListModulesRequest> CreateListModulesRequest(
flatbuffers::FlatBufferBuilder &_fbb) { flatbuffers::FlatBufferBuilder& _fbb) {
ListModulesRequestBuilder builder_(_fbb); ListModulesRequestBuilder builder_(_fbb);
return builder_.Finish(); return builder_.Finish();
} }
struct ListModulesResponse FLATBUFFERS_FINAL_CLASS struct ListModulesResponse FLATBUFFERS_FINAL_CLASS
: private flatbuffers::Table { : private flatbuffers::Table {
const flatbuffers::Vector<const ListModuleEntry *> *entry() const { const flatbuffers::Vector<const ListModuleEntry*>* entry() const {
return GetPointer<const flatbuffers::Vector<const ListModuleEntry *> *>(4); return GetPointer<const flatbuffers::Vector<const ListModuleEntry*>*>(4);
} }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* entry */) && VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* entry */) &&
verifier.Verify(entry()) && verifier.EndTable(); verifier.Verify(entry()) && verifier.EndTable();
@ -159,17 +159,17 @@ struct ListModulesResponse FLATBUFFERS_FINAL_CLASS
}; };
struct ListModulesResponseBuilder { struct ListModulesResponseBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_entry( void add_entry(
flatbuffers::Offset<flatbuffers::Vector<const ListModuleEntry *>> entry) { flatbuffers::Offset<flatbuffers::Vector<const ListModuleEntry*>> entry) {
fbb_.AddOffset(4, entry); fbb_.AddOffset(4, entry);
} }
ListModulesResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) ListModulesResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb)
: fbb_(_fbb) { : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
ListModulesResponseBuilder &operator=(const ListModulesResponseBuilder &); ListModulesResponseBuilder& operator=(const ListModulesResponseBuilder&);
flatbuffers::Offset<ListModulesResponse> Finish() { flatbuffers::Offset<ListModulesResponse> Finish() {
auto o = flatbuffers::Offset<ListModulesResponse>(fbb_.EndTable(start_, 1)); auto o = flatbuffers::Offset<ListModulesResponse>(fbb_.EndTable(start_, 1));
return o; return o;
@ -177,8 +177,8 @@ struct ListModulesResponseBuilder {
}; };
inline flatbuffers::Offset<ListModulesResponse> CreateListModulesResponse( inline flatbuffers::Offset<ListModulesResponse> CreateListModulesResponse(
flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::FlatBufferBuilder& _fbb,
flatbuffers::Offset<flatbuffers::Vector<const ListModuleEntry *>> entry = flatbuffers::Offset<flatbuffers::Vector<const ListModuleEntry*>> entry =
0) { 0) {
ListModulesResponseBuilder builder_(_fbb); ListModulesResponseBuilder builder_(_fbb);
builder_.add_entry(entry); builder_.add_entry(entry);
@ -187,7 +187,7 @@ inline flatbuffers::Offset<ListModulesResponse> CreateListModulesResponse(
struct GetModuleRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct GetModuleRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
uint32_t module_id() const { return GetField<uint32_t>(4, 0); } uint32_t module_id() const { return GetField<uint32_t>(4, 0); }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<uint32_t>(verifier, 4 /* module_id */) && VerifyField<uint32_t>(verifier, 4 /* module_id */) &&
verifier.EndTable(); verifier.EndTable();
@ -195,15 +195,15 @@ struct GetModuleRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
}; };
struct GetModuleRequestBuilder { struct GetModuleRequestBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_module_id(uint32_t module_id) { void add_module_id(uint32_t module_id) {
fbb_.AddElement<uint32_t>(4, module_id, 0); fbb_.AddElement<uint32_t>(4, module_id, 0);
} }
GetModuleRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { GetModuleRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
GetModuleRequestBuilder &operator=(const GetModuleRequestBuilder &); GetModuleRequestBuilder& operator=(const GetModuleRequestBuilder&);
flatbuffers::Offset<GetModuleRequest> Finish() { flatbuffers::Offset<GetModuleRequest> Finish() {
auto o = flatbuffers::Offset<GetModuleRequest>(fbb_.EndTable(start_, 1)); auto o = flatbuffers::Offset<GetModuleRequest>(fbb_.EndTable(start_, 1));
return o; return o;
@ -211,15 +211,15 @@ struct GetModuleRequestBuilder {
}; };
inline flatbuffers::Offset<GetModuleRequest> CreateGetModuleRequest( inline flatbuffers::Offset<GetModuleRequest> CreateGetModuleRequest(
flatbuffers::FlatBufferBuilder &_fbb, uint32_t module_id = 0) { flatbuffers::FlatBufferBuilder& _fbb, uint32_t module_id = 0) {
GetModuleRequestBuilder builder_(_fbb); GetModuleRequestBuilder builder_(_fbb);
builder_.add_module_id(module_id); builder_.add_module_id(module_id);
return builder_.Finish(); return builder_.Finish();
} }
struct GetModuleResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct GetModuleResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
const Module *module() const { return GetPointer<const Module *>(4); } const Module* module() const { return GetPointer<const Module*>(4); }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* module */) && VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* module */) &&
verifier.VerifyTable(module()) && verifier.EndTable(); verifier.VerifyTable(module()) && verifier.EndTable();
@ -227,15 +227,15 @@ struct GetModuleResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
}; };
struct GetModuleResponseBuilder { struct GetModuleResponseBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_module(flatbuffers::Offset<Module> module) { void add_module(flatbuffers::Offset<Module> module) {
fbb_.AddOffset(4, module); fbb_.AddOffset(4, module);
} }
GetModuleResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { GetModuleResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
GetModuleResponseBuilder &operator=(const GetModuleResponseBuilder &); GetModuleResponseBuilder& operator=(const GetModuleResponseBuilder&);
flatbuffers::Offset<GetModuleResponse> Finish() { flatbuffers::Offset<GetModuleResponse> Finish() {
auto o = flatbuffers::Offset<GetModuleResponse>(fbb_.EndTable(start_, 1)); auto o = flatbuffers::Offset<GetModuleResponse>(fbb_.EndTable(start_, 1));
return o; return o;
@ -243,7 +243,7 @@ struct GetModuleResponseBuilder {
}; };
inline flatbuffers::Offset<GetModuleResponse> CreateGetModuleResponse( inline flatbuffers::Offset<GetModuleResponse> CreateGetModuleResponse(
flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::FlatBufferBuilder& _fbb,
flatbuffers::Offset<Module> module = 0) { flatbuffers::Offset<Module> module = 0) {
GetModuleResponseBuilder builder_(_fbb); GetModuleResponseBuilder builder_(_fbb);
builder_.add_module(module); builder_.add_module(module);
@ -254,10 +254,10 @@ struct FunctionEntry FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
uint64_t identifier() const { return GetField<uint64_t>(4, 0); } uint64_t identifier() const { return GetField<uint64_t>(4, 0); }
uint32_t address_start() const { return GetField<uint32_t>(6, 0); } uint32_t address_start() const { return GetField<uint32_t>(6, 0); }
uint32_t address_end() const { return GetField<uint32_t>(8, 0); } uint32_t address_end() const { return GetField<uint32_t>(8, 0); }
const flatbuffers::String *name() const { const flatbuffers::String* name() const {
return GetPointer<const flatbuffers::String *>(10); return GetPointer<const flatbuffers::String*>(10);
} }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<uint64_t>(verifier, 4 /* identifier */) && VerifyField<uint64_t>(verifier, 4 /* identifier */) &&
VerifyField<uint32_t>(verifier, 6 /* address_start */) && VerifyField<uint32_t>(verifier, 6 /* address_start */) &&
@ -268,7 +268,7 @@ struct FunctionEntry FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
}; };
struct FunctionEntryBuilder { struct FunctionEntryBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_identifier(uint64_t identifier) { void add_identifier(uint64_t identifier) {
fbb_.AddElement<uint64_t>(4, identifier, 0); fbb_.AddElement<uint64_t>(4, identifier, 0);
@ -282,10 +282,10 @@ struct FunctionEntryBuilder {
void add_name(flatbuffers::Offset<flatbuffers::String> name) { void add_name(flatbuffers::Offset<flatbuffers::String> name) {
fbb_.AddOffset(10, name); fbb_.AddOffset(10, name);
} }
FunctionEntryBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { FunctionEntryBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
FunctionEntryBuilder &operator=(const FunctionEntryBuilder &); FunctionEntryBuilder& operator=(const FunctionEntryBuilder&);
flatbuffers::Offset<FunctionEntry> Finish() { flatbuffers::Offset<FunctionEntry> Finish() {
auto o = flatbuffers::Offset<FunctionEntry>(fbb_.EndTable(start_, 4)); auto o = flatbuffers::Offset<FunctionEntry>(fbb_.EndTable(start_, 4));
return o; return o;
@ -293,7 +293,7 @@ struct FunctionEntryBuilder {
}; };
inline flatbuffers::Offset<FunctionEntry> CreateFunctionEntry( inline flatbuffers::Offset<FunctionEntry> CreateFunctionEntry(
flatbuffers::FlatBufferBuilder &_fbb, uint64_t identifier = 0, flatbuffers::FlatBufferBuilder& _fbb, uint64_t identifier = 0,
uint32_t address_start = 0, uint32_t address_end = 0, uint32_t address_start = 0, uint32_t address_end = 0,
flatbuffers::Offset<flatbuffers::String> name = 0) { flatbuffers::Offset<flatbuffers::String> name = 0) {
FunctionEntryBuilder builder_(_fbb); FunctionEntryBuilder builder_(_fbb);
@ -308,18 +308,18 @@ struct Function FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
uint64_t identifier() const { return GetField<uint64_t>(4, 0); } uint64_t identifier() const { return GetField<uint64_t>(4, 0); }
uint32_t address_start() const { return GetField<uint32_t>(6, 0); } uint32_t address_start() const { return GetField<uint32_t>(6, 0); }
uint32_t address_end() const { return GetField<uint32_t>(8, 0); } uint32_t address_end() const { return GetField<uint32_t>(8, 0); }
const flatbuffers::String *name() const { const flatbuffers::String* name() const {
return GetPointer<const flatbuffers::String *>(10); return GetPointer<const flatbuffers::String*>(10);
} }
uint32_t machine_code_start() const { return GetField<uint32_t>(12, 0); } uint32_t machine_code_start() const { return GetField<uint32_t>(12, 0); }
uint32_t machine_code_end() const { return GetField<uint32_t>(14, 0); } uint32_t machine_code_end() const { return GetField<uint32_t>(14, 0); }
const flatbuffers::String *disasm_hir_raw() const { const flatbuffers::String* disasm_hir_raw() const {
return GetPointer<const flatbuffers::String *>(16); return GetPointer<const flatbuffers::String*>(16);
} }
const flatbuffers::String *disasm_hir_opt() const { const flatbuffers::String* disasm_hir_opt() const {
return GetPointer<const flatbuffers::String *>(18); return GetPointer<const flatbuffers::String*>(18);
} }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<uint64_t>(verifier, 4 /* identifier */) && VerifyField<uint64_t>(verifier, 4 /* identifier */) &&
VerifyField<uint32_t>(verifier, 6 /* address_start */) && VerifyField<uint32_t>(verifier, 6 /* address_start */) &&
@ -338,7 +338,7 @@ struct Function FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
}; };
struct FunctionBuilder { struct FunctionBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_identifier(uint64_t identifier) { void add_identifier(uint64_t identifier) {
fbb_.AddElement<uint64_t>(4, identifier, 0); fbb_.AddElement<uint64_t>(4, identifier, 0);
@ -366,10 +366,10 @@ struct FunctionBuilder {
flatbuffers::Offset<flatbuffers::String> disasm_hir_opt) { flatbuffers::Offset<flatbuffers::String> disasm_hir_opt) {
fbb_.AddOffset(18, disasm_hir_opt); fbb_.AddOffset(18, disasm_hir_opt);
} }
FunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { FunctionBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
FunctionBuilder &operator=(const FunctionBuilder &); FunctionBuilder& operator=(const FunctionBuilder&);
flatbuffers::Offset<Function> Finish() { flatbuffers::Offset<Function> Finish() {
auto o = flatbuffers::Offset<Function>(fbb_.EndTable(start_, 8)); auto o = flatbuffers::Offset<Function>(fbb_.EndTable(start_, 8));
return o; return o;
@ -377,7 +377,7 @@ struct FunctionBuilder {
}; };
inline flatbuffers::Offset<Function> CreateFunction( inline flatbuffers::Offset<Function> CreateFunction(
flatbuffers::FlatBufferBuilder &_fbb, uint64_t identifier = 0, flatbuffers::FlatBufferBuilder& _fbb, uint64_t identifier = 0,
uint32_t address_start = 0, uint32_t address_end = 0, uint32_t address_start = 0, uint32_t address_end = 0,
flatbuffers::Offset<flatbuffers::String> name = 0, flatbuffers::Offset<flatbuffers::String> name = 0,
uint32_t machine_code_start = 0, uint32_t machine_code_end = 0, uint32_t machine_code_start = 0, uint32_t machine_code_end = 0,
@ -400,7 +400,7 @@ struct ListFunctionsRequest FLATBUFFERS_FINAL_CLASS
uint32_t module_id() const { return GetField<uint32_t>(4, 0); } uint32_t module_id() const { return GetField<uint32_t>(4, 0); }
uint32_t function_index_start() const { return GetField<uint32_t>(6, 0); } uint32_t function_index_start() const { return GetField<uint32_t>(6, 0); }
uint32_t function_index_end() const { return GetField<uint32_t>(8, 0); } uint32_t function_index_end() const { return GetField<uint32_t>(8, 0); }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<uint32_t>(verifier, 4 /* module_id */) && VerifyField<uint32_t>(verifier, 4 /* module_id */) &&
VerifyField<uint32_t>(verifier, 6 /* function_index_start */) && VerifyField<uint32_t>(verifier, 6 /* function_index_start */) &&
@ -410,7 +410,7 @@ struct ListFunctionsRequest FLATBUFFERS_FINAL_CLASS
}; };
struct ListFunctionsRequestBuilder { struct ListFunctionsRequestBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_module_id(uint32_t module_id) { void add_module_id(uint32_t module_id) {
fbb_.AddElement<uint32_t>(4, module_id, 0); fbb_.AddElement<uint32_t>(4, module_id, 0);
@ -421,11 +421,11 @@ struct ListFunctionsRequestBuilder {
void add_function_index_end(uint32_t function_index_end) { void add_function_index_end(uint32_t function_index_end) {
fbb_.AddElement<uint32_t>(8, function_index_end, 0); fbb_.AddElement<uint32_t>(8, function_index_end, 0);
} }
ListFunctionsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) ListFunctionsRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb)
: fbb_(_fbb) { : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
ListFunctionsRequestBuilder &operator=(const ListFunctionsRequestBuilder &); ListFunctionsRequestBuilder& operator=(const ListFunctionsRequestBuilder&);
flatbuffers::Offset<ListFunctionsRequest> Finish() { flatbuffers::Offset<ListFunctionsRequest> Finish() {
auto o = auto o =
flatbuffers::Offset<ListFunctionsRequest>(fbb_.EndTable(start_, 3)); flatbuffers::Offset<ListFunctionsRequest>(fbb_.EndTable(start_, 3));
@ -434,7 +434,7 @@ struct ListFunctionsRequestBuilder {
}; };
inline flatbuffers::Offset<ListFunctionsRequest> CreateListFunctionsRequest( inline flatbuffers::Offset<ListFunctionsRequest> CreateListFunctionsRequest(
flatbuffers::FlatBufferBuilder &_fbb, uint32_t module_id = 0, flatbuffers::FlatBufferBuilder& _fbb, uint32_t module_id = 0,
uint32_t function_index_start = 0, uint32_t function_index_end = 0) { uint32_t function_index_start = 0, uint32_t function_index_end = 0) {
ListFunctionsRequestBuilder builder_(_fbb); ListFunctionsRequestBuilder builder_(_fbb);
builder_.add_function_index_end(function_index_end); builder_.add_function_index_end(function_index_end);
@ -445,11 +445,11 @@ inline flatbuffers::Offset<ListFunctionsRequest> CreateListFunctionsRequest(
struct ListFunctionsResponse FLATBUFFERS_FINAL_CLASS struct ListFunctionsResponse FLATBUFFERS_FINAL_CLASS
: private flatbuffers::Table { : private flatbuffers::Table {
const flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>> *entry() const { const flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>>* entry() const {
return GetPointer< return GetPointer<
const flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>> *>(4); const flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>>*>(4);
} }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* entry */) && VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* entry */) &&
verifier.Verify(entry()) && verifier.VerifyVectorOfTables(entry()) && verifier.Verify(entry()) && verifier.VerifyVectorOfTables(entry()) &&
@ -458,17 +458,17 @@ struct ListFunctionsResponse FLATBUFFERS_FINAL_CLASS
}; };
struct ListFunctionsResponseBuilder { struct ListFunctionsResponseBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_entry(flatbuffers::Offset< void add_entry(flatbuffers::Offset<
flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>>> entry) { flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>>> entry) {
fbb_.AddOffset(4, entry); fbb_.AddOffset(4, entry);
} }
ListFunctionsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) ListFunctionsResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb)
: fbb_(_fbb) { : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
ListFunctionsResponseBuilder &operator=(const ListFunctionsResponseBuilder &); ListFunctionsResponseBuilder& operator=(const ListFunctionsResponseBuilder&);
flatbuffers::Offset<ListFunctionsResponse> Finish() { flatbuffers::Offset<ListFunctionsResponse> Finish() {
auto o = auto o =
flatbuffers::Offset<ListFunctionsResponse>(fbb_.EndTable(start_, 1)); flatbuffers::Offset<ListFunctionsResponse>(fbb_.EndTable(start_, 1));
@ -477,7 +477,7 @@ struct ListFunctionsResponseBuilder {
}; };
inline flatbuffers::Offset<ListFunctionsResponse> CreateListFunctionsResponse( inline flatbuffers::Offset<ListFunctionsResponse> CreateListFunctionsResponse(
flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::FlatBufferBuilder& _fbb,
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>>> flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>>>
entry = 0) { entry = 0) {
ListFunctionsResponseBuilder builder_(_fbb); ListFunctionsResponseBuilder builder_(_fbb);
@ -487,7 +487,7 @@ inline flatbuffers::Offset<ListFunctionsResponse> CreateListFunctionsResponse(
struct GetFunctionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct GetFunctionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
uint64_t identifier() const { return GetField<uint64_t>(4, 0); } uint64_t identifier() const { return GetField<uint64_t>(4, 0); }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<uint64_t>(verifier, 4 /* identifier */) && VerifyField<uint64_t>(verifier, 4 /* identifier */) &&
verifier.EndTable(); verifier.EndTable();
@ -495,15 +495,15 @@ struct GetFunctionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
}; };
struct GetFunctionRequestBuilder { struct GetFunctionRequestBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_identifier(uint64_t identifier) { void add_identifier(uint64_t identifier) {
fbb_.AddElement<uint64_t>(4, identifier, 0); fbb_.AddElement<uint64_t>(4, identifier, 0);
} }
GetFunctionRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { GetFunctionRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
GetFunctionRequestBuilder &operator=(const GetFunctionRequestBuilder &); GetFunctionRequestBuilder& operator=(const GetFunctionRequestBuilder&);
flatbuffers::Offset<GetFunctionRequest> Finish() { flatbuffers::Offset<GetFunctionRequest> Finish() {
auto o = flatbuffers::Offset<GetFunctionRequest>(fbb_.EndTable(start_, 1)); auto o = flatbuffers::Offset<GetFunctionRequest>(fbb_.EndTable(start_, 1));
return o; return o;
@ -511,7 +511,7 @@ struct GetFunctionRequestBuilder {
}; };
inline flatbuffers::Offset<GetFunctionRequest> CreateGetFunctionRequest( inline flatbuffers::Offset<GetFunctionRequest> CreateGetFunctionRequest(
flatbuffers::FlatBufferBuilder &_fbb, uint64_t identifier = 0) { flatbuffers::FlatBufferBuilder& _fbb, uint64_t identifier = 0) {
GetFunctionRequestBuilder builder_(_fbb); GetFunctionRequestBuilder builder_(_fbb);
builder_.add_identifier(identifier); builder_.add_identifier(identifier);
return builder_.Finish(); return builder_.Finish();
@ -519,8 +519,8 @@ inline flatbuffers::Offset<GetFunctionRequest> CreateGetFunctionRequest(
struct GetFunctionResponse FLATBUFFERS_FINAL_CLASS struct GetFunctionResponse FLATBUFFERS_FINAL_CLASS
: private flatbuffers::Table { : private flatbuffers::Table {
const Function *function() const { return GetPointer<const Function *>(4); } const Function* function() const { return GetPointer<const Function*>(4); }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* function */) && VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* function */) &&
verifier.VerifyTable(function()) && verifier.EndTable(); verifier.VerifyTable(function()) && verifier.EndTable();
@ -528,16 +528,16 @@ struct GetFunctionResponse FLATBUFFERS_FINAL_CLASS
}; };
struct GetFunctionResponseBuilder { struct GetFunctionResponseBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_function(flatbuffers::Offset<Function> function) { void add_function(flatbuffers::Offset<Function> function) {
fbb_.AddOffset(4, function); fbb_.AddOffset(4, function);
} }
GetFunctionResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) GetFunctionResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb)
: fbb_(_fbb) { : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
GetFunctionResponseBuilder &operator=(const GetFunctionResponseBuilder &); GetFunctionResponseBuilder& operator=(const GetFunctionResponseBuilder&);
flatbuffers::Offset<GetFunctionResponse> Finish() { flatbuffers::Offset<GetFunctionResponse> Finish() {
auto o = flatbuffers::Offset<GetFunctionResponse>(fbb_.EndTable(start_, 1)); auto o = flatbuffers::Offset<GetFunctionResponse>(fbb_.EndTable(start_, 1));
return o; return o;
@ -545,7 +545,7 @@ struct GetFunctionResponseBuilder {
}; };
inline flatbuffers::Offset<GetFunctionResponse> CreateGetFunctionResponse( inline flatbuffers::Offset<GetFunctionResponse> CreateGetFunctionResponse(
flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::FlatBufferBuilder& _fbb,
flatbuffers::Offset<Function> function = 0) { flatbuffers::Offset<Function> function = 0) {
GetFunctionResponseBuilder builder_(_fbb); GetFunctionResponseBuilder builder_(_fbb);
builder_.add_function(function); builder_.add_function(function);

View File

@ -23,18 +23,18 @@ struct ListThreadsResponse;
enum ThreadType { ThreadType_Kernel = 0, ThreadType_User = 1 }; enum ThreadType { ThreadType_Kernel = 0, ThreadType_User = 1 };
inline const char **EnumNamesThreadType() { inline const char** EnumNamesThreadType() {
static const char *names[] = {"Kernel", "User", nullptr}; static const char* names[] = {"Kernel", "User", nullptr};
return names; return names;
} }
inline const char *EnumNameThreadType(ThreadType e) { inline const char* EnumNameThreadType(ThreadType e) {
return EnumNamesThreadType()[e]; return EnumNamesThreadType()[e];
} }
struct Thread FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct Thread FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
const xe::debug::proto::XObject *object() const { const xe::debug::proto::XObject* object() const {
return GetStruct<const xe::debug::proto::XObject *>(4); return GetStruct<const xe::debug::proto::XObject*>(4);
} }
ThreadType type() const { ThreadType type() const {
return static_cast<ThreadType>(GetField<int8_t>(6, 0)); return static_cast<ThreadType>(GetField<int8_t>(6, 0));
@ -48,13 +48,13 @@ struct Thread FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
uint32_t pcr_address() const { return GetField<uint32_t>(20, 0); } uint32_t pcr_address() const { return GetField<uint32_t>(20, 0); }
uint32_t thread_state_address() const { return GetField<uint32_t>(22, 0); } uint32_t thread_state_address() const { return GetField<uint32_t>(22, 0); }
uint32_t thread_id() const { return GetField<uint32_t>(24, 0); } uint32_t thread_id() const { return GetField<uint32_t>(24, 0); }
const flatbuffers::String *name() const { const flatbuffers::String* name() const {
return GetPointer<const flatbuffers::String *>(26); return GetPointer<const flatbuffers::String*>(26);
} }
uint32_t priority() const { return GetField<uint32_t>(28, 0); } uint32_t priority() const { return GetField<uint32_t>(28, 0); }
uint32_t affinity() const { return GetField<uint32_t>(30, 0); } uint32_t affinity() const { return GetField<uint32_t>(30, 0); }
uint32_t state() const { return GetField<uint32_t>(32, 0); } uint32_t state() const { return GetField<uint32_t>(32, 0); }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<xe::debug::proto::XObject>(verifier, 4 /* object */) && VerifyField<xe::debug::proto::XObject>(verifier, 4 /* object */) &&
VerifyField<int8_t>(verifier, 6 /* type */) && VerifyField<int8_t>(verifier, 6 /* type */) &&
@ -77,9 +77,9 @@ struct Thread FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
}; };
struct ThreadBuilder { struct ThreadBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_object(const xe::debug::proto::XObject *object) { void add_object(const xe::debug::proto::XObject* object) {
fbb_.AddStruct(4, object); fbb_.AddStruct(4, object);
} }
void add_type(ThreadType type) { void add_type(ThreadType type) {
@ -122,10 +122,10 @@ struct ThreadBuilder {
fbb_.AddElement<uint32_t>(30, affinity, 0); fbb_.AddElement<uint32_t>(30, affinity, 0);
} }
void add_state(uint32_t state) { fbb_.AddElement<uint32_t>(32, state, 0); } void add_state(uint32_t state) { fbb_.AddElement<uint32_t>(32, state, 0); }
ThreadBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { ThreadBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
ThreadBuilder &operator=(const ThreadBuilder &); ThreadBuilder& operator=(const ThreadBuilder&);
flatbuffers::Offset<Thread> Finish() { flatbuffers::Offset<Thread> Finish() {
auto o = flatbuffers::Offset<Thread>(fbb_.EndTable(start_, 15)); auto o = flatbuffers::Offset<Thread>(fbb_.EndTable(start_, 15));
return o; return o;
@ -133,8 +133,8 @@ struct ThreadBuilder {
}; };
inline flatbuffers::Offset<Thread> CreateThread( inline flatbuffers::Offset<Thread> CreateThread(
flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::FlatBufferBuilder& _fbb,
const xe::debug::proto::XObject *object = 0, const xe::debug::proto::XObject* object = 0,
ThreadType type = ThreadType_Kernel, uint32_t stack_size = 0, ThreadType type = ThreadType_Kernel, uint32_t stack_size = 0,
uint32_t xapi_thread_startup = 0, uint32_t start_address = 0, uint32_t xapi_thread_startup = 0, uint32_t start_address = 0,
uint32_t start_context = 0, uint32_t creation_flags = 0, uint32_t start_context = 0, uint32_t creation_flags = 0,
@ -162,18 +162,18 @@ inline flatbuffers::Offset<Thread> CreateThread(
} }
struct ListThreadsRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { struct ListThreadsRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && verifier.EndTable(); return VerifyTableStart(verifier) && verifier.EndTable();
} }
}; };
struct ListThreadsRequestBuilder { struct ListThreadsRequestBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
ListThreadsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { ListThreadsRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
ListThreadsRequestBuilder &operator=(const ListThreadsRequestBuilder &); ListThreadsRequestBuilder& operator=(const ListThreadsRequestBuilder&);
flatbuffers::Offset<ListThreadsRequest> Finish() { flatbuffers::Offset<ListThreadsRequest> Finish() {
auto o = flatbuffers::Offset<ListThreadsRequest>(fbb_.EndTable(start_, 0)); auto o = flatbuffers::Offset<ListThreadsRequest>(fbb_.EndTable(start_, 0));
return o; return o;
@ -181,18 +181,18 @@ struct ListThreadsRequestBuilder {
}; };
inline flatbuffers::Offset<ListThreadsRequest> CreateListThreadsRequest( inline flatbuffers::Offset<ListThreadsRequest> CreateListThreadsRequest(
flatbuffers::FlatBufferBuilder &_fbb) { flatbuffers::FlatBufferBuilder& _fbb) {
ListThreadsRequestBuilder builder_(_fbb); ListThreadsRequestBuilder builder_(_fbb);
return builder_.Finish(); return builder_.Finish();
} }
struct ListThreadsResponse FLATBUFFERS_FINAL_CLASS struct ListThreadsResponse FLATBUFFERS_FINAL_CLASS
: private flatbuffers::Table { : private flatbuffers::Table {
const flatbuffers::Vector<flatbuffers::Offset<Thread>> *thread() const { const flatbuffers::Vector<flatbuffers::Offset<Thread>>* thread() const {
return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Thread>> *>( return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Thread>>*>(
4); 4);
} }
bool Verify(flatbuffers::Verifier &verifier) const { bool Verify(flatbuffers::Verifier& verifier) const {
return VerifyTableStart(verifier) && return VerifyTableStart(verifier) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* thread */) && VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* thread */) &&
verifier.Verify(thread()) && verifier.Verify(thread()) &&
@ -201,17 +201,17 @@ struct ListThreadsResponse FLATBUFFERS_FINAL_CLASS
}; };
struct ListThreadsResponseBuilder { struct ListThreadsResponseBuilder {
flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::FlatBufferBuilder& fbb_;
flatbuffers::uoffset_t start_; flatbuffers::uoffset_t start_;
void add_thread(flatbuffers::Offset< void add_thread(flatbuffers::Offset<
flatbuffers::Vector<flatbuffers::Offset<Thread>>> thread) { flatbuffers::Vector<flatbuffers::Offset<Thread>>> thread) {
fbb_.AddOffset(4, thread); fbb_.AddOffset(4, thread);
} }
ListThreadsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) ListThreadsResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb)
: fbb_(_fbb) { : fbb_(_fbb) {
start_ = fbb_.StartTable(); start_ = fbb_.StartTable();
} }
ListThreadsResponseBuilder &operator=(const ListThreadsResponseBuilder &); ListThreadsResponseBuilder& operator=(const ListThreadsResponseBuilder&);
flatbuffers::Offset<ListThreadsResponse> Finish() { flatbuffers::Offset<ListThreadsResponse> Finish() {
auto o = flatbuffers::Offset<ListThreadsResponse>(fbb_.EndTable(start_, 1)); auto o = flatbuffers::Offset<ListThreadsResponse>(fbb_.EndTable(start_, 1));
return o; return o;
@ -219,7 +219,7 @@ struct ListThreadsResponseBuilder {
}; };
inline flatbuffers::Offset<ListThreadsResponse> CreateListThreadsResponse( inline flatbuffers::Offset<ListThreadsResponse> CreateListThreadsResponse(
flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::FlatBufferBuilder& _fbb,
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Thread>>> flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Thread>>>
thread = 0) { thread = 0) {
ListThreadsResponseBuilder builder_(_fbb); ListThreadsResponseBuilder builder_(_fbb);

View File

@ -29,7 +29,7 @@
namespace xe { namespace xe {
namespace kernel { namespace kernel {
uint32_t xex2_get_header_size(const xex2_header *header) { uint32_t xex2_get_header_size(const xex2_header* header) {
return header->exe_offset; return header->exe_offset;
} }
} // namespace kernel } // namespace kernel
@ -48,41 +48,40 @@ uint32_t xex2_get_header_size(const xex2_header *header) {
DEFINE_bool(xex_dev_key, false, "Use the devkit key."); DEFINE_bool(xex_dev_key, false, "Use the devkit key.");
typedef struct xe_xex2 { typedef struct xe_xex2 {
xe::Memory *memory; xe::Memory* memory;
xe_xex2_header_t header; xe_xex2_header_t header;
std::vector<PESection *> *sections; std::vector<PESection*>* sections;
struct { struct {
size_t count; size_t count;
xe_xex2_import_info_t *infos; xe_xex2_import_info_t* infos;
} library_imports[16]; } library_imports[16];
} xe_xex2_t; } xe_xex2_t;
int xe_xex2_read_header(const uint8_t *addr, const size_t length, int xe_xex2_read_header(const uint8_t* addr, const size_t length,
xe_xex2_header_t *header); xe_xex2_header_t* header);
int xe_xex2_decrypt_key(xe_xex2_header_t *header); int xe_xex2_decrypt_key(xe_xex2_header_t* header);
int xe_xex2_read_image(xe_xex2_ref xex, const uint8_t *xex_addr, int xe_xex2_read_image(xe_xex2_ref xex, const uint8_t* xex_addr,
const uint32_t xex_length, xe::Memory *memory); const uint32_t xex_length, xe::Memory* memory);
int xe_xex2_load_pe(xe_xex2_ref xex); int xe_xex2_load_pe(xe_xex2_ref xex);
int xe_xex2_find_import_infos(xe_xex2_ref xex, int xe_xex2_find_import_infos(xe_xex2_ref xex,
const xe_xex2_import_library_t *library); const xe_xex2_import_library_t* library);
xe_xex2_ref xe_xex2_load(xe::Memory *memory, const void *addr, xe_xex2_ref xe_xex2_load(xe::Memory* memory, const void* addr,
const size_t length, xe_xex2_options_t options) { const size_t length, xe_xex2_options_t options) {
xe_xex2_ref xex = (xe_xex2_ref)calloc(1, sizeof(xe_xex2)); xe_xex2_ref xex = (xe_xex2_ref)calloc(1, sizeof(xe_xex2));
xex->memory = memory; xex->memory = memory;
xex->sections = new std::vector<PESection *>(); xex->sections = new std::vector<PESection*>();
XEEXPECTZERO( XEEXPECTZERO(xe_xex2_read_header((const uint8_t*)addr, length, &xex->header));
xe_xex2_read_header((const uint8_t *)addr, length, &xex->header));
XEEXPECTZERO(xe_xex2_decrypt_key(&xex->header)); XEEXPECTZERO(xe_xex2_decrypt_key(&xex->header));
XEEXPECTZERO( XEEXPECTZERO(
xe_xex2_read_image(xex, (const uint8_t *)addr, uint32_t(length), memory)); xe_xex2_read_image(xex, (const uint8_t*)addr, uint32_t(length), memory));
XEEXPECTZERO(xe_xex2_load_pe(xex)); XEEXPECTZERO(xe_xex2_load_pe(xex));
@ -103,35 +102,35 @@ void xe_xex2_dealloc(xe_xex2_ref xex) {
return; return;
} }
for (std::vector<PESection *>::iterator it = xex->sections->begin(); for (std::vector<PESection*>::iterator it = xex->sections->begin();
it != xex->sections->end(); ++it) { it != xex->sections->end(); ++it) {
delete *it; delete *it;
} }
xe_xex2_header_t *header = &xex->header; xe_xex2_header_t* header = &xex->header;
free(header->sections); free(header->sections);
free(header->resource_infos); free(header->resource_infos);
if (header->file_format_info.compression_type == XEX_COMPRESSION_BASIC) { if (header->file_format_info.compression_type == XEX_COMPRESSION_BASIC) {
free(header->file_format_info.compression_info.basic.blocks); free(header->file_format_info.compression_info.basic.blocks);
} }
for (size_t n = 0; n < header->import_library_count; n++) { for (size_t n = 0; n < header->import_library_count; n++) {
xe_xex2_import_library_t *library = &header->import_libraries[n]; xe_xex2_import_library_t* library = &header->import_libraries[n];
free(library->records); free(library->records);
} }
xex->memory = NULL; xex->memory = NULL;
} }
const xe_xex2_header_t *xe_xex2_get_header(xe_xex2_ref xex) { const xe_xex2_header_t* xe_xex2_get_header(xe_xex2_ref xex) {
return &xex->header; return &xex->header;
} }
int xe_xex2_read_header(const uint8_t *addr, const size_t length, int xe_xex2_read_header(const uint8_t* addr, const size_t length,
xe_xex2_header_t *header) { xe_xex2_header_t* header) {
const uint8_t *p = addr; const uint8_t* p = addr;
const uint8_t *pc; const uint8_t* pc;
const uint8_t *ps; const uint8_t* ps;
xe_xex2_loader_info_t *ldr; xe_xex2_loader_info_t* ldr;
header->xex2 = xe::load_and_swap<uint32_t>(p + 0x00); header->xex2 = xe::load_and_swap<uint32_t>(p + 0x00);
if (header->xex2 != 'XEX2') { if (header->xex2 != 'XEX2') {
@ -146,11 +145,11 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length,
header->header_count = xe::load_and_swap<uint32_t>(p + 0x14); header->header_count = xe::load_and_swap<uint32_t>(p + 0x14);
for (size_t n = 0; n < header->header_count; n++) { for (size_t n = 0; n < header->header_count; n++) {
const uint8_t *ph = p + 0x18 + (n * 8); const uint8_t* ph = p + 0x18 + (n * 8);
const uint32_t key = xe::load_and_swap<uint32_t>(ph + 0x00); const uint32_t key = xe::load_and_swap<uint32_t>(ph + 0x00);
const uint32_t data_offset = xe::load_and_swap<uint32_t>(ph + 0x04); const uint32_t data_offset = xe::load_and_swap<uint32_t>(ph + 0x04);
xe_xex2_opt_header_t *opt_header = &header->headers[n]; xe_xex2_opt_header_t* opt_header = &header->headers[n];
opt_header->key = key; opt_header->key = key;
switch (key & 0xFF) { switch (key & 0xFF) {
case 0x01: case 0x01:
@ -170,18 +169,18 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length,
break; break;
} }
const uint8_t *pp = p + opt_header->offset; const uint8_t* pp = p + opt_header->offset;
switch (opt_header->key) { switch (opt_header->key) {
case XEX_HEADER_SYSTEM_FLAGS: case XEX_HEADER_SYSTEM_FLAGS:
header->system_flags = (xe_xex2_system_flags)data_offset; header->system_flags = (xe_xex2_system_flags)data_offset;
break; break;
case XEX_HEADER_RESOURCE_INFO: { case XEX_HEADER_RESOURCE_INFO: {
header->resource_info_count = (opt_header->length - 4) / 16; header->resource_info_count = (opt_header->length - 4) / 16;
header->resource_infos = (xe_xex2_resource_info_t *)calloc( header->resource_infos = (xe_xex2_resource_info_t*)calloc(
header->resource_info_count, sizeof(xe_xex2_resource_info_t)); header->resource_info_count, sizeof(xe_xex2_resource_info_t));
const uint8_t *phi = pp + 0x04; const uint8_t* phi = pp + 0x04;
for (size_t m = 0; m < header->resource_info_count; m++) { for (size_t m = 0; m < header->resource_info_count; m++) {
auto &res = header->resource_infos[m]; auto& res = header->resource_infos[m];
memcpy(res.name, phi + 0x00, 8); memcpy(res.name, phi + 0x00, 8);
res.address = xe::load_and_swap<uint32_t>(phi + 0x08); res.address = xe::load_and_swap<uint32_t>(phi + 0x08);
res.size = xe::load_and_swap<uint32_t>(phi + 0x0C); res.size = xe::load_and_swap<uint32_t>(phi + 0x0C);
@ -189,7 +188,7 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length,
} }
} break; } break;
case XEX_HEADER_EXECUTION_INFO: { case XEX_HEADER_EXECUTION_INFO: {
xe_xex2_execution_info_t *ex = &header->execution_info; xe_xex2_execution_info_t* ex = &header->execution_info;
ex->media_id = xe::load_and_swap<uint32_t>(pp + 0x00); ex->media_id = xe::load_and_swap<uint32_t>(pp + 0x00);
ex->version.value = xe::load_and_swap<uint32_t>(pp + 0x04); ex->version.value = xe::load_and_swap<uint32_t>(pp + 0x04);
ex->base_version.value = xe::load_and_swap<uint32_t>(pp + 0x08); ex->base_version.value = xe::load_and_swap<uint32_t>(pp + 0x08);
@ -201,7 +200,7 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length,
ex->savegame_id = xe::load_and_swap<uint32_t>(pp + 0x14); ex->savegame_id = xe::load_and_swap<uint32_t>(pp + 0x14);
} break; } break;
case XEX_HEADER_GAME_RATINGS: { case XEX_HEADER_GAME_RATINGS: {
xe_xex2_game_ratings_t *ratings = &header->game_ratings; xe_xex2_game_ratings_t* ratings = &header->game_ratings;
ratings->esrb = ratings->esrb =
(xe_xex2_rating_esrb_value)xe::load_and_swap<uint8_t>(pp + 0x00); (xe_xex2_rating_esrb_value)xe::load_and_swap<uint8_t>(pp + 0x00);
ratings->pegi = ratings->pegi =
@ -228,7 +227,7 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length,
(xe_xex2_rating_fpb_value)xe::load_and_swap<uint8_t>(pp + 0x0B); (xe_xex2_rating_fpb_value)xe::load_and_swap<uint8_t>(pp + 0x0B);
} break; } break;
case XEX_HEADER_TLS_INFO: { case XEX_HEADER_TLS_INFO: {
xe_xex2_tls_info_t *tls = &header->tls_info; xe_xex2_tls_info_t* tls = &header->tls_info;
tls->slot_count = xe::load_and_swap<uint32_t>(pp + 0x00); tls->slot_count = xe::load_and_swap<uint32_t>(pp + 0x00);
tls->raw_data_address = xe::load_and_swap<uint32_t>(pp + 0x04); tls->raw_data_address = xe::load_and_swap<uint32_t>(pp + 0x04);
tls->data_size = xe::load_and_swap<uint32_t>(pp + 0x08); tls->data_size = xe::load_and_swap<uint32_t>(pp + 0x08);
@ -263,11 +262,11 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length,
header->import_library_count = count; header->import_library_count = count;
uint32_t string_table_size = xe::load_and_swap<uint32_t>(pp + 0x04); uint32_t string_table_size = xe::load_and_swap<uint32_t>(pp + 0x04);
const char *string_table = (const char *)(pp + 0x0C); const char* string_table = (const char*)(pp + 0x0C);
pp += 12 + string_table_size; pp += 12 + string_table_size;
for (size_t m = 0; m < count; m++) { for (size_t m = 0; m < count; m++) {
xe_xex2_import_library_t *library = &header->import_libraries[m]; xe_xex2_import_library_t* library = &header->import_libraries[m];
memcpy(library->digest, pp + 0x04, 20); memcpy(library->digest, pp + 0x04, 20);
library->import_id = xe::load_and_swap<uint32_t>(pp + 0x18); library->import_id = xe::load_and_swap<uint32_t>(pp + 0x18);
library->version.value = xe::load_and_swap<uint32_t>(pp + 0x1C); library->version.value = xe::load_and_swap<uint32_t>(pp + 0x1C);
@ -295,7 +294,7 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length,
library->record_count = xe::load_and_swap<uint16_t>(pp + 0x26); library->record_count = xe::load_and_swap<uint16_t>(pp + 0x26);
library->records = library->records =
(uint32_t *)calloc(library->record_count, sizeof(uint32_t)); (uint32_t*)calloc(library->record_count, sizeof(uint32_t));
XEEXPECTNOTNULL(library->records); XEEXPECTNOTNULL(library->records);
pp += 0x28; pp += 0x28;
for (size_t i = 0; i < library->record_count; i++) { for (size_t i = 0; i < library->record_count; i++) {
@ -316,7 +315,7 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length,
header->static_library_count = count; header->static_library_count = count;
pp += 4; pp += 4;
for (size_t m = 0; m < count; m++) { for (size_t m = 0; m < count; m++) {
xe_xex2_static_library_t *library = &header->static_libraries[m]; xe_xex2_static_library_t* library = &header->static_libraries[m];
memcpy(library->name, pp + 0x00, 8); memcpy(library->name, pp + 0x00, 8);
library->name[8] = 0; library->name[8] = 0;
library->major = xe::load_and_swap<uint16_t>(pp + 0x08); library->major = xe::load_and_swap<uint16_t>(pp + 0x08);
@ -329,7 +328,7 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length,
} }
} break; } break;
case XEX_HEADER_FILE_FORMAT_INFO: { case XEX_HEADER_FILE_FORMAT_INFO: {
xe_xex2_file_format_info_t *fmt = &header->file_format_info; xe_xex2_file_format_info_t* fmt = &header->file_format_info;
fmt->encryption_type = fmt->encryption_type =
(xe_xex2_encryption_type)xe::load_and_swap<uint16_t>(pp + 0x04); (xe_xex2_encryption_type)xe::load_and_swap<uint16_t>(pp + 0x04);
fmt->compression_type = fmt->compression_type =
@ -340,17 +339,16 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length,
assert_always(); assert_always();
break; break;
case XEX_COMPRESSION_BASIC: { case XEX_COMPRESSION_BASIC: {
xe_xex2_file_basic_compression_info_t *comp_info = xe_xex2_file_basic_compression_info_t* comp_info =
&fmt->compression_info.basic; &fmt->compression_info.basic;
uint32_t info_size = xe::load_and_swap<uint32_t>(pp + 0x00); uint32_t info_size = xe::load_and_swap<uint32_t>(pp + 0x00);
comp_info->block_count = (info_size - 8) / 8; comp_info->block_count = (info_size - 8) / 8;
comp_info->blocks = comp_info->blocks = (xe_xex2_file_basic_compression_block_t*)calloc(
(xe_xex2_file_basic_compression_block_t *)calloc( comp_info->block_count,
comp_info->block_count, sizeof(xe_xex2_file_basic_compression_block_t));
sizeof(xe_xex2_file_basic_compression_block_t));
XEEXPECTNOTNULL(comp_info->blocks); XEEXPECTNOTNULL(comp_info->blocks);
for (size_t m = 0; m < comp_info->block_count; m++) { for (size_t m = 0; m < comp_info->block_count; m++) {
xe_xex2_file_basic_compression_block_t *block = xe_xex2_file_basic_compression_block_t* block =
&comp_info->blocks[m]; &comp_info->blocks[m];
block->data_size = block->data_size =
xe::load_and_swap<uint32_t>(pp + 0x08 + (m * 8)); xe::load_and_swap<uint32_t>(pp + 0x08 + (m * 8));
@ -359,7 +357,7 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length,
} }
} break; } break;
case XEX_COMPRESSION_NORMAL: { case XEX_COMPRESSION_NORMAL: {
xe_xex2_file_normal_compression_info_t *comp_info = xe_xex2_file_normal_compression_info_t* comp_info =
&fmt->compression_info.normal; &fmt->compression_info.normal;
uint32_t window_size = xe::load_and_swap<uint32_t>(pp + 0x08); uint32_t window_size = xe::load_and_swap<uint32_t>(pp + 0x08);
uint32_t window_bits = 0; uint32_t window_bits = 0;
@ -409,11 +407,11 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length,
ps = p + header->certificate_offset + 0x180; ps = p + header->certificate_offset + 0x180;
header->section_count = xe::load_and_swap<uint32_t>(ps + 0x000); header->section_count = xe::load_and_swap<uint32_t>(ps + 0x000);
ps += 4; ps += 4;
header->sections = (xe_xex2_section_t *)calloc(header->section_count, header->sections = (xe_xex2_section_t*)calloc(header->section_count,
sizeof(xe_xex2_section_t)); sizeof(xe_xex2_section_t));
XEEXPECTNOTNULL(header->sections); XEEXPECTNOTNULL(header->sections);
for (size_t n = 0; n < header->section_count; n++) { for (size_t n = 0; n < header->section_count; n++) {
xe_xex2_section_t *section = &header->sections[n]; xe_xex2_section_t* section = &header->sections[n];
section->page_size = section->page_size =
header->exe_address <= 0x90000000 ? 64 * 1024 : 4 * 1024; header->exe_address <= 0x90000000 ? 64 * 1024 : 4 * 1024;
section->info.value = xe::load_and_swap<uint32_t>(ps); section->info.value = xe::load_and_swap<uint32_t>(ps);
@ -428,7 +426,7 @@ XECLEANUP:
return 1; return 1;
} }
int xe_xex2_decrypt_key(xe_xex2_header_t *header) { int xe_xex2_decrypt_key(xe_xex2_header_t* header) {
const static uint8_t xe_xex2_retail_key[16] = { const static uint8_t xe_xex2_retail_key[16] = {
0x20, 0xB1, 0x85, 0xA5, 0x9D, 0x28, 0xFD, 0xC3, 0x20, 0xB1, 0x85, 0xA5, 0x9D, 0x28, 0xFD, 0xC3,
0x40, 0x58, 0x3F, 0xBB, 0x08, 0x96, 0xBF, 0x91}; 0x40, 0x58, 0x3F, 0xBB, 0x08, 0x96, 0xBF, 0x91};
@ -438,7 +436,7 @@ int xe_xex2_decrypt_key(xe_xex2_header_t *header) {
// Guess key based on file info. // Guess key based on file info.
// TODO: better way to finding out which key to use? // TODO: better way to finding out which key to use?
const uint8_t *xexkey; const uint8_t* xexkey;
if (header->execution_info.title_id && !FLAGS_xex_dev_key) { if (header->execution_info.title_id && !FLAGS_xex_dev_key) {
xexkey = xe_xex2_retail_key; xexkey = xe_xex2_retail_key;
} else { } else {
@ -455,18 +453,18 @@ int xe_xex2_decrypt_key(xe_xex2_header_t *header) {
typedef struct mspack_memory_file_t { typedef struct mspack_memory_file_t {
struct mspack_system sys; struct mspack_system sys;
void *buffer; void* buffer;
off_t buffer_size; off_t buffer_size;
off_t offset; off_t offset;
} mspack_memory_file; } mspack_memory_file;
mspack_memory_file *mspack_memory_open(struct mspack_system *sys, void *buffer, mspack_memory_file* mspack_memory_open(struct mspack_system* sys, void* buffer,
const size_t buffer_size) { const size_t buffer_size) {
assert_true(buffer_size < INT_MAX); assert_true(buffer_size < INT_MAX);
if (buffer_size >= INT_MAX) { if (buffer_size >= INT_MAX) {
return NULL; return NULL;
} }
mspack_memory_file *memfile = mspack_memory_file* memfile =
(mspack_memory_file *)calloc(1, sizeof(mspack_memory_file)); (mspack_memory_file*)calloc(1, sizeof(mspack_memory_file));
if (!memfile) { if (!memfile) {
return NULL; return NULL;
} }
@ -475,36 +473,36 @@ mspack_memory_file *mspack_memory_open(struct mspack_system *sys, void *buffer,
memfile->offset = 0; memfile->offset = 0;
return memfile; return memfile;
} }
void mspack_memory_close(mspack_memory_file *file) { void mspack_memory_close(mspack_memory_file* file) {
mspack_memory_file *memfile = (mspack_memory_file *)file; mspack_memory_file* memfile = (mspack_memory_file*)file;
free(memfile); free(memfile);
} }
int mspack_memory_read(struct mspack_file *file, void *buffer, int chars) { int mspack_memory_read(struct mspack_file* file, void* buffer, int chars) {
mspack_memory_file *memfile = (mspack_memory_file *)file; mspack_memory_file* memfile = (mspack_memory_file*)file;
const off_t remaining = memfile->buffer_size - memfile->offset; const off_t remaining = memfile->buffer_size - memfile->offset;
const off_t total = std::min(static_cast<off_t>(chars), remaining); const off_t total = std::min(static_cast<off_t>(chars), remaining);
memcpy(buffer, (uint8_t *)memfile->buffer + memfile->offset, total); memcpy(buffer, (uint8_t*)memfile->buffer + memfile->offset, total);
memfile->offset += total; memfile->offset += total;
return (int)total; return (int)total;
} }
int mspack_memory_write(struct mspack_file *file, void *buffer, int chars) { int mspack_memory_write(struct mspack_file* file, void* buffer, int chars) {
mspack_memory_file *memfile = (mspack_memory_file *)file; mspack_memory_file* memfile = (mspack_memory_file*)file;
const off_t remaining = memfile->buffer_size - memfile->offset; const off_t remaining = memfile->buffer_size - memfile->offset;
const off_t total = std::min(static_cast<off_t>(chars), remaining); const off_t total = std::min(static_cast<off_t>(chars), remaining);
memcpy((uint8_t *)memfile->buffer + memfile->offset, buffer, total); memcpy((uint8_t*)memfile->buffer + memfile->offset, buffer, total);
memfile->offset += total; memfile->offset += total;
return (int)total; return (int)total;
} }
void *mspack_memory_alloc(struct mspack_system *sys, size_t chars) { void* mspack_memory_alloc(struct mspack_system* sys, size_t chars) {
return calloc(chars, 1); return calloc(chars, 1);
} }
void mspack_memory_free(void *ptr) { free(ptr); } void mspack_memory_free(void* ptr) { free(ptr); }
void mspack_memory_copy(void *src, void *dest, size_t chars) { void mspack_memory_copy(void* src, void* dest, size_t chars) {
memcpy(dest, src, chars); memcpy(dest, src, chars);
} }
struct mspack_system *mspack_memory_sys_create() { struct mspack_system* mspack_memory_sys_create() {
struct mspack_system *sys = struct mspack_system* sys =
(struct mspack_system *)calloc(1, sizeof(struct mspack_system)); (struct mspack_system*)calloc(1, sizeof(struct mspack_system));
if (!sys) { if (!sys) {
return NULL; return NULL;
} }
@ -515,17 +513,17 @@ struct mspack_system *mspack_memory_sys_create() {
sys->copy = mspack_memory_copy; sys->copy = mspack_memory_copy;
return sys; return sys;
} }
void mspack_memory_sys_destroy(struct mspack_system *sys) { free(sys); } void mspack_memory_sys_destroy(struct mspack_system* sys) { free(sys); }
void xe_xex2_decrypt_buffer(const uint8_t *session_key, void xe_xex2_decrypt_buffer(const uint8_t* session_key,
const uint8_t *input_buffer, const uint8_t* input_buffer,
const size_t input_size, uint8_t *output_buffer, const size_t input_size, uint8_t* output_buffer,
const size_t output_size) { const size_t output_size) {
uint32_t rk[4 * (MAXNR + 1)]; uint32_t rk[4 * (MAXNR + 1)];
uint8_t ivec[16] = {0}; uint8_t ivec[16] = {0};
int32_t Nr = rijndaelKeySetupDec(rk, session_key, 128); int32_t Nr = rijndaelKeySetupDec(rk, session_key, 128);
const uint8_t *ct = input_buffer; const uint8_t* ct = input_buffer;
uint8_t *pt = output_buffer; uint8_t* pt = output_buffer;
for (size_t n = 0; n < input_size; n += 16, ct += 16, pt += 16) { for (size_t n = 0; n < input_size; n += 16, ct += 16, pt += 16) {
// Decrypt 16 uint8_ts from input -> output. // Decrypt 16 uint8_ts from input -> output.
rijndaelDecrypt(rk, Nr, ct, pt); rijndaelDecrypt(rk, Nr, ct, pt);
@ -538,10 +536,10 @@ void xe_xex2_decrypt_buffer(const uint8_t *session_key,
} }
} }
int xe_xex2_read_image_uncompressed(const xe_xex2_header_t *header, int xe_xex2_read_image_uncompressed(const xe_xex2_header_t* header,
const uint8_t *xex_addr, const uint8_t* xex_addr,
const uint32_t xex_length, const uint32_t xex_length,
xe::Memory *memory) { xe::Memory* memory) {
// Allocate in-place the XEX memory. // Allocate in-place the XEX memory.
const uint32_t exe_length = xex_length - header->exe_offset; const uint32_t exe_length = xex_length - header->exe_offset;
uint32_t uncompressed_size = exe_length; uint32_t uncompressed_size = exe_length;
@ -556,10 +554,10 @@ int xe_xex2_read_image_uncompressed(const xe_xex2_header_t *header,
uncompressed_size); uncompressed_size);
return 2; return 2;
} }
uint8_t *buffer = memory->TranslateVirtual(header->exe_address); uint8_t* buffer = memory->TranslateVirtual(header->exe_address);
std::memset(buffer, 0, uncompressed_size); std::memset(buffer, 0, uncompressed_size);
const uint8_t *p = (const uint8_t *)xex_addr + header->exe_offset; const uint8_t* p = (const uint8_t*)xex_addr + header->exe_offset;
switch (header->file_format_info.encryption_type) { switch (header->file_format_info.encryption_type) {
case XEX_ENCRYPTION_NONE: case XEX_ENCRYPTION_NONE:
@ -580,17 +578,17 @@ int xe_xex2_read_image_uncompressed(const xe_xex2_header_t *header,
return 0; return 0;
} }
int xe_xex2_read_image_basic_compressed(const xe_xex2_header_t *header, int xe_xex2_read_image_basic_compressed(const xe_xex2_header_t* header,
const uint8_t *xex_addr, const uint8_t* xex_addr,
const uint32_t xex_length, const uint32_t xex_length,
xe::Memory *memory) { xe::Memory* memory) {
const uint32_t exe_length = xex_length - header->exe_offset; const uint32_t exe_length = xex_length - header->exe_offset;
const uint8_t *source_buffer = (const uint8_t *)xex_addr + header->exe_offset; const uint8_t* source_buffer = (const uint8_t*)xex_addr + header->exe_offset;
const uint8_t *p = source_buffer; const uint8_t* p = source_buffer;
// Calculate uncompressed length. // Calculate uncompressed length.
uint32_t uncompressed_size = 0; uint32_t uncompressed_size = 0;
const xe_xex2_file_basic_compression_info_t *comp_info = const xe_xex2_file_basic_compression_info_t* comp_info =
&header->file_format_info.compression_info.basic; &header->file_format_info.compression_info.basic;
for (uint32_t n = 0; n < comp_info->block_count; n++) { for (uint32_t n = 0; n < comp_info->block_count; n++) {
const uint32_t data_size = comp_info->blocks[n].data_size; const uint32_t data_size = comp_info->blocks[n].data_size;
@ -601,7 +599,7 @@ int xe_xex2_read_image_basic_compressed(const xe_xex2_header_t *header,
// Calculate the total size of the XEX image from its headers. // Calculate the total size of the XEX image from its headers.
uint32_t total_size = 0; uint32_t total_size = 0;
for (uint32_t i = 0; i < header->section_count; i++) { for (uint32_t i = 0; i < header->section_count; i++) {
xe_xex2_section_t &section = header->sections[i]; xe_xex2_section_t& section = header->sections[i];
total_size += section.info.page_count * section.page_size; total_size += section.info.page_count * section.page_size;
} }
@ -618,9 +616,9 @@ int xe_xex2_read_image_basic_compressed(const xe_xex2_header_t *header,
uncompressed_size); uncompressed_size);
return 1; return 1;
} }
uint8_t *buffer = memory->TranslateVirtual(header->exe_address); uint8_t* buffer = memory->TranslateVirtual(header->exe_address);
std::memset(buffer, 0, total_size); // Quickly zero the contents. std::memset(buffer, 0, total_size); // Quickly zero the contents.
uint8_t *d = buffer; uint8_t* d = buffer;
uint32_t rk[4 * (MAXNR + 1)]; uint32_t rk[4 * (MAXNR + 1)];
uint8_t ivec[16] = {0}; uint8_t ivec[16] = {0};
@ -640,8 +638,8 @@ int xe_xex2_read_image_basic_compressed(const xe_xex2_header_t *header,
memcpy(d, p, exe_length - (p - source_buffer)); memcpy(d, p, exe_length - (p - source_buffer));
break; break;
case XEX_ENCRYPTION_NORMAL: { case XEX_ENCRYPTION_NORMAL: {
const uint8_t *ct = p; const uint8_t* ct = p;
uint8_t *pt = d; uint8_t* pt = d;
for (size_t m = 0; m < data_size; m += 16, ct += 16, pt += 16) { for (size_t m = 0; m < data_size; m += 16, ct += 16, pt += 16) {
// Decrypt 16 uint8_ts from input -> output. // Decrypt 16 uint8_ts from input -> output.
rijndaelDecrypt(rk, Nr, ct, pt); rijndaelDecrypt(rk, Nr, ct, pt);
@ -665,12 +663,12 @@ int xe_xex2_read_image_basic_compressed(const xe_xex2_header_t *header,
return 0; return 0;
} }
int xe_xex2_read_image_compressed(const xe_xex2_header_t *header, int xe_xex2_read_image_compressed(const xe_xex2_header_t* header,
const uint8_t *xex_addr, const uint8_t* xex_addr,
const uint32_t xex_length, const uint32_t xex_length,
xe::Memory *memory) { xe::Memory* memory) {
const uint32_t exe_length = xex_length - header->exe_offset; const uint32_t exe_length = xex_length - header->exe_offset;
const uint8_t *exe_buffer = (const uint8_t *)xex_addr + header->exe_offset; const uint8_t* exe_buffer = (const uint8_t*)xex_addr + header->exe_offset;
// src -> dest: // src -> dest:
// - decrypt (if encrypted) // - decrypt (if encrypted)
@ -682,20 +680,20 @@ int xe_xex2_read_image_compressed(const xe_xex2_header_t *header,
int result_code = 1; int result_code = 1;
uint8_t *compress_buffer = NULL; uint8_t* compress_buffer = NULL;
const uint8_t *p = NULL; const uint8_t* p = NULL;
uint8_t *d = NULL; uint8_t* d = NULL;
uint8_t *deblock_buffer = NULL; uint8_t* deblock_buffer = NULL;
size_t block_size = 0; size_t block_size = 0;
uint32_t uncompressed_size = 0; uint32_t uncompressed_size = 0;
struct mspack_system *sys = NULL; struct mspack_system* sys = NULL;
mspack_memory_file *lzxsrc = NULL; mspack_memory_file* lzxsrc = NULL;
mspack_memory_file *lzxdst = NULL; mspack_memory_file* lzxdst = NULL;
struct lzxd_stream *lzxd = NULL; struct lzxd_stream* lzxd = NULL;
// Decrypt (if needed). // Decrypt (if needed).
bool free_input = false; bool free_input = false;
const uint8_t *input_buffer = exe_buffer; const uint8_t* input_buffer = exe_buffer;
const size_t input_size = exe_length; const size_t input_size = exe_length;
switch (header->file_format_info.encryption_type) { switch (header->file_format_info.encryption_type) {
case XEX_ENCRYPTION_NONE: case XEX_ENCRYPTION_NONE:
@ -704,28 +702,28 @@ int xe_xex2_read_image_compressed(const xe_xex2_header_t *header,
case XEX_ENCRYPTION_NORMAL: case XEX_ENCRYPTION_NORMAL:
// TODO: a way to do without a copy/alloc? // TODO: a way to do without a copy/alloc?
free_input = true; free_input = true;
input_buffer = (const uint8_t *)calloc(1, input_size); input_buffer = (const uint8_t*)calloc(1, input_size);
XEEXPECTNOTNULL(input_buffer); XEEXPECTNOTNULL(input_buffer);
xe_xex2_decrypt_buffer(header->session_key, exe_buffer, exe_length, xe_xex2_decrypt_buffer(header->session_key, exe_buffer, exe_length,
(uint8_t *)input_buffer, input_size); (uint8_t*)input_buffer, input_size);
break; break;
default: default:
assert_always(); assert_always();
return false; return false;
} }
compress_buffer = (uint8_t *)calloc(1, exe_length); compress_buffer = (uint8_t*)calloc(1, exe_length);
XEEXPECTNOTNULL(compress_buffer); XEEXPECTNOTNULL(compress_buffer);
p = input_buffer; p = input_buffer;
d = compress_buffer; d = compress_buffer;
// De-block. // De-block.
deblock_buffer = (uint8_t *)calloc(1, input_size); deblock_buffer = (uint8_t*)calloc(1, input_size);
XEEXPECTNOTNULL(deblock_buffer); XEEXPECTNOTNULL(deblock_buffer);
block_size = header->file_format_info.compression_info.normal.block_size; block_size = header->file_format_info.compression_info.normal.block_size;
while (block_size) { while (block_size) {
const uint8_t *pnext = p + block_size; const uint8_t* pnext = p + block_size;
const size_t next_size = xe::load_and_swap<int32_t>(p); const size_t next_size = xe::load_and_swap<int32_t>(p);
p += 4; p += 4;
p += 20; // skip 20b hash p += 20; // skip 20b hash
@ -760,19 +758,18 @@ int xe_xex2_read_image_compressed(const xe_xex2_header_t *header,
result_code = 2; result_code = 2;
goto XECLEANUP; goto XECLEANUP;
} }
uint8_t *buffer = memory->TranslateVirtual(header->exe_address); uint8_t* buffer = memory->TranslateVirtual(header->exe_address);
std::memset(buffer, 0, uncompressed_size); std::memset(buffer, 0, uncompressed_size);
// Setup decompressor and decompress. // Setup decompressor and decompress.
sys = mspack_memory_sys_create(); sys = mspack_memory_sys_create();
XEEXPECTNOTNULL(sys); XEEXPECTNOTNULL(sys);
lzxsrc = lzxsrc = mspack_memory_open(sys, (void*)compress_buffer, d - compress_buffer);
mspack_memory_open(sys, (void *)compress_buffer, d - compress_buffer);
XEEXPECTNOTNULL(lzxsrc); XEEXPECTNOTNULL(lzxsrc);
lzxdst = mspack_memory_open(sys, buffer, uncompressed_size); lzxdst = mspack_memory_open(sys, buffer, uncompressed_size);
XEEXPECTNOTNULL(lzxdst); XEEXPECTNOTNULL(lzxdst);
lzxd = lzxd =
lzxd_init(sys, (struct mspack_file *)lzxsrc, (struct mspack_file *)lzxdst, lzxd_init(sys, (struct mspack_file*)lzxsrc, (struct mspack_file*)lzxdst,
header->file_format_info.compression_info.normal.window_bits, 0, header->file_format_info.compression_info.normal.window_bits, 0,
32768, (off_t)header->loader_info.image_size); 32768, (off_t)header->loader_info.image_size);
XEEXPECTNOTNULL(lzxd); XEEXPECTNOTNULL(lzxd);
@ -800,14 +797,14 @@ XECLEANUP:
free(compress_buffer); free(compress_buffer);
free(deblock_buffer); free(deblock_buffer);
if (free_input) { if (free_input) {
free((void *)input_buffer); free((void*)input_buffer);
} }
return result_code; return result_code;
} }
int xe_xex2_read_image(xe_xex2_ref xex, const uint8_t *xex_addr, int xe_xex2_read_image(xe_xex2_ref xex, const uint8_t* xex_addr,
const uint32_t xex_length, xe::Memory *memory) { const uint32_t xex_length, xe::Memory* memory) {
const xe_xex2_header_t *header = &xex->header; const xe_xex2_header_t* header = &xex->header;
switch (header->file_format_info.compression_type) { switch (header->file_format_info.compression_type) {
case XEX_COMPRESSION_NONE: case XEX_COMPRESSION_NONE:
return xe_xex2_read_image_uncompressed(header, xex_addr, xex_length, return xe_xex2_read_image_uncompressed(header, xex_addr, xex_length,
@ -825,11 +822,11 @@ int xe_xex2_read_image(xe_xex2_ref xex, const uint8_t *xex_addr,
} }
int xe_xex2_load_pe(xe_xex2_ref xex) { int xe_xex2_load_pe(xe_xex2_ref xex) {
const xe_xex2_header_t *header = &xex->header; const xe_xex2_header_t* header = &xex->header;
const uint8_t *p = xex->memory->TranslateVirtual(header->exe_address); const uint8_t* p = xex->memory->TranslateVirtual(header->exe_address);
// Verify DOS signature (MZ). // Verify DOS signature (MZ).
const IMAGE_DOS_HEADER *doshdr = (const IMAGE_DOS_HEADER *)p; const IMAGE_DOS_HEADER* doshdr = (const IMAGE_DOS_HEADER*)p;
if (doshdr->e_magic != IMAGE_DOS_SIGNATURE) { if (doshdr->e_magic != IMAGE_DOS_SIGNATURE) {
XELOGE("PE signature mismatch; likely bad decryption/decompression"); XELOGE("PE signature mismatch; likely bad decryption/decompression");
return 1; return 1;
@ -839,13 +836,13 @@ int xe_xex2_load_pe(xe_xex2_ref xex) {
p += doshdr->e_lfanew; p += doshdr->e_lfanew;
// Verify NT signature (PE\0\0). // Verify NT signature (PE\0\0).
const IMAGE_NT_HEADERS32 *nthdr = (const IMAGE_NT_HEADERS32 *)(p); const IMAGE_NT_HEADERS32* nthdr = (const IMAGE_NT_HEADERS32*)(p);
if (nthdr->Signature != IMAGE_NT_SIGNATURE) { if (nthdr->Signature != IMAGE_NT_SIGNATURE) {
return 1; return 1;
} }
// Verify matches an Xbox PE. // Verify matches an Xbox PE.
const IMAGE_FILE_HEADER *filehdr = &nthdr->FileHeader; const IMAGE_FILE_HEADER* filehdr = &nthdr->FileHeader;
if ((filehdr->Machine != IMAGE_FILE_MACHINE_POWERPCBE) || if ((filehdr->Machine != IMAGE_FILE_MACHINE_POWERPCBE) ||
!(filehdr->Characteristics & IMAGE_FILE_32BIT_MACHINE)) { !(filehdr->Characteristics & IMAGE_FILE_32BIT_MACHINE)) {
return 1; return 1;
@ -856,7 +853,7 @@ int xe_xex2_load_pe(xe_xex2_ref xex) {
} }
// Verify optional header is 32bit. // Verify optional header is 32bit.
const IMAGE_OPTIONAL_HEADER32 *opthdr = &nthdr->OptionalHeader; const IMAGE_OPTIONAL_HEADER32* opthdr = &nthdr->OptionalHeader;
if (opthdr->Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC) { if (opthdr->Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
return 1; return 1;
} }
@ -882,7 +879,7 @@ int xe_xex2_load_pe(xe_xex2_ref xex) {
// Quick scan to determine bounds of sections. // Quick scan to determine bounds of sections.
size_t upper_address = 0; size_t upper_address = 0;
const IMAGE_SECTION_HEADER *sechdr = IMAGE_FIRST_SECTION(nthdr); const IMAGE_SECTION_HEADER* sechdr = IMAGE_FIRST_SECTION(nthdr);
for (size_t n = 0; n < filehdr->NumberOfSections; n++, sechdr++) { for (size_t n = 0; n < filehdr->NumberOfSections; n++, sechdr++) {
const size_t physical_address = opthdr->ImageBase + sechdr->VirtualAddress; const size_t physical_address = opthdr->ImageBase + sechdr->VirtualAddress;
upper_address = upper_address =
@ -892,7 +889,7 @@ int xe_xex2_load_pe(xe_xex2_ref xex) {
// Setup/load sections. // Setup/load sections.
sechdr = IMAGE_FIRST_SECTION(nthdr); sechdr = IMAGE_FIRST_SECTION(nthdr);
for (size_t n = 0; n < filehdr->NumberOfSections; n++, sechdr++) { for (size_t n = 0; n < filehdr->NumberOfSections; n++, sechdr++) {
PESection *section = (PESection *)calloc(1, sizeof(PESection)); PESection* section = (PESection*)calloc(1, sizeof(PESection));
memcpy(section->name, sechdr->Name, sizeof(sechdr->Name)); memcpy(section->name, sechdr->Name, sizeof(sechdr->Name));
section->name[8] = 0; section->name[8] = 0;
section->raw_address = sechdr->PointerToRawData; section->raw_address = sechdr->PointerToRawData;
@ -908,8 +905,8 @@ int xe_xex2_load_pe(xe_xex2_ref xex) {
return 0; return 0;
} }
const PESection *xe_xex2_get_pe_section(xe_xex2_ref xex, const char *name) { const PESection* xe_xex2_get_pe_section(xe_xex2_ref xex, const char* name) {
for (std::vector<PESection *>::iterator it = xex->sections->begin(); for (std::vector<PESection*>::iterator it = xex->sections->begin();
it != xex->sections->end(); ++it) { it != xex->sections->end(); ++it) {
if (!strcmp((*it)->name, name)) { if (!strcmp((*it)->name, name)) {
return *it; return *it;
@ -919,7 +916,7 @@ const PESection *xe_xex2_get_pe_section(xe_xex2_ref xex, const char *name) {
} }
int xe_xex2_find_import_infos(xe_xex2_ref xex, int xe_xex2_find_import_infos(xe_xex2_ref xex,
const xe_xex2_import_library_t *library) { const xe_xex2_import_library_t* library) {
auto header = xe_xex2_get_header(xex); auto header = xe_xex2_get_header(xex);
// Find library index for verification. // Find library index for verification.
@ -954,8 +951,8 @@ int xe_xex2_find_import_infos(xe_xex2_ref xex,
} }
// Allocate storage. // Allocate storage.
xe_xex2_import_info_t *infos = (xe_xex2_import_info_t *)calloc( xe_xex2_import_info_t* infos =
info_count, sizeof(xe_xex2_import_info_t)); (xe_xex2_import_info_t*)calloc(info_count, sizeof(xe_xex2_import_info_t));
assert_not_null(infos); assert_not_null(infos);
assert_not_zero(info_count); assert_not_zero(info_count);
@ -972,14 +969,14 @@ int xe_xex2_find_import_infos(xe_xex2_ref xex,
switch (type) { switch (type) {
case 0x00: { case 0x00: {
xe_xex2_import_info_t *info = &infos[i++]; xe_xex2_import_info_t* info = &infos[i++];
info->ordinal = value & 0xFFFF; info->ordinal = value & 0xFFFF;
info->value_address = record; info->value_address = record;
} break; } break;
case 0x01: { case 0x01: {
// Thunk for previous record. // Thunk for previous record.
assert_true(i > 0); assert_true(i > 0);
xe_xex2_import_info_t *info = &infos[i - 1]; xe_xex2_import_info_t* info = &infos[i - 1];
assert_true(info->ordinal == (value & 0xFFFF)); assert_true(info->ordinal == (value & 0xFFFF));
info->thunk_address = record; info->thunk_address = record;
} break; } break;
@ -995,9 +992,9 @@ int xe_xex2_find_import_infos(xe_xex2_ref xex,
} }
int xe_xex2_get_import_infos(xe_xex2_ref xex, int xe_xex2_get_import_infos(xe_xex2_ref xex,
const xe_xex2_import_library_t *library, const xe_xex2_import_library_t* library,
xe_xex2_import_info_t **out_import_infos, xe_xex2_import_info_t** out_import_infos,
size_t *out_import_info_count) { size_t* out_import_info_count) {
auto header = xe_xex2_get_header(xex); auto header = xe_xex2_get_header(xex);
// Find library index for verification. // Find library index for verification.
@ -1017,7 +1014,7 @@ int xe_xex2_get_import_infos(xe_xex2_ref xex,
return 0; return 0;
} }
uint32_t xe_xex2_lookup_export(xe_xex2_ref xex, const char *name) { uint32_t xe_xex2_lookup_export(xe_xex2_ref xex, const char* name) {
auto header = xe_xex2_get_header(xex); auto header = xe_xex2_get_header(xex);
// no exports :( // no exports :(
@ -1026,24 +1023,23 @@ uint32_t xe_xex2_lookup_export(xe_xex2_ref xex, const char *name) {
return 0; return 0;
} }
auto e = reinterpret_cast<const IMAGE_EXPORT_DIRECTORY *>( auto e = reinterpret_cast<const IMAGE_EXPORT_DIRECTORY*>(
xex->memory->TranslateVirtual(header->exe_address + xex->memory->TranslateVirtual(header->exe_address +
header->pe_export_table_offset)); header->pe_export_table_offset));
// e->AddressOfX RVAs are relative to the IMAGE_EXPORT_DIRECTORY! // e->AddressOfX RVAs are relative to the IMAGE_EXPORT_DIRECTORY!
uint32_t *function_table = (uint32_t *)((uint64_t)e + e->AddressOfFunctions); uint32_t* function_table = (uint32_t*)((uint64_t)e + e->AddressOfFunctions);
// Names relative to directory // Names relative to directory
uint32_t *name_table = (uint32_t *)((uint64_t)e + e->AddressOfNames); uint32_t* name_table = (uint32_t*)((uint64_t)e + e->AddressOfNames);
// Table of ordinals (by name) // Table of ordinals (by name)
uint16_t *ordinal_table = uint16_t* ordinal_table = (uint16_t*)((uint64_t)e + e->AddressOfNameOrdinals);
(uint16_t *)((uint64_t)e + e->AddressOfNameOrdinals);
const char *mod_name = (const char *)((uint64_t)e + e->Name); const char* mod_name = (const char*)((uint64_t)e + e->Name);
for (uint32_t i = 0; i < e->NumberOfNames; i++) { for (uint32_t i = 0; i < e->NumberOfNames; i++) {
const char *fn_name = (const char *)((uint64_t)e + name_table[i]); const char* fn_name = (const char*)((uint64_t)e + name_table[i]);
uint16_t ordinal = ordinal_table[i]; uint16_t ordinal = ordinal_table[i];
uint32_t addr = header->exe_address + function_table[ordinal]; uint32_t addr = header->exe_address + function_table[ordinal];
@ -1062,7 +1058,7 @@ uint32_t xe_xex2_lookup_export(xe_xex2_ref xex, uint16_t ordinal) {
// XEX-style export table. // XEX-style export table.
if (header->loader_info.export_table) { if (header->loader_info.export_table) {
auto export_table = reinterpret_cast<const xe_xex2_export_table *>( auto export_table = reinterpret_cast<const xe_xex2_export_table*>(
xex->memory->TranslateVirtual(header->loader_info.export_table)); xex->memory->TranslateVirtual(header->loader_info.export_table));
uint32_t ordinal_count = xe::byte_swap(export_table->count); uint32_t ordinal_count = xe::byte_swap(export_table->count);
uint32_t ordinal_base = xe::byte_swap(export_table->base); uint32_t ordinal_base = xe::byte_swap(export_table->base);
@ -1082,22 +1078,21 @@ uint32_t xe_xex2_lookup_export(xe_xex2_ref xex, uint16_t ordinal) {
return 0; return 0;
} }
auto e = reinterpret_cast<const IMAGE_EXPORT_DIRECTORY *>( auto e = reinterpret_cast<const IMAGE_EXPORT_DIRECTORY*>(
xex->memory->TranslateVirtual(header->exe_address + xex->memory->TranslateVirtual(header->exe_address +
header->pe_export_table_offset)); header->pe_export_table_offset));
// e->AddressOfX RVAs are relative to the IMAGE_EXPORT_DIRECTORY! // e->AddressOfX RVAs are relative to the IMAGE_EXPORT_DIRECTORY!
// Functions relative to base // Functions relative to base
uint32_t *function_table = (uint32_t *)((uint64_t)e + e->AddressOfFunctions); uint32_t* function_table = (uint32_t*)((uint64_t)e + e->AddressOfFunctions);
// Names relative to directory // Names relative to directory
uint32_t *name_table = (uint32_t *)((uint64_t)e + e->AddressOfNames); uint32_t* name_table = (uint32_t*)((uint64_t)e + e->AddressOfNames);
// Table of ordinals (by name) // Table of ordinals (by name)
uint16_t *ordinal_table = uint16_t* ordinal_table = (uint16_t*)((uint64_t)e + e->AddressOfNameOrdinals);
(uint16_t *)((uint64_t)e + e->AddressOfNameOrdinals);
const char *mod_name = (const char *)((uint64_t)e + e->Name); const char* mod_name = (const char*)((uint64_t)e + e->Name);
if (ordinal < e->NumberOfFunctions) { if (ordinal < e->NumberOfFunctions) {
return header->exe_address + function_table[ordinal]; return header->exe_address + function_table[ordinal];