PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros
Core dump records

Register records stored in a core dump. More...

Data Structures

struct  CoreDumpThreadInfo
 Payload of a thread chunk. More...
 
struct  CoreDumpExtraRegInfo
 Payload of the extra registers chunk: special registers at dump time. More...
 
struct  CoreDumpSavedRegisters
 Processor state captured on entry to the core dump handler. More...
 

Macros

#define CORE_DUMP_NUM_REGISTERS   17
 Number of core registers in a record: r0-r12, sp, lr, pc and xpsr.
 
#define CORE_DUMP_THREAD_NAME_SIZE   16
 Size of CoreDumpThreadInfo::name in bytes, including the NUL terminator.
 

Detailed Description

Register records stored in a core dump.

A core dump is a stream of chunks, each a 32-bit key and a 32-bit payload size followed by the payload. These are the payloads of the thread and extra register chunks, shared with the Bluetooth controller's core dump code and parsed by tools/readcore.py. All fields are little-endian. Registers are stored in the order r0-r12, sp, lr, pc, xpsr, the same order as pbl_thread_reg.


Data Structure Documentation

◆ CoreDumpThreadInfo

struct CoreDumpThreadInfo

Payload of a thread chunk.

One per thread, plus an "ISR" pseudo-thread when the dump was triggered from an exception handler.

Data Fields
uint32_t id Thread identifier: the thread object's address, 1 for the "ISR" pseudo-thread.
int8_t name[CORE_DUMP_THREAD_NAME_SIZE] Thread name, NUL-terminated.
uint32_t registers[CORE_DUMP_NUM_REGISTERS] Registers r0-r12, sp, lr, pc, xpsr.

For the running thread interrupted by an exception, only the hardware-stacked registers and sp are valid; the others read 0xa5a5a5a5.

uint8_t running 1 if this thread was running when the dump was taken, else 0.

◆ CoreDumpExtraRegInfo

struct CoreDumpExtraRegInfo

Payload of the extra registers chunk: special registers at dump time.

Data Fields
uint8_t basepri BASEPRI register.
uint8_t control CONTROL register.
uint8_t faultmask FAULTMASK register.
uint32_t msp Main stack pointer.
uint8_t primask PRIMASK register.
uint32_t psp Process stack pointer.

◆ CoreDumpSavedRegisters

struct CoreDumpSavedRegisters

Processor state captured on entry to the core dump handler.

Saved by the NMI handler that performs the core dump, into a static variable, before any C code runs; the handler's assembly depends on the order and packing of this structure. Not written to the dump as such, but reachable in RAM through the s_saved_registers symbol.

Data Fields
uint32_t core_reg[CORE_DUMP_NUM_REGISTERS] Registers r0-r12, sp, lr, pc, xpsr.

sp is the MSP and lr the EXC_RETURN value at handler entry; pc is the handler's own address.

CoreDumpExtraRegInfo extra_reg Special registers.

Macro Definition Documentation

◆ CORE_DUMP_NUM_REGISTERS

#define CORE_DUMP_NUM_REGISTERS   17

Number of core registers in a record: r0-r12, sp, lr, pc and xpsr.

◆ CORE_DUMP_THREAD_NAME_SIZE

#define CORE_DUMP_THREAD_NAME_SIZE   16

Size of CoreDumpThreadInfo::name in bytes, including the NUL terminator.