source: mainline/kernel/generic/include/debug/sections.h

Last change on this file was 40eab9f, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 20 months ago

Print symbol names and line numbers in stacktraces for init tasks

Only useful in select few situations, but useful nonetheless.

  • Property mode set to 100644
File size: 2.3 KB
RevLine 
[1e01a35]1/*
[da13982]2 * Copyright (c) 2023 Jiří Zárevúcky
[1e01a35]3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
[da13982]29#ifndef DEBUG_SECTIONS_H_
30#define DEBUG_SECTIONS_H_
[1e01a35]31
[da13982]32#include <abi/elf.h>
33#include <stddef.h>
[1e01a35]34
[40eab9f]35typedef struct {
36 const void *debug_aranges;
37 size_t debug_aranges_size;
[1e01a35]38
[40eab9f]39 const void *debug_info;
40 size_t debug_info_size;
[1e01a35]41
[40eab9f]42 const void *debug_abbrev;
43 size_t debug_abbrev_size;
[1e01a35]44
[40eab9f]45 const void *debug_line;
46 size_t debug_line_size;
[1e01a35]47
[40eab9f]48 const char *debug_str;
49 size_t debug_str_size;
[1e01a35]50
[40eab9f]51 const char *debug_line_str;
52 size_t debug_line_str_size;
[1e01a35]53
[40eab9f]54 const void *debug_rnglists;
55 size_t debug_rnglists_size;
[1e01a35]56
[40eab9f]57 const void *eh_frame_hdr;
58 size_t eh_frame_hdr_size;
[1e01a35]59
[40eab9f]60 const void *eh_frame;
61 size_t eh_frame_size;
[da13982]62
[40eab9f]63 const elf_symbol_t *symtab;
64 size_t symtab_size;
[da13982]65
[40eab9f]66 const char *strtab;
67 size_t strtab_size;
68} debug_sections_t;
69
70extern debug_sections_t kernel_sections;
71
72debug_sections_t get_debug_sections(const void *elf, size_t elf_size);
[da13982]73
74#endif /* DEBUG_SECTIONS_H_ */
Note: See TracBrowser for help on using the repository browser.