error: unknown type name 'greg_t'
- Dominant language
- C++
- Stars
- 17.6k
- Forks
- 4.1k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 69
Description
**Describe the bug (描述bug)**
```
/usr/ports/devel/brpc/work/incubator-brpc-1.3.0/src/butil/debug/stack_trace_posix.cc:291:5: error: unknown type name 'greg_t'
greg_t value;
^
/usr/ports/devel/brpc/work/incubator-brpc-1.3.0/src/butil/debug/stack_trace_posix.cc:314:38: error: no member named 'gregs' in '__mcontext'
{ " r8: ", context->uc_mcontext.gregs[REG_R8] },
~~~~~~~~~~~~~~~~~~~~ ^
/usr/ports/devel/brpc/work/incubator-brpc-1.3.0/src/butil/debug/stack_trace_posix.cc:314:44: error: use of undeclared identifier 'REG_R8'
{ " r8: ", context->uc_mcontext.gregs[REG_R8] },
^
/usr/ports/devel/brpc/work/incubator-brpc-1.3.0/src/butil/debug/stack_trace_posix.cc:315:38: error: no member named 'gregs' in '__mcontext'
{ " r9: ", context->uc_mcontext.gregs[REG_R9] },
~~~~~~~~~~~~~~~~~~~~ ^
/usr/ports/devel/brpc/work/incubator-brpc-1.3.0/src/butil/debug/stack_trace_posix.cc:315:44: error: use of undeclared identifier 'REG_R9'
{ " r9: ", context->uc_mcontext.gregs[REG_R9] },
^
/usr/ports/devel/brpc/work/incubator-brpc-1.3.0/src/butil/debug/stack_trace_posix.cc:316:38: error: no member named 'gregs' in '__mcontext'
{ " r10: ", context->uc_mcontext.gregs[REG_R10] },
~~~~~~~~~~~~~~~~~~~~ ^
/usr/ports/devel/brpc/work/incubator-brpc-1.3.0/src/butil/debug/stack_trace_posix.cc:316:44: error: use of undeclared identifier 'REG_R10'
{ " r10: ", context->uc_mcontext.gregs[REG_R10] },
^
/usr/ports/devel/brpc/work/incubator-brpc-1.3.0/src/butil/debug/stack_trace_posix.cc:317:38: error: no member named 'gregs' in '__mcontext'
{ " r11: ", context->uc_mcontext.gregs[REG_R11] },
~~~~~~~~~~~~~~~~~~~~ ^
```
The project doesn't define greg_t anywhere.
clang-14
FreeBSD 13.1
Contributor guide
Research direction
Start in src/butil/debug/stack_trace_posix.cc around lines 291 and 314, then inspect the platform context definitions used by FreeBSD 13.1 and clang-14. Reproduce the build to confirm the greg_t, gregs, and REG_R8–REG_R11 errors; done means this file compiles successfully on the reported platform without those errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100