source: mainline/kernel/generic/include/debug/names.h@ c89ae25

topic/msim-upgrade topic/simplify-dev-export
Last change on this file since c89ae25 was 2fbb42f, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 2 years ago

Add printing of file names and line numbers in stacktraces

Uses DWARF ¾/5 .debug_line section (originally intended
to only support DWARF 5, but GCC emits lower versioned sections
regardless of command line arguments on some platforms for some
reason, so generic support it is).

Also adds a whole lot of definitions for various DWARF constants
I expect to be useful in the future.

The quickest way to test this probably is to run test fault1
in kernel console.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 * Copyright (c) 2023 Jiří Zárevúcky
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
29#ifndef DWARFS_NAMES_H_
30#define DWARFS_NAMES_H_
31
32#define D_(infix) \
33 typedef unsigned dw_##infix##_t; \
34 extern const char *dw_##infix##_name(dw_##infix##_t)
35
36D_(ut);
37D_(tag);
38D_(at);
39D_(form);
40D_(op);
41D_(lle);
42D_(ate);
43D_(ds);
44D_(end);
45D_(access);
46D_(vis);
47D_(virtuality);
48D_(lang);
49D_(id);
50D_(cc);
51D_(lns);
52D_(lne);
53D_(lnct);
54
55#undef D_
56
57#endif /* DWARFS_NAMES_H_ */
Note: See TracBrowser for help on using the repository browser.