Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chrome] crashpad: riscv -> riscv32 #35

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ std::string MinidumpMiscInfoDebugBuildString() {
#elif defined(ARCH_CPU_MIPS64EL)
static constexpr char kCPU[] = "mips64";
#elif defined(ARCH_CPU_RISCV)
static constexpr char kCPU[] = "riscv";
static constexpr char kCPU[] = "riscv32";
#elif defined(ARCH_CPU_RISCV64)
static constexpr char kCPU[] = "riscv64";
#else
Expand Down
6 changes: 3 additions & 3 deletions third_party/crashpad/crashpad/snapshot/capture_memory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ void CaptureMemory::PointedToByContext(const CPUContext& context,
MaybeCaptureMemoryAround(delegate, context.mipsel->regs[i]);
}
#elif defined(ARCH_CPU_RISCV_FAMILY)
if (context.architecture == kCPUArchitectureRISCV) {
for (size_t i = 0; i < std::size(context.riscv->regs); ++i) {
MaybeCaptureMemoryAround(delegate, context.riscv->regs[i]);
if (context.architecture == kCPUArchitectureRISCV32) {
for (size_t i = 0; i < std::size(context.riscv32->regs); ++i) {
MaybeCaptureMemoryAround(delegate, context.riscv32->regs[i]);
}
} else {
for (size_t i = 0; i < std::size(context.riscv64->regs); ++i) {
Expand Down
2 changes: 1 addition & 1 deletion third_party/crashpad/crashpad/snapshot/cpu_architecture.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ enum CPUArchitecture {
kCPUArchitectureMIPS64EL,

//! \brief 32-bit RISCV.
kCPUArchitectureRISCV,
kCPUArchitectureRISCV32,

//! \brief 64-bit RISCV.
kCPUArchitectureRISCV64
Expand Down
2 changes: 1 addition & 1 deletion third_party/crashpad/crashpad/snapshot/cpu_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ bool CPUContext::Is64Bit() const {
case kCPUArchitectureX86:
case kCPUArchitectureARM:
case kCPUArchitectureMIPSEL:
case kCPUArchitectureRISCV:
case kCPUArchitectureRISCV32:
return false;
default:
NOTREACHED();
Expand Down
4 changes: 2 additions & 2 deletions third_party/crashpad/crashpad/snapshot/cpu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ struct CPUContextMIPS64 {
};

//! \brief A context structure carrying RISC CPU state.
struct CPUContextRISCV {
struct CPUContextRISCV32 {
uint32_t regs[32];
uint64_t fpregs[32];
uint32_t fcsr;
Expand Down Expand Up @@ -416,7 +416,7 @@ struct CPUContext {
CPUContextARM64* arm64;
CPUContextMIPS* mipsel;
CPUContextMIPS64* mips64;
CPUContextRISCV* riscv;
CPUContextRISCV32* riscv32;
CPUContextRISCV64* riscv64;
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,11 @@ template <>
bool ExceptionSnapshotLinux::ReadContext<ContextTraits32>(
ProcessReaderLinux* reader,
LinuxVMAddress context_address) {
context_.architecture = kCPUArchitectureRISCV;
context_.riscv = &context_union_.riscv;
context_.architecture = kCPUArchitectureRISCV32;
context_.riscv32 = &context_union_.riscv32;

return internal::ReadContext<ContextTraits32>(
reader, context_address, context_.riscv);
reader, context_address, context_.riscv32);
}

template <>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class ExceptionSnapshotLinux final : public ExceptionSnapshot {
CPUContextMIPS mipsel;
CPUContextMIPS64 mips64;
#elif defined(ARCH_CPU_RISCV_FAMILY)
CPUContextRISCV riscv;
CPUContextRISCV32 riscv32;
CPUContextRISCV64 riscv64;
#endif
} context_union_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ struct ContextTraits32 : public Traits32 {
using MContext = MContext32;
using SignalThreadContext = ThreadContext::t32_t;
using SignalFloatContext = FloatContext::f32_t;
using CPUContext = CPUContextRISCV;
using CPUContext = CPUContextRISCV32;
};

struct ContextTraits64 : public Traits64 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ CPUArchitecture SystemSnapshotLinux::GetCPUArchitecture() const {
: kCPUArchitectureMIPSEL;
#elif defined(ARCH_CPU_RISCV_FAMILY)
return process_reader_->Is64Bit() ? kCPUArchitectureRISCV64
: kCPUArchitectureRISCV;
: kCPUArchitectureRISCV32;
#else
#error port to your architecture
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ bool ThreadSnapshotLinux::Initialize(
thread.thread_info.float_context.f64,
context_.riscv64);
} else {
context_.architecture = kCPUArchitectureRISCV;
context_.riscv = &context_union_.riscv;
context_.architecture = kCPUArchitectureRISCV32;
context_.riscv32 = &context_union_.riscv32;
InitializeCPUContextRISCV<ContextTraits32>(
thread.thread_info.thread_context.t32,
thread.thread_info.float_context.f32,
context_.riscv);
context_.riscv32);
}
#else
#error Port.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ThreadSnapshotLinux final : public ThreadSnapshot {
CPUContextMIPS mipsel;
CPUContextMIPS64 mips64;
#elif defined(ARCH_CPU_RISCV_FAMILY)
CPUContextRISCV riscv;
CPUContextRISCV32 riscv32;
CPUContextRISCV64 riscv64;
#else
#error Port.
Expand Down