source: mainline/kernel/generic/src/debug/names.c@ fdfb24e

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

ccheck

  • Property mode set to 100644
File size: 3.5 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#include <stddef.h>
30#include <stdint.h>
31#include <debug/constants.h>
32#include <debug/names.h>
33
34#define CVAL(name, value) [value] = #name,
35
36static const char *const dw_ut_names[] = {
37#include <debug/constants/dw_ut.inc>
38};
39
40static const char *const dw_tag_names[] = {
41#include <debug/constants/dw_tag.inc>
42};
43
44static const char *const dw_at_names[] = {
45#include <debug/constants/dw_at.inc>
46};
47
48static const char *const dw_form_names[] = {
49#include <debug/constants/dw_form.inc>
50};
51
52static const char *const dw_op_names[] = {
53#include <debug/constants/dw_op.inc>
54};
55
56static const char *const dw_lle_names[] = {
57#include <debug/constants/dw_lle.inc>
58};
59
60static const char *const dw_ate_names[] = {
61#include <debug/constants/dw_ate.inc>
62};
63
64static const char *const dw_ds_names[] = {
65#include <debug/constants/dw_ds.inc>
66};
67
68static const char *const dw_end_names[] = {
69#include <debug/constants/dw_end.inc>
70};
71
72static const char *const dw_access_names[] = {
73#include <debug/constants/dw_access.inc>
74};
75
76static const char *const dw_vis_names[] = {
77#include <debug/constants/dw_vis.inc>
78};
79
80static const char *const dw_virtuality_names[] = {
81#include <debug/constants/dw_virtuality.inc>
82};
83
84static const char *const dw_lang_names[] = {
85#include <debug/constants/dw_lang.inc>
86};
87
88static const char *const dw_id_names[] = {
89#include <debug/constants/dw_id.inc>
90};
91
92static const char *const dw_cc_names[] = {
93#include <debug/constants/dw_cc.inc>
94};
95
96static const char *const dw_lns_names[] = {
97#include <debug/constants/dw_lns.inc>
98};
99
100static const char *const dw_lne_names[] = {
101#include <debug/constants/dw_lne.inc>
102};
103
104static const char *const dw_lnct_names[] = {
105#include <debug/constants/dw_lnct.inc>
106};
107
108#undef CVAL
109
110#define D_(infix) \
111 const char *dw_##infix##_name(dw_##infix##_t val) { \
112 if (val >= sizeof(dw_##infix##_names) / sizeof(const char *)) \
113 return NULL; \
114 return dw_##infix##_names[val]; \
115 }
116
117D_(ut);
118D_(tag);
119D_(at);
120D_(form);
121D_(op);
122D_(lle);
123D_(ate);
124D_(ds);
125D_(end);
126D_(access);
127D_(vis);
128D_(virtuality);
129D_(lang);
130D_(id);
131D_(cc);
132D_(lns);
133D_(lne);
134D_(lnct);
135
136#undef D_
Note: See TracBrowser for help on using the repository browser.