1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __SYMBIANELFDEFS_H__
17 #define __SYMBIANELFDEFS_H__
26 Symbian Core Dump specific ELF definitions.
28 The definitions in this file implement the interface described in document
29 SGL_TS0028_027_symbian_core_dump_file_format.doc.
31 @see CSymbianElfFormatter
34 /** Definition of 64 bit memory */
35 typedef unsigned long long Elf64_Word;
37 /** Definition of 8 bit memory */
38 typedef unsigned char Elf32_Byte;
43 Value of the d_type field of the standard descriptor header.
47 /** Value to identify Sym32_syminfod */
48 ESYM_NOTE_SYM = 0x00000000,
50 /** Value to identify Sym32_thrdinfod */
51 ESYM_NOTE_THRD = 0x00000010,
53 /** Value to identify Sym32_procinfod */
54 ESYM_NOTE_PROC = 0x00000020,
56 /** Value to identify Sym32_execinfod */
57 ESYM_NOTE_EXEC = 0x00000040,
59 /** Value to identify Sym32_reginfod */
60 ESYM_NOTE_REG = 0x00000080,
62 /** Value to identify string information */
63 ESYM_NOTE_STR = 0x00000100
69 To uniquely identify executables associated with the crashed process an executable
70 identifier is required, this identifier is defined as follows
74 /** ID of the executable to match symbolic debug information to executable binary
75 [Currently crash time iTimeLo (LSW) and iTimeHi (MSW)] */
78 /** CCITT CRC-32 Checksum of up to the first 1Kbytes of code segment. */
81 /** @internalTechnology */
82 Elf32_Word exec_spare;
85 /** Size of Sym32_execid in bytes. @see Sym32_execid */
86 #define SYM32_EXECID_SIZE 16
89 The Symbian Info segment contains generic crash information.
90 It is defined as a program segment with type PT_NOTE which
91 references the segment descriptor Sym32_dhdr.
92 The d_name field of the standard descriptor header is "CORE.SYMBIAN".
93 The d_type field of the standard descriptor header is ESYM_NOTE_SYM.
97 /** Date and time of the crash */
98 Elf64_Word sd_date_time;
100 /** The ID of the crashed process as defined by Sym32_execid */
101 Sym32_execid sd_execid;
103 /** The id of the thread causing the crash */
104 Elf64_Word sd_thread_id;
106 /** The crashing threads owning process */
107 Elf64_Word sd_proc_id;
109 /** Identifies whether the crash was caused by a Hardware Exception (set to 0)
110 or Thread Kill (set to 1) */
111 Elf32_Word sd_exit_type;
113 /** If sd_exit_type is Hardware Exception then set to e32const.h::TExcType
114 if is Thread Kill then set to e32const.h::TExitType */
115 Elf32_Word sd_exit_reason;
117 /** Only set if sd_exit_type is Thread Kill. Index into the CORE.SYMBIAN.STR
118 note segment identifying the reason for the crash or ESYM_STR_UNDEF */
119 Elf32_Word sd_exit_cat;
121 /** @internalTechnology */
125 /** Size of Sym32_syminfod in bytes. @see Sym32_syminfod */
126 #define SYM32_SYMINFO_SIZE 56
129 The descriptor contents immediately follow the header.
130 To obtain the nth segment: nth segment offset =
131 (Elf32_Phdr) element -> p_offset + sizeof(Sym32_dhdr) + n * d_descrsz
134 /** Index into the CORE.SYMBIAN.STR note segment defining the name of
135 the descriptor or ESYM_STR_UNDEF */
138 /** Size of a single descriptor element */
139 Elf32_Word d_descrsz;
141 /** Type of the descriptor defined */
144 /** Index into the CORE.SYMBIAN.STR note segment defining the version
145 of the following segment descriptor */
146 Elf32_Word d_version;
148 /** Number of descriptor elements */
149 Elf32_Word d_elemnum;
152 /** Size of Sym32_dhdr in bytes. @see Sym32_dhdr */
153 #define SYM32_DESCHDR_SIZE 20
156 The Thread Info segment contains thread related information for one or more
157 threads of the owning process.
158 It is defined as a program segment with type PT_NOTE referencing the segment
159 descriptor defined below.
160 The d_name field of the standard descriptor header is "CORE.SYMBIAN.THREAD".
161 The d_type field of the standard descriptor header is ESYM_NOTE_THRD.
164 /** Id of the thread */
167 /** Id of the owning process */
168 Elf64_Word td_owning_process;
170 /** Index into the CORE.SYMBIAN.STR note segment defining the name of the
171 thread or ESYM_STR_UNDEF */
174 /** Priority of thread */
175 Elf32_Word td_priority;
176 /** Supervisor stack pointer */
177 Elf32_Word td_svc_sp;
179 /** Address of the supervisor stack */
180 Elf32_Word td_svc_stack;
182 /** Size of the supervisor stack */
183 Elf32_Word td_svc_stacksz;
185 /** Address of the user stack */
186 Elf32_Word td_usr_stack;
188 /** Size of the user stack */
189 Elf32_Word td_usr_stacksz;
191 /** @internalTechnology */
195 /** Size of Sym32_thrdinfod in bytes. @see Sym32_thrdinfod */
196 #define SYM32_THRINFO_SIZE 48
199 The Process Info segment contains process related information for the
200 crashed threads owning process. It is defined as a program segment with
201 type PT_NOTE referencing the segment descriptor defined below.
202 The d_name field of the standard descriptor header is "CORE.SYMBIAN.PROCESS".
203 The d_type field of the standard descriptor header is ESYM_NOTE_PROC.
206 /** ID of the process */
209 /** Index into the CORE.SYMBIAN.STR note segment defining the
210 name of the Process or ESYM_STR_UNDEF */
213 /** Priority of the process */
214 Elf32_Word pd_priority;
218 /** Size of Sym32_procinfod in bytes. @see Sym32_procinfod */
219 #define SYM32_PROCINFO_SIZE 16
223 The Executable Info segment contains information defining the location of the given executables image segments in the processes address space; this includes statically and dynamically linked executables also. It is defined as a program segment with type PT_NOTE referencing the segment descriptor defined below.
224 The d_name field of the standard descriptor header is "CORE.SYMBIAN.EXECUTABLE".
225 The d_type field of the standard descriptor header is ESYM_NOTE_EXEC.
228 /** The ID of the executable as defined by Sym32_execid */
229 Sym32_execid ed_execid;
231 /** Index into the CORE.SYMBIAN.STR note segment defining the name of
232 the executable or ESYM_STR_UNDEF */
235 /** Execute in place TRUE (1) for XIP ROM code FALSE (0) otherwise */
238 /** Size of the executables code segment */
239 Elf32_Word ed_codesize;
241 /** Execution address of the code segment */
242 Elf32_Word ed_coderunaddr;
244 /** Build address of the code section (Non XIP only) */
245 Elf32_Word ed_codeloadaddr;
247 /** Size of the executable rodata segment */
248 Elf32_Word ed_rodatasize;
250 /** Execution address of the rodata segment */
251 Elf32_Word ed_rodatarunaddr;
253 /** Build address of the rodata section (Non XIP only) */
254 Elf32_Word ed_rodataloadaddr;
256 /** Size of the executable data segment */
257 Elf32_Word ed_datasize;
259 /** Execution address of the data segment */
260 Elf32_Word ed_datarunaddr;
262 /** Build address of the data section (Non XIP only) */
263 Elf32_Word ed_dataloadaddr;
265 /** @internalTechnology */
269 /** Size of Sym32_execinfod in bytes. @see Sym32_execinfod */
270 #define SYM32_EXECINFO_SIZE 64
274 The register descriptor member Sym32_reginfod::rid_class is defined by this enumeration.
279 /** Core processor register */
281 /** Coprocessor register */
286 The register descriptor member Sym32_reginfod::rid_repre is defined by this enumeration.
291 /** 8 Bit register contents */
293 /** 16 Bit register contents */
295 /** 32 Bit register contents */
297 /** 64 Bit register contents */
303 The Register Info segment contains a register context for a given thread. The core dump file may include zero or more register contexts for one or more threads within the owning process. It is defined as a program segment with type PT_NOTE referencing the segment descriptor defined below.
304 The d_name field of the standard descriptor header is "CORE.SYMBIAN.REGISTER.<THREADID>".
305 The d_type field of the standard descriptor header is ESYM_NOTE_REG.
308 /** Thread which context relates to */
309 Elf64_Word rid_thread_id;
311 /** Index into the CORE.SYMBIAN.STR note segment defining the version of
312 the Register Data Info descriptor */
313 Elf32_Word rid_version;
315 /** Number of registers this descriptor defines */
316 Elf32_Half rid_num_registers;
318 /** Register class defined by ESYM_REGCLASS */
319 Elf32_Byte rid_class;
321 /** Register representation defined by ESYM_REGREP */
322 Elf32_Byte rid_repre;
326 /** Size of Sym32_reginfod in bytes. @see Sym32_reginfod */
327 #define SYM32_REGINFO_SIZE 16
331 Immediately following the Register Info descriptor header is the information describing
332 the individual registers. See document for register identifiers.
333 The register identification scheme is the same as that used by the run mode debug interface.
339 /** Sub register ID */
340 Elf32_Half rd_sub_id;
342 /** Offset in bytes from the beginning of the file to the register data */
346 /** Size of Sym32_regdatad in bytes. @see Sym32_regdatad */
347 #define SYM32_REGDATA_SIZE 8
350 /** Program header member p_flags indicating that the segment may be executed. */
353 /** Program header member p_flags indicating that the segment may be written to. */
356 /** Program header member p_flags indicating that the segment may be read from. */
361 Index to the NULL string, ie string is not defined.
363 #define ESYM_STR_UNDEF 0