Changeset 40eab9f in mainline for kernel/generic/src/debug/util.c
- Timestamp:
- 2023-11-03T18:47:41Z (15 months ago)
- Branches:
- master, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b1397ab
- Parents:
- dcd8214
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-11-03 18:46:22)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-11-03 18:47:41)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/debug/util.c
rdcd8214 r40eab9f 33 33 #include <debug/names.h> 34 34 35 /*36 * These declarations cause global definitions for the functions to be emitted37 * in this compilation unit, so if the compiler decides not to inline some of38 * them, only one external copy exists. See C99 inline rules.39 */40 extern inline uint8_t read_byte(const uint8_t **, const uint8_t *);41 extern inline uint16_t read_uint16(const uint8_t **, const uint8_t *);42 extern inline uint32_t read_uint24(const uint8_t **, const uint8_t *);43 extern inline uint32_t read_uint32(const uint8_t **, const uint8_t *);44 extern inline uint64_t read_uint64(const uint8_t **, const uint8_t *);45 extern inline uint64_t read_uint(const uint8_t **, const uint8_t *, unsigned);46 extern inline uint64_t read_uleb128(const uint8_t **, const uint8_t *);47 extern inline int64_t read_sleb128(const uint8_t **, const uint8_t *);48 extern inline void skip_leb128(const uint8_t **, const uint8_t *);49 extern inline uint64_t read_initial_length(const uint8_t **, const uint8_t *, unsigned *);50 extern inline const char *read_string(const uint8_t **, const uint8_t *);51 extern inline void skip_string(const uint8_t **, const uint8_t *);52 extern inline void safe_increment(const uint8_t **, const uint8_t *, ptrdiff_t);53 54 extern inline void skip_format(const uint8_t **, const uint8_t *, unsigned);55 extern inline void skip_formatted_entry(const uint8_t **, const uint8_t *,56 const uint8_t *, const uint8_t *, unsigned);57 extern inline void skip_formatted_list(const uint8_t **, const uint8_t *,58 unsigned, const uint8_t *, const uint8_t *, unsigned);59 60 35 bool skip_data(unsigned form, const uint8_t **const data, 61 36 const uint8_t *data_end, unsigned width) … … 159 134 } 160 135 161 void print_formatted_list( const char *name,136 void print_formatted_list(debug_sections_t *scs, const char *name, 162 137 const uint8_t *data, const uint8_t *const data_end, 163 138 const uint8_t *format, const uint8_t *format_end, … … 175 150 176 151 DEBUGF("%s:%s:", dw_lnct_name(lnct), dw_form_name(form)); 177 print_formed_data( form, &data, data_end, width);152 print_formed_data(scs, form, &data, data_end, width); 178 153 DEBUGF("\n"); 179 154 } … … 196 171 } 197 172 198 void print_formed_data( unsigned form, const uint8_t **const data,173 void print_formed_data(debug_sections_t *scs, unsigned form, const uint8_t **const data, 199 174 const uint8_t *data_end, unsigned width) 200 175 { … … 210 185 case DW_FORM_strp_sup: 211 186 offset = read_uint(data, data_end, width); 212 if (offset >= debug_str_size)187 if (offset >= scs->debug_str_size) 213 188 DEBUGF("<out of range>"); 214 189 else 215 DEBUGF("\"%s\"", debug_str + offset);190 DEBUGF("\"%s\"", scs->debug_str + offset); 216 191 break; 217 192 218 193 case DW_FORM_line_strp: 219 194 offset = read_uint(data, data_end, width); 220 if (offset >= debug_line_str_size)195 if (offset >= scs->debug_line_str_size) 221 196 DEBUGF("<out of range>"); 222 197 else 223 DEBUGF("\"%s\"", debug_line_str + offset);198 DEBUGF("\"%s\"", scs->debug_line_str + offset); 224 199 break; 225 200
Note:
See TracChangeset
for help on using the changeset viewer.