Stackdb
Stackdb is a stackable, multi-target and -level source debugger and memory forensics library.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
dwarf_elfutils.c
Go to the documentation of this file.
1 /* Print information from ELF file in human-readable form.
2  Copyright (C) 1999-2015 Red Hat, Inc.
3  Copyright (c) 2011, 2012, 2013 The University of Utah
4 
5  ELF utility functions, adapted from Red Hat elfutils.
6 
7  This file is based on Red Hat elfutils' `src/readelf.c' file, which was
8  Written by Ulrich Drepper <drepper@redhat.com>, 1999.
9 
10  Red Hat elfutils is free software; you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by the
12  Free Software Foundation; version 2 of the License.
13 
14  Red Hat elfutils is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License along
20  with Red Hat elfutils; if not, write to the Free Software Foundation,
21  Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
22 
23  Red Hat elfutils is an included package of the Open Invention Network.
24  An included package of the Open Invention Network is a package for which
25  Open Invention Network licensees cross-license their patents. No patent
26  license is granted, either expressly or impliedly, by designation as an
27  included package. Should you wish to participate in the Open Invention
28  Network licensing program, please visit www.openinventionnetwork.com
29  <http://www.openinventionnetwork.com>. */
30 
31 #include <stdlib.h>
32 #include <stdbool.h>
33 #include <string.h>
34 #include <inttypes.h>
35 #include <assert.h>
36 
37 #include "common.h"
38 #include "dwdebug_priv.h"
39 #include "dwdebug.h"
40 #include "clfit.h"
41 #include "alist.h"
42 
43 #include "memory-access.h"
44 
45 #include <dwarf.h>
46 #include <gelf.h>
47 #include <elfutils/libebl.h>
48 #include <elfutils/libdw.h>
49 #include <elfutils/libdwfl.h>
50 
51 
58 /*
59  * This is taken from elfutils/src/readelf.c:print_debug_line_section(),
60  * tweaked into "better" C, and hooked so that we can "detect" end of prologues.
61  */
62 int dwarf_get_lines(struct symbol_root_dwarf *srd,Dwarf_Off offset) {
63  struct debugfile *debugfile = srd->debugfile;
64  struct symbol *root = srd->root;
65  struct scope *root_scope;
66  size_t address_size = srd->addrsize;
67  unsigned char *linestartp =
68  (unsigned char *)&debugfile->linetab[offset];
69  unsigned char *lineendp =
70  (unsigned char *)debugfile->linetab + debugfile->linetablen;
71  unsigned char *linep = linestartp;
72  const unsigned char *clinep;
73  unsigned char *endp;
74  /* XXX: we can't get other_byte_order from dbg since we don't have
75  * the struct def for it... so we assume it's not a diff byte order
76  * than the phys host for now.
77  */
78  int obo = 0;
79  size_t start_offset;
80  Dwarf_Word unit_length;
81  unsigned int length;
82  uint_fast16_t version;
83  Dwarf_Word header_length;
84  uint_fast8_t minimum_instr_len;
85  uint_fast8_t max_ops_per_instr;
86  uint_fast8_t default_is_stmt;
87  int_fast8_t line_base;
88  uint_fast8_t line_range;
89  uint_fast8_t opcode_base;
90  uint8_t *standard_opcode_lengths;
91  unsigned int u128;
92  int s128;
93  Dwarf_Word address;
94  unsigned int op_index;
95  size_t line;
96  uint_fast8_t is_stmt;
97  unsigned int opcode;
98  int line_increment;
99  int i;
100  struct symbol *symbol = NULL;
101  struct symbol *candidate_symbol = NULL;
102  bool prologue_end = false;
103  bool epilogue_begin = false;
104  struct array_list *dirlist = NULL;
105  struct array_list *filelist = NULL;
106  char *buf;
107  char *currentfile = NULL;
108  clmatch_t currentclf = NULL;
109  clmatchone_t currentclfrev = NULL;
110  char *dirp;
111  unsigned char *startp;
112  int filenamelen;
113  int retval;
114  char *compdirname;
115 
116  root_scope = symbol_read_owned_scope(root);
117  if (!root_scope) {
118  errno = EINVAL;
119  return -1;
120  }
121 
122  compdirname = SYMBOLX_ROOT(root)->compdirname;
123 
124  /* We only recognize addresses for symbols in this table, so don't
125  * process if there are no addresses! (unlikey)
126  */
127  if (g_hash_table_size(debugfile->addresses) == 0)
128  return 0;
129 
130  vdebug(25,LA_DEBUG,LF_DLOC,"processing lines at offset 0x%lx!\n",offset);
131 
132  while (linep < lineendp) {
133  start_offset = linep - linestartp;
134  unit_length = read_4ubyte_unaligned_inc(obo,linep);
135  length = 4;
136 
137  dirlist = array_list_create(16);
138  filelist = array_list_create(16);
139 
140  if (unlikely (unit_length == 0xffffffff)) {
141  if (unlikely (linep + 8 > lineendp))
142  goto invalid_data_out;
143 
144  unit_length = read_8ubyte_unaligned_inc(obo,linep);
145  length = 8;
146  }
147 
148  /* Check whether we have enough room in the section. */
149  if (unit_length < 2 + length + 5 * 1
150  || unlikely (linep + unit_length > lineendp))
151  goto invalid_data_out;
152 
153  lineendp = linep + unit_length;
154 
155  /* The next element of the header is the version identifier. */
156  version = read_2ubyte_unaligned_inc(obo,linep);
157 
158  /* Next comes the header length. */
159  if (length == 4)
160  header_length = read_4ubyte_unaligned_inc(obo,linep);
161  else
162  header_length = read_8ubyte_unaligned_inc(obo,linep);
163 
164  /* Next the minimum instruction length. */
165  minimum_instr_len = *linep++;
166 
167  /* Next the maximum operations per instruction, in version 4 format. */
168  max_ops_per_instr = version < 4 ? 1 : *linep++;
169 
170  /* Then the flag determining the default value of the is_stmt
171  register. */
172  default_is_stmt = *linep++;
173 
174  /* Now the line base. */
175  line_base = *((int_fast8_t *)linep);
176  ++linep;
177 
178  /* And the line range. */
179  line_range = *(linep++);
180 
181  /* The opcode base. */
182  opcode_base = *(linep++);
183 
184  if (unlikely (linep + opcode_base - 1 >= lineendp))
185  goto invalid_unit_out;
186 
187  standard_opcode_lengths = linep - 1;
188 
189  linep += opcode_base - 1;
190  if (unlikely(linep >= lineendp))
191  goto invalid_unit_out;
192 
193  while (*linep != 0) {
194  endp = memchr(linep,'\0',lineendp - linep);
195  if (unlikely(endp == NULL))
196  goto invalid_unit_out;
197 
198  array_list_append(dirlist,linep);
199 
200  linep = endp + 1;
201  }
202  /* Skip the final NUL byte. */
203  ++linep;
204 
205  if (unlikely(linep >= lineendp))
206  goto invalid_unit_out;
207 
208  while (*linep != 0) {
209  /* First comes the file name. */
210  endp = memchr(linep,'\0',lineendp - linep);
211  if (unlikely(endp == NULL))
212  goto invalid_unit_out;
213  startp = linep;
214  linep = endp + 1;
215 
216  /* Then the index. */
217  clinep = (const unsigned char *)linep;
218  get_uleb128(u128,clinep);
219 
220  /* Construct a full filename. */
221  if (u128 == 0) {
222  if (compdirname)
223  dirp = compdirname;
224  else
225  dirp = (char *)array_list_item(dirlist,0);
226  }
227  else
228  dirp = (char *)array_list_item(dirlist,u128 - 1);
229  filenamelen = strlen(dirp)+1+(endp - startp)+1;
230  buf = malloc(filenamelen);
231  snprintf(buf,filenamelen,"%s/%s",dirp,(char *)startp);
232  array_list_add(filelist,buf);
233 
234  /* Next comes the modification time. */
235  get_uleb128(u128,clinep);
236 
237  /* Finally the length of the file. */
238  get_uleb128(u128,clinep);
239 
240  linep = (unsigned char *)clinep;
241  }
242  /* Skip the final NUL byte. */
243  ++linep;
244 
245  address = 0;
246  op_index = 0;
247  line = 1;
248  is_stmt = default_is_stmt;
249  prologue_end = false;
250  epilogue_begin = false;
251 
252  currentfile = (char *)array_list_item(filelist,0);
253  currentclf = NULL;
254  currentclfrev = NULL;
255 
256  inline void advance_pc(unsigned int op_advance) {
257  address += op_advance;
258  op_index = (op_index + op_advance) % max_ops_per_instr;
259  }
260 
261  inline void storeline() {
262  gpointer orig_key = NULL;
263  /* Add the line to our lookup structure. */
264 
265  g_hash_table_lookup_extended(debugfile->srclines,
266  currentfile,&orig_key,&currentclf);
267 
268  /* This may change the currentclf pointer, so we have to
269  * remove it from the hashtable and reinsert it. A Judy
270  * array's main pointer can change when you add/remove
271  * things from it.
272  *
273  * So, since we specified automatic key/value destroy
274  * functions for this hashtable, we have to "steal" the
275  * currently stored key/value pair (which removes them
276  * without destroying them), and re-insert them, so that the
277  * new value of currentclf is inserted.
278  */
279  clmatch_add(&currentclf,line,(void *)(ADDR)address);
280 
281  vdebug(25,LA_DEBUG,LF_DLOC,"storeline %d 0x%"PRIxADDR"\n",
282  line,(ADDR)address);
283 
284  if (orig_key) {
285  /* If it had been in the hash, we have to get the
286  * orig key and use its exact value again so we
287  * don't leak the non-strdup'd pointer.
288  */
289  g_hash_table_steal(debugfile->srclines,currentfile);
290  g_hash_table_insert(debugfile->srclines,orig_key,
291  currentclf);
292  }
293  else
294  g_hash_table_insert(debugfile->srclines,strdup(currentfile),
295  currentclf);
296 
297  /*
298  * Also add it to the reverse clrange -- maps addresses to
299  * lines.
300  */
301  orig_key = NULL;
302  g_hash_table_lookup_extended(debugfile->srcaddrlines,
303  currentfile,&orig_key,&currentclfrev);
304  clmatchone_add(&currentclfrev,
305  (ADDR)address,(void *)(uintptr_t)line);
306  if (orig_key) {
307  /* If it had been in the hash, we have to get the
308  * orig key and use its exact value again so we
309  * don't leak the non-strdup'd pointer.
310  */
311  g_hash_table_steal(debugfile->srcaddrlines,currentfile);
312  g_hash_table_insert(debugfile->srcaddrlines,orig_key,
313  currentclfrev);
314  }
315  else
316  g_hash_table_insert(debugfile->srcaddrlines,strdup(currentfile),
317  currentclfrev);
318  }
319 
320  while (linep < lineendp) {
321  /* Read the opcode. */
322  opcode = *(unsigned char *)linep++;
323 
324  /* Is this a special opcode? */
325  if (likely(opcode >= opcode_base)) {
326  /* Yes. Handling this is quite easy since the opcode value
327  is computed with
328 
329  opcode = (desired line increment - line_base)
330  + (line_range * address advance) + opcode_base
331  */
332  line_increment = (line_base
333  + (opcode - opcode_base) % line_range);
334 
335  /* Perform the increments. */
336  line += line_increment;
337  advance_pc((opcode - opcode_base) / line_range);
338 
339  storeline();
340 
341  /*
342  * If the epilogue_begin register is set, try to do it.
343  */
344  if (epilogue_begin && candidate_symbol
345  && SYMBOL_IS_FUNC(candidate_symbol)) {
346  /* Use it if the address is in the function range. */
347  if (symbol_contains_addr(candidate_symbol,address)) {
348  SYMBOL_WX_FUNC(candidate_symbol,sf,-1);
349 
350  sf->epilogue_begin = (ADDR)address;
352  "set_epilogue_begin: %s is 0x%"PRIxADDR"\n",
353  symbol_get_name(candidate_symbol),(ADDR)address);
354 
355  sf->epilogue_known = 1;
356  }
357  else {
359  "set_epilogue_begin: address 0x%"PRIxADDR" not in %s\n",
360  (ADDR)address,symbol_get_name(candidate_symbol));
361  }
362  }
363 
364  /*
365  * If the prologue_end register is set, try to use that
366  * before doing autodetection.
367  */
368  if (prologue_end && candidate_symbol
369  && SYMBOL_IS_FUNC(candidate_symbol)) {
370  /* Use it if the address is in the function range. */
371  if (symbol_contains_addr(candidate_symbol,address)) {
372  SYMBOL_WX_FUNC(candidate_symbol,sf,-1);
373 
374  sf->prologue_end = (ADDR)address;
376  "set_prologue_end: %s is 0x%"PRIxADDR"\n",
377  symbol_get_name(candidate_symbol),(ADDR)address);
378 
379  /* Unset auto detected flag; we have one for
380  sure. */
381  sf->prologue_guessed = 0;
382  sf->prologue_known = 1;
383 
384  /* Unset symbol so we don't try to use "auto"
385  detection. */
386  symbol = NULL;
387  }
388  else {
390  "set_prologue_end: address 0x%"PRIxADDR" not in %s\n",
391  (ADDR)address,symbol_get_name(candidate_symbol));
392  }
393  }
394 
395  /* Clear prologue_end and epilogue_begin registers as
396  per the spec. */
397  prologue_end = false;
398  epilogue_begin = false;
399 
400  /*
401  * Try to find a symbol at this address; if we find one,
402  * and it is a function, set its prologue_end value!
403  */
404  if (symbol && SYMBOL_IS_FUNC(symbol)) {
405  /* If the current address is not in s, assume we're
406  * done with it!
407  *
408  * XXX: is this right?
409  */
410  if (symbol_contains_addr(symbol,address)) {
411  SYMBOL_WX_FUNC(symbol,sf,-1);
412 
413  sf->prologue_end = (ADDR)address;
415  "assuming prologue_end of %s is 0x%"PRIxADDR"\n",
416  symbol_get_name(symbol),(ADDR)address);
417 
418  /* Set auto detected flag; we're just guessing! */
419  sf->prologue_guessed = 1;
420  }
421  else {
423  "address 0x%"PRIxADDR" not in %s\n",
424  (ADDR)address,symbol_get_name(symbol));
425  }
426 
427  /*
428  * We only assume the first address after seeing the
429  * function's lowest address is the end of prologue.
430  */
431  symbol = NULL;
432  }
433  else if (symbol)
434  /*
435  * Must have been a non-func symbol; so ignore it
436  * for future iterations.
437  */
438  symbol = NULL;
439 
440  if (!symbol) {
441  symbol = (struct symbol *) \
442  g_hash_table_lookup(debugfile->addresses,
443  (gpointer)(ADDR)address);
444  if (symbol && SYMBOL_IS_FUNC(symbol)) {
446  "found candidate prologue function %s at 0x%"PRIxADDR"\n",
447  symbol_get_name(symbol),(ADDR)address);
448  candidate_symbol = symbol;
449  }
450  else
452  "did not find function at 0x%"PRIxADDR"\n",
453  (ADDR)address);
454  }
455  }
456  else if (opcode == 0) {
457  /* This an extended opcode. */
458  if (unlikely(linep + 2 > lineendp))
459  goto invalid_unit_out;
460 
461  /* The length. */
462  length = *(unsigned char *)linep++;
463 
464  if (unlikely(linep + length > lineendp))
465  goto invalid_unit_out;
466 
467  /* The sub-opcode. */
468  opcode = *(unsigned char *)linep++;
469 
470  switch (opcode) {
471  case DW_LNE_end_sequence:
472  /* Save the line/address tuple. */
473  storeline();
474 
475  currentfile = (char *)array_list_item(filelist,0);
476  currentclf = NULL;
477  currentclfrev = NULL;
478 
479  /* Reset the registers we care about. */
480  address = 0;
481  op_index = 0;
482  line = 1;
483  is_stmt = default_is_stmt;
484  break;
485  case DW_LNE_set_address:
486  op_index = 0;
487  if (address_size == 4)
488  address = read_4ubyte_unaligned_inc(obo,linep);
489  else
490  address = read_8ubyte_unaligned_inc(obo,linep);
491 
492  if (!symbol) {
493  symbol = (struct symbol *) \
494  g_hash_table_lookup(debugfile->addresses,
495  (gpointer)(ADDR)address);
496  if (symbol && SYMBOL_IS_FUNC(symbol)) {
498  "found candidate prologue function %s at 0x%"PRIxADDR"\n",
499  symbol_get_name(symbol),(ADDR)address);
500  candidate_symbol = symbol;
501  }
502  }
503 
504  break;
505  case DW_LNE_define_file:;
506  endp = memchr(linep,'\0',lineendp - linep);
507  if (unlikely(endp == NULL))
508  goto invalid_unit_out;
509  startp = linep;
510  linep = endp + 1;
511 
512  clinep = (const unsigned char *)linep;
513  /* unsigned int diridx; */
514  get_uleb128(u128,clinep);
515 
516 
517  /* Construct a full filename. */
518  if (u128 == 0) {
519  if (compdirname)
520  dirp = compdirname;
521  else
522  dirp = (char *)array_list_item(dirlist,0);
523  }
524  else
525  dirp = (char *)array_list_item(dirlist,u128 - 1);
526  filenamelen = strlen(dirp)+1+(endp - startp)+1;
527  buf = malloc(filenamelen);
528  snprintf(buf,filenamelen,"%s/%s",dirp,(char *)startp);
529  array_list_add(filelist,buf);
530 
531  /* XXX: DWARF spec doesn't say if this becomes the
532  * current file; assume it does!
533  */
534  currentfile = buf;
535  currentclf = NULL;
536  currentclfrev = NULL;
537 
538  /* Dwarf_Word mtime; */
539  get_uleb128(u128,clinep);
540  /* Dwarf_Word filelength; */
541  get_uleb128(u128,clinep);
542  linep = (unsigned char *)clinep;
543 
544  break;
545 #if _INT_ELFUTILS_VERSION > 147
546  case DW_LNE_set_discriminator:
547  /* Takes one ULEB128 parameter, the discriminator. */
548  if (unlikely(standard_opcode_lengths[opcode] != 1))
549  goto invalid_unit_out;
550 
551  clinep = (const unsigned char *)linep;
552  get_uleb128(u128,clinep);
553  linep = (unsigned char *)clinep;
554  break;
555 #endif
556  default:
557  /* Unknown, ignore it. */
558  vwarn("unknown opcode\n");
559  linep += length - 1;
560  break;
561  }
562  }
563  else if (opcode <= DW_LNS_set_isa) {
564  /* This is a known standard opcode. */
565  switch (opcode) {
566  case DW_LNS_copy:
567  /* Takes no argument. */
568 
569  /* Save the line/address tuple. */
570  storeline();
571 
572  /* Clear prologue_end and epilogue_begin registers as
573  per the spec. */
574  prologue_end = false;
575  epilogue_begin = false;
576  break;
577  case DW_LNS_advance_pc:
578  /* Takes one uleb128 parameter which is added to the
579  address. */
580  clinep = (const unsigned char *)linep;
581  get_uleb128(u128,clinep);
582  linep = (unsigned char *)clinep;
583  advance_pc(u128);
584  break;
585  case DW_LNS_advance_line:
586  /* Takes one sleb128 parameter which is added to the
587  line. */
588  clinep = (const unsigned char *)linep;
589  get_sleb128(s128,clinep);
590  linep = (unsigned char *)clinep;
591  line += s128;
592  break;
593  case DW_LNS_set_file:
594  /* Takes one uleb128 parameter which is stored in file. */
595  clinep = (const unsigned char *)linep;
596  get_uleb128(u128,clinep);
597 
598  /* Update the current line and currentclf stuff. */
599  if (u128 >= (unsigned int)array_list_len(filelist)) {
601  "set_file index %u out of bounds; aborting!\n",
602  u128);
603  goto invalid_unit_out;
604  }
605  currentfile = array_list_item(filelist,((int)u128) - 1);
606  currentclf = NULL;
607  currentclfrev = NULL;
608 
609  vdebug(9,LA_DEBUG,LF_DOTHER,"set file to %s\n",currentfile);
610 
611  linep = (unsigned char *)clinep;
612  break;
613  case DW_LNS_set_column:
614  /* Takes one uleb128 parameter which is stored in column. */
615  if (unlikely(standard_opcode_lengths[opcode] != 1))
616  goto invalid_unit_out;
617  clinep = (const unsigned char *)linep;
618  get_uleb128(u128,clinep);
619  linep = (unsigned char *)clinep;
620  break;
621  case DW_LNS_negate_stmt:
622  /* Takes no argument. */
623  is_stmt = 1 - is_stmt;
624  break;
625  case DW_LNS_set_basic_block:
626  /* Takes no argument. */
627  break;
628  case DW_LNS_const_add_pc:
629  /* Takes no argument. */
630  advance_pc((255 - opcode_base) / line_range);
631  break;
632  case DW_LNS_fixed_advance_pc:
633  /* Takes one 16 bit parameter which is added to the
634  address. */
635  if (unlikely(standard_opcode_lengths[opcode] != 1))
636  goto invalid_unit_out;
637  u128 = read_2ubyte_unaligned_inc(obo,linep);
638  address += u128;
639  op_index = 0;
640  break;
641  case DW_LNS_set_prologue_end:
642  /* Takes no argument. */
643  prologue_end = true;
644  break;
645  case DW_LNS_set_epilogue_begin:
646  /* Takes no argument. */
647  epilogue_begin = true;
648  break;
649  case DW_LNS_set_isa:
650  /* Takes one uleb128 parameter which is stored in isa. */
651  if (unlikely(standard_opcode_lengths[opcode] != 1))
652  goto invalid_unit_out;
653  clinep = (const unsigned char *)linep;
654  get_uleb128(u128,clinep);
655  linep = (unsigned char *)clinep;
656  break;
657  }
658  }
659  else {
660  /* This is a new opcode the generator but not we know about.
661  Read the parameters associated with it but then discard
662  everything. Read all the parameters for this opcode. */
663  vwarn(" unknown opcode with %" PRIu8 " parameters:",
664  standard_opcode_lengths[opcode]);
665  for (i = standard_opcode_lengths[opcode]; i > 0; --i) {
666  clinep = (const unsigned char *)linep;
667  get_uleb128(u128,clinep);
668  linep = (unsigned char *)clinep;
669  if (i != standard_opcode_lengths[opcode])
670  vwarnc(",");
671  vwarnc(" %u",u128);
672  }
673  vwarnc("\n");
674 
675  /* Next round, ignore this opcode. */
676  //continue;
677  }
678  }
679  }
680 
681  retval = 0;
682  goto out;
683 
684  invalid_unit_out:
686  "invalid DWARF line info at offset %tu\n",linep - linestartp);
687  retval = -1;
688  goto out;
689 
690  invalid_data_out:
691  verror("invalid line data (overrun)!\n");
692  retval = -1;
693  goto out;
694 
695  out:
696  if (dirlist)
697  array_list_free(dirlist);
698  if (filelist)
699  array_list_deep_free(filelist);
700 
701  return retval;
702 }
703 
707 const char *
708 dwarf_tag_string (unsigned int tag)
709 {
710  static const char *const known_tags[] =
711  {
712  [DW_TAG_array_type] = "array_type",
713  [DW_TAG_class_type] = "class_type",
714  [DW_TAG_entry_point] = "entry_point",
715  [DW_TAG_enumeration_type] = "enumeration_type",
716  [DW_TAG_formal_parameter] = "formal_parameter",
717  [DW_TAG_imported_declaration] = "imported_declaration",
718  [DW_TAG_label] = "label",
719  [DW_TAG_lexical_block] = "lexical_block",
720  [DW_TAG_member] = "member",
721  [DW_TAG_pointer_type] = "pointer_type",
722  [DW_TAG_reference_type] = "reference_type",
723  [DW_TAG_compile_unit] = "compile_unit",
724  [DW_TAG_string_type] = "string_type",
725  [DW_TAG_structure_type] = "structure_type",
726  [DW_TAG_subroutine_type] = "subroutine_type",
727  [DW_TAG_typedef] = "typedef",
728  [DW_TAG_union_type] = "union_type",
729  [DW_TAG_unspecified_parameters] = "unspecified_parameters",
730  [DW_TAG_variant] = "variant",
731  [DW_TAG_common_block] = "common_block",
732  [DW_TAG_common_inclusion] = "common_inclusion",
733  [DW_TAG_inheritance] = "inheritance",
734  [DW_TAG_inlined_subroutine] = "inlined_subroutine",
735  [DW_TAG_module] = "module",
736  [DW_TAG_ptr_to_member_type] = "ptr_to_member_type",
737  [DW_TAG_set_type] = "set_type",
738  [DW_TAG_subrange_type] = "subrange_type",
739  [DW_TAG_with_stmt] = "with_stmt",
740  [DW_TAG_access_declaration] = "access_declaration",
741  [DW_TAG_base_type] = "base_type",
742  [DW_TAG_catch_block] = "catch_block",
743  [DW_TAG_const_type] = "const_type",
744  [DW_TAG_constant] = "constant",
745  [DW_TAG_enumerator] = "enumerator",
746  [DW_TAG_file_type] = "file_type",
747  [DW_TAG_friend] = "friend",
748  [DW_TAG_namelist] = "namelist",
749  [DW_TAG_namelist_item] = "namelist_item",
750  [DW_TAG_packed_type] = "packed_type",
751  [DW_TAG_subprogram] = "subprogram",
752  [DW_TAG_template_type_parameter] = "template_type_parameter",
753  [DW_TAG_template_value_parameter] = "template_value_parameter",
754  [DW_TAG_thrown_type] = "thrown_type",
755  [DW_TAG_try_block] = "try_block",
756  [DW_TAG_variant_part] = "variant_part",
757  [DW_TAG_variable] = "variable",
758  [DW_TAG_volatile_type] = "volatile_type",
759  [DW_TAG_dwarf_procedure] = "dwarf_procedure",
760  [DW_TAG_restrict_type] = "restrict_type",
761  [DW_TAG_interface_type] = "interface_type",
762  [DW_TAG_namespace] = "namespace",
763  [DW_TAG_imported_module] = "imported_module",
764  [DW_TAG_unspecified_type] = "unspecified_type",
765  [DW_TAG_partial_unit] = "partial_unit",
766  [DW_TAG_imported_unit] = "imported_unit",
767 #if _INT_ELFUTILS_VERSION < 160
768  [DW_TAG_mutable_type] = "mutable_type",
769 #endif
770  [DW_TAG_condition] = "condition",
771  [DW_TAG_shared_type] = "shared_type",
772 #if _INT_ELFUTILS_VERSION > 141
773  [DW_TAG_type_unit] = "type_unit",
774  [DW_TAG_rvalue_reference_type] = "rvalue_reference_type",
775 #endif
776 #if _INT_ELFUTILS_VERSION > 147
777  [DW_TAG_template_alias] = "template_alias",
778 #endif
779 #if _INT_ELFUTILS_VERSION > 161
780  [DW_TAG_atomic_type] = "atomic_type",
781 #endif
782  };
783  const unsigned int nknown_tags = (sizeof (known_tags)
784  / sizeof (known_tags[0]));
785  static char buf[40];
786  const char *result = NULL;
787 
788  if (likely (tag < nknown_tags))
789  result = known_tags[tag];
790 
791  if (unlikely (result == NULL))
792  /* There are a few known extensions. */
793  switch (tag)
794  {
795  case DW_TAG_MIPS_loop:
796  result = "MIPS_loop";
797  break;
798 
799  case DW_TAG_format_label:
800  result = "format_label";
801  break;
802 
803  case DW_TAG_function_template:
804  result = "function_template";
805  break;
806 
807  case DW_TAG_class_template:
808  result = "class_template";
809  break;
810 
811 #if _INT_ELFUTILS_VERSION >= 147
812  case DW_TAG_GNU_BINCL:
813  result = "GNU_BINCL";
814  break;
815 
816  case DW_TAG_GNU_EINCL:
817  result = "GNU_EINCL";
818  break;
819 
820  case DW_TAG_GNU_template_template_param:
821  result = "GNU_template_template_param";
822  break;
823 
824  case DW_TAG_GNU_template_parameter_pack:
825  result = "GNU_template_parameter_pack";
826  break;
827 
828  case DW_TAG_GNU_formal_parameter_pack:
829  result = "GNU_formal_parameter_pack";
830  break;
831 #endif
832 
833  default:
834  if (tag < DW_TAG_lo_user)
835  snprintf (buf, sizeof buf, "unknown tag %hx", tag);
836  else
837  snprintf (buf, sizeof buf, "unknown user tag %hx", tag);
838  result = buf;
839  break;
840  }
841 
842  return result;
843 }
844 
845 
849 const char *
850 dwarf_attr_string (unsigned int attrnum)
851 {
852  static const char *const known_attrs[] =
853  {
854  [DW_AT_sibling] = "sibling",
855  [DW_AT_location] = "location",
856  [DW_AT_name] = "name",
857  [DW_AT_ordering] = "ordering",
858  [DW_AT_subscr_data] = "subscr_data",
859  [DW_AT_byte_size] = "byte_size",
860  [DW_AT_bit_offset] = "bit_offset",
861  [DW_AT_bit_size] = "bit_size",
862  [DW_AT_element_list] = "element_list",
863  [DW_AT_stmt_list] = "stmt_list",
864  [DW_AT_low_pc] = "low_pc",
865  [DW_AT_high_pc] = "high_pc",
866  [DW_AT_language] = "language",
867  [DW_AT_member] = "member",
868  [DW_AT_discr] = "discr",
869  [DW_AT_discr_value] = "discr_value",
870  [DW_AT_visibility] = "visibility",
871  [DW_AT_import] = "import",
872  [DW_AT_string_length] = "string_length",
873  [DW_AT_common_reference] = "common_reference",
874  [DW_AT_comp_dir] = "comp_dir",
875  [DW_AT_const_value] = "const_value",
876  [DW_AT_containing_type] = "containing_type",
877  [DW_AT_default_value] = "default_value",
878  [DW_AT_inline] = "inline",
879  [DW_AT_is_optional] = "is_optional",
880  [DW_AT_lower_bound] = "lower_bound",
881  [DW_AT_producer] = "producer",
882  [DW_AT_prototyped] = "prototyped",
883  [DW_AT_return_addr] = "return_addr",
884  [DW_AT_start_scope] = "start_scope",
885  [DW_AT_bit_stride] = "bit_stride",
886  [DW_AT_upper_bound] = "upper_bound",
887  [DW_AT_abstract_origin] = "abstract_origin",
888  [DW_AT_accessibility] = "accessibility",
889  [DW_AT_address_class] = "address_class",
890  [DW_AT_artificial] = "artificial",
891  [DW_AT_base_types] = "base_types",
892  [DW_AT_calling_convention] = "calling_convention",
893  [DW_AT_count] = "count",
894  [DW_AT_data_member_location] = "data_member_location",
895  [DW_AT_decl_column] = "decl_column",
896  [DW_AT_decl_file] = "decl_file",
897  [DW_AT_decl_line] = "decl_line",
898  [DW_AT_declaration] = "declaration",
899  [DW_AT_discr_list] = "discr_list",
900  [DW_AT_encoding] = "encoding",
901  [DW_AT_external] = "external",
902  [DW_AT_frame_base] = "frame_base",
903  [DW_AT_friend] = "friend",
904  [DW_AT_identifier_case] = "identifier_case",
905  [DW_AT_macro_info] = "macro_info",
906  [DW_AT_namelist_item] = "namelist_item",
907  [DW_AT_priority] = "priority",
908  [DW_AT_segment] = "segment",
909  [DW_AT_specification] = "specification",
910  [DW_AT_static_link] = "static_link",
911  [DW_AT_type] = "type",
912  [DW_AT_use_location] = "use_location",
913  [DW_AT_variable_parameter] = "variable_parameter",
914  [DW_AT_virtuality] = "virtuality",
915  [DW_AT_vtable_elem_location] = "vtable_elem_location",
916  [DW_AT_allocated] = "allocated",
917  [DW_AT_associated] = "associated",
918  [DW_AT_data_location] = "data_location",
919  [DW_AT_byte_stride] = "byte_stride",
920  [DW_AT_entry_pc] = "entry_pc",
921  [DW_AT_use_UTF8] = "use_UTF8",
922  [DW_AT_extension] = "extension",
923  [DW_AT_ranges] = "ranges",
924  [DW_AT_trampoline] = "trampoline",
925  [DW_AT_call_column] = "call_column",
926  [DW_AT_call_file] = "call_file",
927  [DW_AT_call_line] = "call_line",
928  [DW_AT_description] = "description",
929  [DW_AT_binary_scale] = "binary_scale",
930  [DW_AT_decimal_scale] = "decimal_scale",
931  [DW_AT_small] = "small",
932  [DW_AT_decimal_sign] = "decimal_sign",
933  [DW_AT_digit_count] = "digit_count",
934  [DW_AT_picture_string] = "picture_string",
935  [DW_AT_mutable] = "mutable",
936  [DW_AT_threads_scaled] = "threads_scaled",
937  [DW_AT_explicit] = "explicit",
938  [DW_AT_object_pointer] = "object_pointer",
939  [DW_AT_endianity] = "endianity",
940  [DW_AT_elemental] = "elemental",
941  [DW_AT_pure] = "pure",
942  [DW_AT_recursive] = "recursive",
943 #if _INT_ELFUTILS_VERSION > 141
944  [DW_AT_signature] = "signature",
945  [DW_AT_main_subprogram] = "main_subprogram",
946  [DW_AT_data_bit_offset] = "data_bit_offset",
947  [DW_AT_const_expr] = "const_expr",
948 #endif
949 #if _INT_ELFUTILS_VERSION > 147
950  [DW_AT_enum_class] = "enum_class",
951  [DW_AT_linkage_name] = "linkage_name",
952 #endif
953  };
954  const unsigned int nknown_attrs = (sizeof (known_attrs)
955  / sizeof (known_attrs[0]));
956  static char buf[40];
957  const char *result = NULL;
958 
959  if (likely (attrnum < nknown_attrs))
960  result = known_attrs[attrnum];
961 
962  if (unlikely (result == NULL))
963  /* There are a few known extensions. */
964  switch (attrnum)
965  {
966  case DW_AT_MIPS_fde:
967  result = "MIPS_fde";
968  break;
969 
970  case DW_AT_MIPS_loop_begin:
971  result = "MIPS_loop_begin";
972  break;
973 
974  case DW_AT_MIPS_tail_loop_begin:
975  result = "MIPS_tail_loop_begin";
976  break;
977 
978  case DW_AT_MIPS_epilog_begin:
979  result = "MIPS_epilog_begin";
980  break;
981 
982  case DW_AT_MIPS_loop_unroll_factor:
983  result = "MIPS_loop_unroll_factor";
984  break;
985 
986  case DW_AT_MIPS_software_pipeline_depth:
987  result = "MIPS_software_pipeline_depth";
988  break;
989 
990  case DW_AT_MIPS_linkage_name:
991  result = "MIPS_linkage_name";
992  break;
993 
994  case DW_AT_MIPS_stride:
995  result = "MIPS_stride";
996  break;
997 
998  case DW_AT_MIPS_abstract_name:
999  result = "MIPS_abstract_name";
1000  break;
1001 
1002  case DW_AT_MIPS_clone_origin:
1003  result = "MIPS_clone_origin";
1004  break;
1005 
1006  case DW_AT_MIPS_has_inlines:
1007  result = "MIPS_has_inlines";
1008  break;
1009 
1010  case DW_AT_MIPS_stride_byte:
1011  result = "MIPS_stride_byte";
1012  break;
1013 
1014  case DW_AT_MIPS_stride_elem:
1015  result = "MIPS_stride_elem";
1016  break;
1017 
1018  case DW_AT_MIPS_ptr_dopetype:
1019  result = "MIPS_ptr_dopetype";
1020  break;
1021 
1022  case DW_AT_MIPS_allocatable_dopetype:
1023  result = "MIPS_allocatable_dopetype";
1024  break;
1025 
1026  case DW_AT_MIPS_assumed_shape_dopetype:
1027  result = "MIPS_assumed_shape_dopetype";
1028  break;
1029 
1030  case DW_AT_MIPS_assumed_size:
1031  result = "MIPS_assumed_size";
1032  break;
1033 
1034  case DW_AT_sf_names:
1035  result = "sf_names";
1036  break;
1037 
1038  case DW_AT_src_info:
1039  result = "src_info";
1040  break;
1041 
1042  case DW_AT_mac_info:
1043  result = "mac_info";
1044  break;
1045 
1046  case DW_AT_src_coords:
1047  result = "src_coords";
1048  break;
1049 
1050  case DW_AT_body_begin:
1051  result = "body_begin";
1052  break;
1053 
1054  case DW_AT_body_end:
1055  result = "body_end";
1056  break;
1057 
1058 #if _INT_ELFUTILS_VERSION > 143
1059  case DW_AT_GNU_vector:
1060  result = "GNU_vector";
1061  break;
1062 
1063  case DW_AT_GNU_guarded_by:
1064  result = "GNU_guarded_by";
1065  break;
1066 
1067  case DW_AT_GNU_pt_guarded_by:
1068  result = "GNU_pt_guarded_by";
1069  break;
1070 
1071  case DW_AT_GNU_guarded:
1072  result = "GNU_guarded";
1073  break;
1074 
1075  case DW_AT_GNU_pt_guarded:
1076  result = "GNU_pt_guarded";
1077  break;
1078 
1079  case DW_AT_GNU_locks_excluded:
1080  result = "GNU_locks_excluded";
1081  break;
1082 
1083  case DW_AT_GNU_exclusive_locks_required:
1084  result = "GNU_exclusive_locks_required";
1085  break;
1086 
1087  case DW_AT_GNU_shared_locks_required:
1088  result = "GNU_shared_locks_required";
1089  break;
1090 
1091  case DW_AT_GNU_odr_signature:
1092  result = "GNU_odr_signature";
1093  break;
1094 
1095  case DW_AT_GNU_template_name:
1096  result = "GNU_template_name";
1097  break;
1098 #endif
1099 
1100  default:
1101  if (attrnum < DW_AT_lo_user)
1102  snprintf (buf, sizeof buf, "unknown attribute %hx",
1103  attrnum);
1104  else
1105  snprintf (buf, sizeof buf, "unknown user attribute %hx",
1106  attrnum);
1107  result = buf;
1108  break;
1109  }
1110 
1111  return result;
1112 }
1113 
1114 
1118 const char *
1119 dwarf_form_string (unsigned int form)
1120 {
1121  static const char *const known_forms[] =
1122  {
1123  [DW_FORM_addr] = "addr",
1124  [DW_FORM_block2] = "block2",
1125  [DW_FORM_block4] = "block4",
1126  [DW_FORM_data2] = "data2",
1127  [DW_FORM_data4] = "data4",
1128  [DW_FORM_data8] = "data8",
1129  [DW_FORM_string] = "string",
1130  [DW_FORM_block] = "block",
1131  [DW_FORM_block1] = "block1",
1132  [DW_FORM_data1] = "data1",
1133  [DW_FORM_flag] = "flag",
1134  [DW_FORM_sdata] = "sdata",
1135  [DW_FORM_strp] = "strp",
1136  [DW_FORM_udata] = "udata",
1137  [DW_FORM_ref_addr] = "ref_addr",
1138  [DW_FORM_ref1] = "ref1",
1139  [DW_FORM_ref2] = "ref2",
1140  [DW_FORM_ref4] = "ref4",
1141  [DW_FORM_ref8] = "ref8",
1142  [DW_FORM_ref_udata] = "ref_udata",
1143  [DW_FORM_indirect] = "indirect",
1144 #if _INT_ELFUTILS_VERSION > 141
1145  [DW_FORM_sec_offset] = "sec_offset",
1146  [DW_FORM_exprloc] = "exprloc",
1147  [DW_FORM_flag_present] = "flag_present",
1148  [DW_FORM_ref_sig8] = "ref_sig8"
1149 #endif
1150  };
1151  const unsigned int nknown_forms = (sizeof (known_forms)
1152  / sizeof (known_forms[0]));
1153  static char buf[40];
1154  const char *result = NULL;
1155 
1156  if (likely (form < nknown_forms))
1157  result = known_forms[form];
1158 
1159  if (unlikely (result == NULL))
1160  snprintf (buf, sizeof buf, "unknown form %x",form);
1161 
1162  return result;
1163 }
1164 
1165 
1169 const char *
1170 dwarf_lang_string (unsigned int lang)
1171 {
1172  static const char *const known[] =
1173  {
1174  [DW_LANG_C89] = "ISO C89",
1175  [DW_LANG_C] = "C",
1176  [DW_LANG_Ada83] = "Ada83",
1177  [DW_LANG_C_plus_plus] = "C++",
1178  [DW_LANG_Cobol74] = "Cobol74",
1179  [DW_LANG_Cobol85] = "Cobol85",
1180  [DW_LANG_Fortran77] = "Fortran77",
1181  [DW_LANG_Fortran90] = "Fortran90",
1182  [DW_LANG_Pascal83] = "Pascal83",
1183  [DW_LANG_Modula2] = "Modula2",
1184  [DW_LANG_Java] = "Java",
1185  [DW_LANG_C99] = "ISO C99",
1186  [DW_LANG_Ada95] = "Ada95",
1187  [DW_LANG_Fortran95] = "Fortran95",
1188  [DW_LANG_PL1] = "PL1",
1189 #if _INT_ELFUTILS_VERSION >= 155
1190  [DW_LANG_ObjC] = "Objective C",
1191 #else
1192  [DW_LANG_Objc] = "Objective C",
1193 #endif
1194  [DW_LANG_ObjC_plus_plus] = "Objective C++",
1195  [DW_LANG_UPC] = "UPC",
1196  [DW_LANG_D] = "D",
1197  };
1198 
1199  if (likely (lang < sizeof (known) / sizeof (known[0])))
1200  return known[lang];
1201  else if (lang == DW_LANG_Mips_Assembler)
1202  /* This language tag is used for assembler in general. */
1203  return "Assembler";
1204 
1205  if (lang >= DW_LANG_lo_user && lang <= DW_LANG_hi_user)
1206  {
1207  static char buf[30];
1208  snprintf (buf, sizeof (buf), "lo_user+%u", lang - DW_LANG_lo_user);
1209  return buf;
1210  }
1211 
1212  return "???";
1213 }
1214 
1215 
1219 const char *
1220 dwarf_inline_string (unsigned int code)
1221 {
1222  static const char *const known[] =
1223  {
1224  [DW_INL_not_inlined] = "not_inlined",
1225  [DW_INL_inlined] = "inlined",
1226  [DW_INL_declared_not_inlined] = "declared_not_inlined",
1227  [DW_INL_declared_inlined] = "declared_inlined"
1228  };
1229 
1230  if (likely (code < sizeof (known) / sizeof (known[0])))
1231  return known[code];
1232 
1233  return "???";
1234 }
1235 
1236 
1240 const char *
1241 dwarf_encoding_string (unsigned int code)
1242 {
1243  static const char *const known[] =
1244  {
1245  [DW_ATE_void] = "void",
1246  [DW_ATE_address] = "address",
1247  [DW_ATE_boolean] = "boolean",
1248  [DW_ATE_complex_float] = "complex_float",
1249  [DW_ATE_float] = "float",
1250  [DW_ATE_signed] = "signed",
1251  [DW_ATE_signed_char] = "signed_char",
1252  [DW_ATE_unsigned] = "unsigned",
1253  [DW_ATE_unsigned_char] = "unsigned_char",
1254  [DW_ATE_imaginary_float] = "imaginary_float",
1255  [DW_ATE_packed_decimal] = "packed_decimal",
1256  [DW_ATE_numeric_string] = "numeric_string",
1257  [DW_ATE_edited] = "edited",
1258  [DW_ATE_signed_fixed] = "signed_fixed",
1259  [DW_ATE_unsigned_fixed] = "unsigned_fixed",
1260  [DW_ATE_decimal_float] = "decimal_float",
1261  };
1262 
1263  if (likely (code < sizeof (known) / sizeof (known[0])))
1264  return known[code];
1265 
1266  if (code >= DW_ATE_lo_user && code <= DW_ATE_hi_user)
1267  {
1268  static char buf[30];
1269  snprintf (buf, sizeof (buf), "lo_user+%u", code - DW_ATE_lo_user);
1270  return buf;
1271  }
1272 
1273  return "???";
1274 }
1275 
1276 
1280 const char *
1281 dwarf_access_string (unsigned int code)
1282 {
1283  static const char *const known[] =
1284  {
1285  [DW_ACCESS_public] = "public",
1286  [DW_ACCESS_protected] = "protected",
1287  [DW_ACCESS_private] = "private"
1288  };
1289 
1290  if (likely (code < sizeof (known) / sizeof (known[0])))
1291  return known[code];
1292 
1293  return "???";
1294 }
1295 
1296 
1300 const char *
1301 dwarf_visibility_string (unsigned int code)
1302 {
1303  static const char *const known[] =
1304  {
1305  [DW_VIS_local] = "local",
1306  [DW_VIS_exported] = "exported",
1307  [DW_VIS_qualified] = "qualified"
1308  };
1309 
1310  if (likely (code < sizeof (known) / sizeof (known[0])))
1311  return known[code];
1312 
1313  return "???";
1314 }
1315 
1316 
1320 const char *
1321 dwarf_virtuality_string (unsigned int code)
1322 {
1323  static const char *const known[] =
1324  {
1325  [DW_VIRTUALITY_none] = "none",
1326  [DW_VIRTUALITY_virtual] = "virtual",
1327  [DW_VIRTUALITY_pure_virtual] = "pure_virtual"
1328  };
1329 
1330  if (likely (code < sizeof (known) / sizeof (known[0])))
1331  return known[code];
1332 
1333  return "???";
1334 }
1335 
1336 
1340 const char *
1341 dwarf_identifier_case_string (unsigned int code)
1342 {
1343  static const char *const known[] =
1344  {
1345  [DW_ID_case_sensitive] = "sensitive",
1346  [DW_ID_up_case] = "up_case",
1347  [DW_ID_down_case] = "down_case",
1348  [DW_ID_case_insensitive] = "insensitive"
1349  };
1350 
1351  if (likely (code < sizeof (known) / sizeof (known[0])))
1352  return known[code];
1353 
1354  return "???";
1355 }
1356 
1357 
1361 const char *
1363 {
1364  static const char *const known[] =
1365  {
1366  [DW_CC_normal] = "normal",
1367  [DW_CC_program] = "program",
1368  [DW_CC_nocall] = "nocall",
1369  };
1370 
1371  if (likely (code < sizeof (known) / sizeof (known[0])))
1372  return known[code];
1373 
1374  if (code >= DW_CC_lo_user && code <= DW_CC_hi_user)
1375  {
1376  static char buf[30];
1377  snprintf (buf, sizeof (buf), "lo_user+%u", code - DW_CC_lo_user);
1378  return buf;
1379  }
1380 
1381  return "???";
1382 }
1383 
1384 
1388 const char *
1389 dwarf_ordering_string (unsigned int code)
1390 {
1391  static const char *const known[] =
1392  {
1393  [DW_ORD_row_major] = "row_major",
1394  [DW_ORD_col_major] = "col_major"
1395  };
1396 
1397  if (likely (code < sizeof (known) / sizeof (known[0])))
1398  return known[code];
1399 
1400  return "???";
1401 }
1402 
1403 
1407 const char *
1408 dwarf_discr_list_string (unsigned int code)
1409 {
1410  static const char *const known[] =
1411  {
1412  [DW_DSC_label] = "label",
1413  [DW_DSC_range] = "range"
1414  };
1415 
1416  if (likely (code < sizeof (known) / sizeof (known[0])))
1417  return known[code];
1418 
1419  return "???";
1420 }
int symbol_contains_addr(struct symbol *symbol, ADDR obj_addr)
Definition: debug.c:4063
#define vwarnopt(level, area, flags, format,...)
Definition: log.h:37
const char * dwarf_encoding_string(unsigned int code)
const char * dwarf_ordering_string(unsigned int code)
#define unlikely(expr)
Definition: debugpred.h:101
char * linetab
Definition: dwdebug.h:859
const char * dwarf_attr_string(unsigned int attrnum)
struct scope * symbol_read_owned_scope(struct symbol *symbol)
Definition: debug.c:2674
unsigned int linetablen
Definition: dwdebug.h:871
static uint64_t unsigned int i
GHashTable * srcaddrlines
Definition: dwdebug.h:980
const char * dwarf_virtuality_string(unsigned int code)
#define likely(expr)
Definition: debugpred.h:102
#define get_uleb128(var, addr)
Definition: memory-access.h:67
int clmatchone_add(clmatchone_t *clf, Word_t index, void *data)
Definition: clfit.c:934
const char * dwarf_access_string(unsigned int code)
#define verror(format,...)
Definition: log.h:30
#define SYMBOLX_ROOT(sym)
#define vwarn(format,...)
Definition: log.h:33
const char * dwarf_identifier_case_string(unsigned int code)
Definition: log.h:69
const char * dwarf_discr_list_string(unsigned int code)
struct symbol * root
const char * dwarf_form_string(unsigned int form)
int clmatch_add(clmatch_t *clf, Word_t index, void *data)
Definition: clfit.c:846
GHashTable * srclines
Definition: dwdebug.h:979
Pvoid_t clmatch_t
Definition: clfit.h:129
struct debugfile * debugfile
#define read_8ubyte_unaligned_inc(obo, Addr)
#define vdebug(devel, areas, flags, format,...)
Definition: log.h:302
const char * dwarf_tag_string(unsigned int tag)
Definition: log.h:134
const char * dwarf_inline_string(unsigned int code)
#define SYMBOL_WX_FUNC(sym, wvar, reterr)
#define get_sleb128(var, addr)
Definition: memory-access.h:98
#define read_4ubyte_unaligned_inc(obo, Addr)
#define vwarnc(format,...)
Definition: log.h:35
uint32_t ADDR
Definition: common.h:64
const char * dwarf_visibility_string(unsigned int code)
#define read_2ubyte_unaligned_inc(obo, Addr)
#define PRIxADDR
Definition: common.h:67
int dwarf_get_lines(struct symbol_root_dwarf *srd, Dwarf_Off offset)
GHashTable * addresses
Definition: dwdebug.h:965
char * symbol_get_name(struct symbol *symbol)
Definition: debug.c:2587
struct symbol_root * root
Definition: dwdebug_priv.h:973
void * malloc(size_t size)
Definition: debugserver.c:214
Pvoid_t clmatchone_t
Definition: clfit.h:136
const char * dwarf_calling_convention_string(unsigned int code)
#define SYMBOL_IS_FUNC(sym)
Definition: log.h:127
const char * dwarf_lang_string(unsigned int lang)