aboutsummaryrefslogtreecommitdiffstats
path: root/addr2line.c
Commit message (Collapse)AuthorAgeFilesLines
* Check the end of Compilation Unit by unit length instead of level of treenaruse2018-10-171-4/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Support base address selection entrynaruse2018-10-161-1/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Correct the handling of .debug_rangesnaruse2018-10-161-31/+60
| | | | | | | Though DWARF specifies "the applicable base address defaults to the base address of the compilation unit", but GCC seems to use zero as default. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* The value of .debug_ranges are uintptr_tnaruse2018-10-161-4/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* If high_pc uses DW_FORM_addr, it's not size but addressnaruse2018-10-161-26/+23
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* check dwarf version and skip non Dwarf v4naruse2018-10-161-2/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Moved hexdump macro before usednobu2018-10-141-24/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Make local functions staticnobu2018-10-141-24/+45
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Read debug_info to show inline functions in backtracenaruse2018-10-141-128/+1175
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * expand tabs.svn2018-10-131-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* addr2line.c: fix *printf type warnings on 32-bitnormal2018-10-131-7/+9
| | | | | | Yup, back to using an ancient 32-bit system... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * expand tabs.svn2018-10-111-88/+88
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert wrongly commit debug_info featurenaruse2018-10-111-1139/+130
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Support FreeBSDnaruse2018-10-111-50/+54
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Support compressed debug_infonaruse2018-10-111-159/+183
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* free line info leavesnaruse2018-10-111-0/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* close dlopen-ed handlenaruse2018-10-111-14/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fixnaruse2018-10-111-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Support additional formsnaruse2018-10-111-20/+38
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Show backtrace with .debug_infonaruse2018-10-111-331/+626
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Read .debug_infonaruse2018-10-111-8/+667
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* addr2line.c: fix -Wmaybe-uninitializedk0kubun2018-09-161-2/+2
| | | | | | | | | | | | ../addr2line.c: In function ‘fill_lines’: ../addr2line.c:709:8: warning: ‘file’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (file != NULL) { ^ ../addr2line.c:535:11: warning: ‘filesize’ may be used uninitialized in this function [-Wmaybe-uninitialized] off_t filesize; ^~~~~~~~ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix issues detected by code analysis tool (mainly Coverity).nobu2018-09-151-2/+6
| | | | | | | | | | | * Fix leaked storage in addr2line.c. * Fix for "top_root" leaking the resource. [Fix GH-1956] From: Jun Aruga <jaruga@redhat.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* FreeBSD 11.0 lacks ELFCOMPRESS_ZLIBnaruse2018-08-131-1/+2
| | | | | | | | | | | | FreeBSD 11.0 unfortunately lacks ELF compression definitions in their elf.h (sys/elf_common.h), and 11.1 introduced them. https://github.com/freebsd/freebsd/commit/b9167d33a12b8a6c279be9cd1005874728e808c9 Though we can add workaround, we simply drop support because FreeBSD 11.0 is already EOL at November 30, 2017. https://www.freebsd.org/security/unsupported.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Don't free allocated uncompressed_debug_line until backtrace is printednaruse2018-08-131-8/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Define parse_compressed_debug_line() only ifdef SUPPORT_COMPRESSED_DEBUG_LINEnaruse2018-08-131-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* support compressed debug_linenaruse2018-08-131-8/+57
| | | | | | | | re-commit r64328 https://blogs.oracle.com/solaris/elf_section_compression-v2 https://gnu.wildebeest.org/blog/mjw/2016/01/13/elf-libelf-compressed-sections-and-elfutils/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "support compressed debug_line"naruse2018-08-131-52/+7
| | | | | | This reverts commit r64328 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* support compressed debug_linenaruse2018-08-131-7/+52
| | | | | | | https://blogs.oracle.com/solaris/elf_section_compression-v2 https://gnu.wildebeest.org/blog/mjw/2016/01/13/elf-libelf-compressed-sections-and-elfutils/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add PRINTF_ARGS to kprintfkazu2018-07-311-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* addr2line.c (kprintf): staticnormal2018-07-091-2/+2
| | | | | | This function is not used outside of addr2line.c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* addr2line.c: no need to keep fd around after mmapnormal2018-07-081-6/+2
| | | | | | | | | | | POSIX mmap(3) manpage stipulates mmap bumps the reference count of the file description. Thus keeping a file descriptor to maintain the reference is not necessary. If this didn't work, every extension .so would require a permanent FD, which is obviously not the case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Support C89 if possiblengoto2017-12-181-1/+6
| | | | | | | | | | | | | * addr2line.c: Because stdbool.h is a C99 feature, compile error occurs with some old compilers without specifying C99 options. Fix compile error with Oracle Solaris Studio 12.4 on Solaris 10. [Bug #14200] [ruby-dev:50366] * missing/stdbool.h: Alternative of stdbool.h for C89 compilers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* addr2line.c: fix r60841 for glibc before 2.22normal2017-11-181-0/+4
| | | | | | | | | | | SHF_COMPRESSED was not defined until glibc 2.22, and there are older distros (e.g. Debian 8.x jessie) which do not have this defined. Perhaps it is safe to define SHF_COMPRESSED to (1 << 11) ourselves, too, since ELF should be a standardized format. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* explictly skip compressed debug linenaruse2017-11-181-2/+8
| | | | | | | | To identify the line of backtrace with ease, show the offset address of library. You can just find the source filename and the line with `addr2line -e libruby.so.2.5.0 0xXXXX` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* make a func static.ko12017-11-161-2/+2
| | | | | | | * addr2line.c (main_exe_path): make it static. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* get rid of strcpynobu2016-12-261-9/+14
| | | | | | | | | | | | | * addr2line.c (follow_debuglink): insert global_debug_dir by using memmove instead of copying to temporary buffer. * dln.c (dln_load): use memcpy with the known length instead of strcpy. * gc.c (rb_gc_unprotect_logging): use strdup instead of malloc and strcpy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* addr2line.c: boundary checksnobu2016-10-181-9/+18
| | | | | | | * addr2line.c (parse_debug_line_cu): boundary checks for compressed debug sections. [ruby-dev:49840] [Bug #12850] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * addr2line.c: drop to support ATARI ST platform. It was discontinuedhsbt2016-05-281-5/+3
| | | | | | | | more than two decades ago. [fix GH-1350] Patch by @cremno * include/ruby/ruby.h: ditto. * io.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * addr2line.c: define toupper for its use. fix r54391.naruse2016-03-291-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * addr2line.c (fill_lines): get base addrs in fill_lines to use itnaruse2014-04-141-27/+27
| | | | | | | with dladdr_fbases introduced at r45563. it didn't get before if the executalbe is not pie. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * addr2line.c (main_exe_path): support FreeBSD.naruse2014-04-141-0/+23
| | | | | | | At least sh, csh, tcsh, bash, and zsh sets realpath of the main executable for dladdr, but gdb doesn't. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * addr2line.c (rb_dump_backtrace_with_lines): set base addressnaruse2014-04-111-29/+35
| | | | | | | which is retrived from dladdr to dladdr_fbases, to skip already parsed objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * addr2line.c (append_obj): clear allocated memory.naruse2014-04-101-2/+3
| | | | | | * addr2line.c (rb_dump_backtrace_with_lines): free `base_addrs'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * addr2line.c (rb_dump_backtrace_with_lines): don't depend hard codednaruse2014-04-011-110/+125
| | | | | | | | | | | | | | symbol '_start'. * addr2line.c (fill_lines): instead of above, get a dynamic symbol in the main executable and use it to know the base address. * addr2line.c (follow_debuglink0): use obj_info_t instead of line_info_t to handle object related data. * addr2line.c (main_exe_path): defined for Linux. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * addr2line.c (fill_lines): use dynsym, which is used for dynamicnaruse2014-03-311-2/+14
| | | | | | linking and always exists, if there's no symtab. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r45417naruse2014-03-281-10/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * addr2line.c (fill_lines): check shdr[i].sh_type because even ifnaruse2014-03-271-8/+18
| | | | | | | | .symtab section exists, the section's type can be SHT_NOBITS and actual data doesn't exist in the file. [Bug #9654] revert r45441. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* temporally change for powerpc64-linux fc18naruse2014-03-261-1/+1
| | | | | | | fc18 powerpc64's libc6-dbg has symtab/strtab but it can't be referenced. therefore add workaround not to see them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove break because strtab/symtab is usually the last segmentnaruse2014-03-261-10/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e