xtensa: support coredump by register set alignment#15141
Conversation
|
[Experimental Bot, please feedback here] Fill In The Commit Message: This PR contains a Commit with an Empty Commit Message. Please fill in the Commit Message with the PR Summary. This PR does not fully meet the NuttX requirements. Here's a breakdown: Missing/Insufficient Information:
Recommendations for Improvement:
By addressing these points, the PR will better meet the NuttX requirements and make it easier for reviewers to understand, evaluate, and merge your contribution. |
|
FYI ESP32-S3 will fail to build, I'm not sure why: |
|
HI @sdc-g , I didn't get exactly what this PR is trying to solve: Can you please better describe the issue you've found and how this PR solves it? Also, I didn't get how to test it. Did you use the ELF loader (because https://github.com/apache/nuttx/pull/15141/files#diff-3d73ca45b6136e2c1158bbb323370c90dc4b8209a851129ce6543516e10e5269 was changed)? And how did you dump the registers during runtime? (did you force an exception or use |
|
@sdc-g please fix the style problem, reported by: |
|
HI @tmedicci
Current xtensa core dump do not define elf_gregset_t, EM_ARCH, EF_FLAG. And the defination of elf_gregset_t refer to https://github.com/espressif/binutils-gdb/blob/esp-gdb-12.1/gdb/arch/xtensa.h
Yes, force crash as below |
49691ea to
67bfc60
Compare
|
@sdc-g please fix: |
67bfc60 to
24b3eb1
Compare
|
@sdc-g could you elaborate the steps after coredump? Do you extract the coredump in log (from "Start coredump:" to “Finish coredump”) save them to a text file, |
|
Hi @chirping78
Yes. But if CONFIG_BOARD_COREDUMP_COMPRESSION is disabled, please use below command to convert from HEX string to binary
|
|
@sdc-g your this function might have already been broken on latest master version. This is what I tested: First, test the version around 24/12/13, this is when your patch first merged, apps fa22f80, nuttx 9e8e7ac. use esp32-devkitc:nsh to test, enable then use 2nd, test the latest master, apps cf1d5bb, nuttx 87c217a. Still use esp32-devkitc:nsh to test, enable Then same steps as above to trigger, save, convert and launch gdb to check, Please check whether my steps are not correct, or the funtion is really broken. |
|
Hi @chirping78 Thanks for your information. |
Note: Please adhere to Contributing Guidelines.
Summary
refer to https://github.com/espressif/binutils-gdb/blob/esp-gdb-12.1/gdb/arch/xtensa.h
align the register set with gdb
Impact
While coredump config is enabled, g_tcbinfo size is larger hundreds of bytes
Testing
./tools/configure.sh esp32-devkitc:nsh
enable CONFIG_COREDUMP, CONFIG_BOARD_COREDUMP_SYSLOG
default enabled CONFIG_BOARD_COREDUMP_FULL, CONFIG_BOARD_COREDUMP_COMPRESSION
check register dumped from NSH:
up_dump_register: PC: 400f1188 PS: 00060f30
up_dump_register: A0: 800e33af A1: 3ffe0bd0 A2: 00000001 A3: 3ffe0470
up_dump_register: A4: 00000000 A5: 3ffafb48 A6: 00000000 A7: 3ffb0d30
up_dump_register: A8: 00000000 A9: 3ffe0bb0 A10: ffffffff A11: 3ffe0470
up_dump_register: A12: 3f402c02 A13: 3ffe0bd0 A14: 00000000 A15: 00000068
up_dump_register: SAR: 00000000 CAUSE: 0000001d VADDR: 00000000
up_dump_register: LBEG: 4000c2e0 LEND: 4000c2f6 LCNT: 00000000
And compare with gdb:
(gdb) info register
pc 0x400f1188 0x400f1188 <coredump_main+144>
lbeg 0x4000c2e0 1073791712
lend 0x4000c2f6 1073791734
lcount 0x0 0
sar 0x0 0
ps 0x60f30 397104
threadptr
br
scompare1
acclo
acchi
m0
m1
m2
m3
expstate
f64r_lo
f64r_hi
f64s
fcr
fsr
a0 0x800e33af -2146552913
a1 0x3ffe0bd0 1073613776
a2 0x1 1
a3 0x3ffe0470 1073611888
a4 0x0 0
a5 0x3ffafb48 1073412936
a6 0x0 0
a7 0x3ffb0d30 1073417520
a8 0x0 0
a9 0x3ffe0bb0 1073613744
a10 0xffffffff -1
a11 0x3ffe0470 1073611888
a12 0x3f402c02 1061170178
a13 0x3ffe0bd0 1073613776
a14 0x0 0
a15 0x68 104