summaryrefslogtreecommitdiff
path: root/misc
AgeCommit message (Collapse)Author
2020-12-10Promote webrick to bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3729
2020-10-14Mostly recover a Ruby stack trace from a core fileAaron Patterson
Update the lldb script so it can mostly recover a Ruby stack trace from a core file. It's still missing line numbers and dealing with CFUNCs, but you use it like this: ``` (lldb) rbbt ec rb_control_frame_t TYPE 0x7f6fd6555fa0 EVAL ./bootstraptest/runner.rb error!! 0x7f6fd6555f68 METHOD ./bootstraptest/runner.rb main 0x7f6fd6555f30 METHOD ./bootstraptest/runner.rb in_temporary_working_directory 0x7f6fd6555ef8 METHOD /home/aaron/git/ruby/lib/tmpdir.rb mktmpdir 0x7f6fd6555ec0 BLOCK ./bootstraptest/runner.rb block in in_temporary_working_directory 0x7f6fd6555e88 CFUNC 0x7f6fd6555e50 BLOCK ./bootstraptest/runner.rb block (2 levels) in in_temporary_working_directory 0x7f6fd6555e18 BLOCK ./bootstraptest/runner.rb block in main 0x7f6fd6555de0 METHOD ./bootstraptest/runner.rb exec_test 0x7f6fd6555da8 CFUNC 0x7f6fd6555d70 BLOCK ./bootstraptest/runner.rb block in exec_test 0x7f6fd6555d38 CFUNC 0x7f6fd6555d00 TOP /home/aaron/git/ruby/bootstraptest/test_insns.rb error!! 0x7f6fd6555cc8 CFUNC 0x7f6fd6555c90 BLOCK /home/aaron/git/ruby/bootstraptest/test_insns.rb block in <top (required)> 0x7f6fd6555c58 METHOD ./bootstraptest/runner.rb assert_equal 0x7f6fd6555c20 METHOD ./bootstraptest/runner.rb assert_check 0x7f6fd6555be8 METHOD ./bootstraptest/runner.rb show_progress 0x7f6fd6555bb0 METHOD ./bootstraptest/runner.rb with_stderr 0x7f6fd6555b78 BLOCK ./bootstraptest/runner.rb block in show_progress 0x7f6fd6555b40 BLOCK ./bootstraptest/runner.rb block in assert_check 0x7f6fd6555b08 METHOD ./bootstraptest/runner.rb get_result_string 0x7f6fd6555ad0 METHOD ./bootstraptest/runner.rb make_srcfile 0x7f6fd6555a98 CFUNC 0x7f6fd6555a60 BLOCK ./bootstraptest/runner.rb block in make_srcfile ``` Getting the main execution context is difficult (it is stored in a thread local) so for now you must supply an ec and this will make a backtrace
2020-10-08Fix lldb disassembler so it works with core filesAaron Patterson
This fixes the lldb disassembler script so that it doesn't need a live process when disassembling rb_iseq_t. I also added the PC to the output so you can tell what the VM is executing when it crashed. For example: ``` (lldb) rbdisasm ec->cfp->iseq PC IDX insn_name(operands) 0x56039f0a1720 0000 nop 0x56039f0a1728 0001 getlocal_WC_1( 5 ) 0x56039f0a1738 0003 branchunless( 7 ) 0x56039f0a1748 0005 getlocal_WC_0( 3 ) 0x56039f0a1758 0007 putstring( (VALUE)0x56039f0c7eb8 ) 0x56039f0a1768 0009 opt_send_without_block( (struct rb_call_data *)0x56039f09f140 ) 0x56039f0a1778 0011 pop 0x56039f0a1780 0012 getglobal( ID: 0x7fd7 ) 0x56039f0a1790 0014 branchunless( 7 ) 0x56039f0a17a0 0016 getlocal_WC_0( 3 ) 0x56039f0a17b0 0018 putstring( (VALUE)0x56039f0c7e90 ) 0x56039f0a17c0 0020 opt_send_without_block( (struct rb_call_data *)0x56039f09f150 ) 0x56039f0a17d0 0022 pop 0x56039f0a17d8 0023 getlocal_WC_0( 3 ) 0x56039f0a17e8 0025 putobject( (VALUE)0x56039f0c7e68 ) 0x56039f0a17f8 0027 getlocal_WC_1( 6 ) 0x56039f0a1808 0029 dup 0x56039f0a1810 0030 checktype( 5 ) 0x56039f0a1820 0032 branchif( 4 ) 0x56039f0a1830 0034 dup 0x56039f0a1838 0035 opt_send_without_block( (struct rb_call_data *)0x56039f09f160 ) 0x56039f0a1848 0037 tostring 0x56039f0a1850 0038 putobject( (VALUE)0x56039f0c7e40 ) 0x56039f0a1860 0040 concatstrings( 3 ) 0x56039f0a1870 0042 opt_send_without_block( (struct rb_call_data *)0x56039f09f170 ) 0x56039f0a1880 0044 nop 0x56039f0a1888 0045 leave (lldb) p ec->cfp->pc (const VALUE *) $146 = 0x000056039f0a1848 ``` Here we can see the VM is currently executing `opt_send_without_block` (because the PC is one ahead of the current instruction)
2020-09-28bit table information when printing an objectAaron Patterson
2020-09-22Rudimentary support for disassembling rb_iseq_tAaron Patterson
I need to disassemble instruction sequences while debugging, so I wrote this. Usage is like this: ``` (lldb) p iseq (rb_iseq_t *) $147 = 0x0000000101068400 (lldb) rbdisasm iseq 0000 putspecialobject( 3 ) 0002 putnil 0003 defineclass( ID: 0x560b, (rb_iseq_t *)0x1010681d0, 2 ) 0007 pop 0008 putspecialobject( 3 ) 0010 putnil 0011 defineclass( ID: 0x56eb, (rb_iseq_t *)0x101063b58, 2 ) 0015 leave ``` Also thanks a ton to @kivikakk helping me figure out how to navigate LLDB's Python 😆 Notes: Merged: https://github.com/ruby/ruby/pull/3554
2020-09-02add lldb functions for getting the heap page / heap page bodyAaron Patterson
2020-09-02support T_MATCH in lldbAaron Patterson
2020-08-27add T_ZOMBIE support to lldb scriptsAaron Patterson
2020-06-23lldb_cruby.py: show the sign of Bignum [ci skip]Nobuyoshi Nakada
2020-06-19Removed sdbm entries from toolchaninsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3234
2020-05-07Add T_IMEMO support to lldbAaron Patterson
I'm trying to find why a reference to an IMEMO object isn't being updated
2020-05-07Add T_MOVED support to lldbAaron Patterson
2020-04-26lldb_cruby.py: fixed empty string dump [ci skip]Nobuyoshi Nakada
2019-12-20Fixed misspellingsNobuyoshi Nakada
Fixed misspellings reported at [Bug #16437], only in ruby and rubyspec.
2019-11-25lldb_cruby.py: improved dump of SymbolNobuyoshi Nakada
[ci skip]
2019-11-25lldb_cruby.py: fixed dump of embedded RArrayNobuyoshi Nakada
[ci skip]
2019-10-24Refined `rp` output [ci skip]Nobuyoshi Nakada
So that the result structure can be accessed as `$number` variables, not a mere `VALUE`.
2019-10-09lldb_cruby.py: fixed inspecting string [ci skip]Nobuyoshi Nakada
Show the size of String. To see the whole contents even after NUL char: ``` (lldb) rp str (const char [5]) $1 = "x" (lldb) memory read -s1 --format x --count `sizeof($1)` -- &$1 0x1010457a8: 0x78 0x00 0x61 0x61 0x61 ```
2019-10-09lldb_cruby.py: fixed embedded string ptr [ci skip]Nobuyoshi Nakada
Use GetLocation to get the address of embedded array.
2019-10-03Resolve unused local variable reported by LGTMRomain Tartière
LGTM reports that the value assigned to local variable 'shared' is never used: https://lgtm.com/projects/g/ruby/ruby/snapshot/f319a5d064627c6641817ec2ed16b97b4d215148/files/misc/lldb_cruby.py#x6512c0281581a470:1 This problem was introduced in by the refactoring that took place in 7c496b6624f720d539e3c0b40f122a9422a13b99. Notes: Merged: https://github.com/ruby/ruby/pull/2517
2019-09-25lldb_inspect: removed unnecessary newline and `end` optionNobuyoshi Nakada
2019-09-24misc/lldb_cruby.py: update for python3 [ci skip]Nobuyoshi Nakada
lldb module bundled with Xcode is for Python 3 now.
2019-09-24misc/lldb_cruby.py: removed unused module `commands` [ci skip]Nobuyoshi Nakada
2019-08-29Add some NODE information for lldbAaron Patterson
Just adds a conditional in the lldb scripts so we can more easily debug NODE objects.
2019-08-25Fix ArgumentError in expand_tabs.rbJeremy Evans
This fixes the following in my environment: misc/expand_tabs.rb:29:in `=~': invalid byte sequence in US-ASCII (ArgumentError) This switches from =~ to start_with? as a regular expression is not actually needed here.
2019-08-23Simplify expand_tabs.rb file selectionTakashi Kokubun
2019-08-22Add misc/expand_tabs.rb ported from auto-style.rbTakashi Kokubun
This is implemented to close [Misc #16112] because all other options got at least one objection, and nobody has objected to this solution. This code is a little complicated for the purpose, but that's just because it includes some historical code for auto-style.rb: https://github.com/ruby/ruby-commit-hook/blob/918a7c31b69ad2f7b125608c1c6a1f4fd01ec15a/bin/auto-style.rb Please feel free to improve this file as you like. [Misc #16112]
2019-05-09add FROZEN to lldb debug outputAaron Patterson
2019-04-02Fix typo in lldb scripttenderlove
Also fix tests git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-01add regex support to lldb debug outputtenderlove
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-27ruby-style.el: ruby-style-c-mode by VCS [ci skip]nobu
* misc/ruby-style.el (ruby-style-c-mode): set ruby-style if the remote repository is ruby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20lldb_cruby.py: T_COMPLEX support [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20lldb_cruby.py: T_RATIONAL support [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-04lldb_rp: support Symbol [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-03lldb_rp: support T_CLASS,T_MODULE,T_ICLASS [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-03lldb_rp: use append_command_output [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-03lldb_rp: support more types [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-03lldb_rp: fix the order of results [ci skip]nobu
The outputs from HandleCommand are printed immediately before print statements. Fix the order in `result` by capturing the outputs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-02lldb_rp: reload debug info if not loaded yet [ci skip]nobu
As debug infos in shared libraries are not accessible until loaded, retry loading the infos when needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-01lldb_cruby.py: T_DATA support [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-14Partly reverted for ruby-style.el.hsbt
Revert "Removed old elisp files. New upstream repository was moved https://github.com/ruby/elisp." This reverts commit 7eedd308b841e7b8eb4bc36211d28faf3521ee92. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-14Added entries for lldb files in misc directory.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-14Removed old elisp files. New upstream repository was moved ↵hsbt
https://github.com/ruby/elisp. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-13Remove old ruby-mode.elkazu
Use emacs bundled ruby-mode.el instead. [Feature #6823] [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17misc/ruby-style.el: use spaces for indentationk0kubun
instead of hard tabs. [Bug #14246] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-02ruby-additional.el: shorten here-doc markersnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-10Import ruby-electric.el version 2.3.1 from upstreamknu
It now supports [enh-ruby-mode](https://github.com/zenspider/enhanced-ruby-mode). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-03Add initial test for lldb extensionnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-02Port more commands from .gdbinit to lldbyugui
* misc/lldb_cury.py (dump_node, SDR, rb_count_objects): added git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-01debug.c: more enumsnobu
* debug.c (ruby_dummy_gdb_enums): add enums for RObject, RModule, RString, RArray. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e