llvm-symbolizer.rst 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. llvm-symbolizer - convert addresses into source code locations
  2. ==============================================================
  3. SYNOPSIS
  4. --------
  5. :program:`llvm-symbolizer` [options]
  6. DESCRIPTION
  7. -----------
  8. :program:`llvm-symbolizer` reads object file names and addresses from standard
  9. input and prints corresponding source code locations to standard output.
  10. If object file is specified in command line, :program:`llvm-symbolizer` reads
  11. only addresses from standard input. This
  12. program uses debug info sections and symbol table in the object files.
  13. EXAMPLE
  14. --------
  15. .. code-block:: console
  16. $ cat addr.txt
  17. a.out 0x4004f4
  18. /tmp/b.out 0x400528
  19. /tmp/c.so 0x710
  20. /tmp/mach_universal_binary:i386 0x1f84
  21. /tmp/mach_universal_binary:x86_64 0x100000f24
  22. $ llvm-symbolizer < addr.txt
  23. main
  24. /tmp/a.cc:4
  25. f(int, int)
  26. /tmp/b.cc:11
  27. h_inlined_into_g
  28. /tmp/header.h:2
  29. g_inlined_into_f
  30. /tmp/header.h:7
  31. f_inlined_into_main
  32. /tmp/source.cc:3
  33. main
  34. /tmp/source.cc:8
  35. _main
  36. /tmp/source_i386.cc:8
  37. _main
  38. /tmp/source_x86_64.cc:8
  39. $ cat addr2.txt
  40. 0x4004f4
  41. 0x401000
  42. $ llvm-symbolizer -obj=a.out < addr2.txt
  43. main
  44. /tmp/a.cc:4
  45. foo(int)
  46. /tmp/a.cc:12
  47. OPTIONS
  48. -------
  49. .. option:: -obj
  50. Path to object file to be symbolized.
  51. .. option:: -functions=[none|short|linkage]
  52. Specify the way function names are printed (omit function name,
  53. print short function name, or print full linkage name, respectively).
  54. Defaults to ``linkage``.
  55. .. option:: -use-symbol-table
  56. Prefer function names stored in symbol table to function names
  57. in debug info sections. Defaults to true.
  58. .. option:: -demangle
  59. Print demangled function names. Defaults to true.
  60. .. option:: -inlining
  61. If a source code location is in an inlined function, prints all the
  62. inlnied frames. Defaults to true.
  63. .. option:: -default-arch
  64. If a binary contains object files for multiple architectures (e.g. it is a
  65. Mach-O universal binary), symbolize the object file for a given architecture.
  66. You can also specify architecture by writing ``binary_name:arch_name`` in the
  67. input (see example above). If architecture is not specified in either way,
  68. address will not be symbolized. Defaults to empty string.
  69. .. option:: -dsym-hint=<path/to/file.dSYM>
  70. (Darwin-only flag). If the debug info for a binary isn't present in the default
  71. location, look for the debug info at the .dSYM path provided via the
  72. ``-dsym-hint`` flag. This flag can be used multiple times.
  73. EXIT STATUS
  74. -----------
  75. :program:`llvm-symbolizer` returns 0. Other exit codes imply internal program error.