Граф коммитов

126 Коммитов

Автор SHA1 Сообщение Дата
Matt Valentine-House ad9fe6f376 Allow gdb to search source path for required files
When doing out-of-source builds I often end up wanting to use gdb from
inside a build directory.

Currently if I do that the `.gdbinit` in the ruby source directory is
not read.

Attempting to manually load the `.gdbinit` from the Ruby source
directory errors because of hard coded file-paths that assume we're
running gdb from inside the source tree.

Adding the `-s` flag to the `source` command when loading relative files
signals to gdb to search in the source search path for the required
file, rather than just the current directory.

This allows me to use a custom `.gdbinit` from my build directory that
sets the correct source directory and then loads the Ruby `.gdbinit`.

```
dir ../src
source ../src/.gdbinit
```
2024-06-11 14:03:58 +01:00
yui-knk 00054de6b5 Remove nd_entry from NODE_GASGN and NODE_GVAR
After a0f12a0258 NODE_GASGN and
NODE_GVAR hold same value on both nd_vid and nd_entry.
This commit stops setting value to nd_entry and makes to use only
nd_vid.
2023-08-23 07:59:54 +09:00
Jemma Issroff 1272865a8e
Fix broken wiki links (#8002)
Since [Misc #19679] migrated the wiki, these links should be updated
to their new locations.
2023-06-29 17:00:40 -04:00
Takashi Kokubun a57270a848 Expand tabs in .gdbinit 2023-03-31 00:52:47 -07:00
Takashi Kokubun 9f426491ca Put misc/gdb.py [experimental]
This works like:

```
(gdb) cfp
CFP (count=3, addr=0x7ffff73fef50):
$1 = {pc = 0x555556bf7818, sp = 0x7ffff72ff078, iseq = 0x7ffff2603270, self = 140737344619296, ep = 0x7ffff72ff058, block_code = 0x0,
  __bp__ = 0x7ffff72ff060, jit_return = 0x555558c2b000}

Stack (size=3):
[0] FIXNUM: 1
[1] T_STRING: "" bytesize:0 (embed) encoding:1 coderange:7bit $2 = (struct RString *) 0x7ffff249ea80
[2] [PROMOTED] T_OBJECT: $3 = {flags = 21474844769, klass = 140737344040416}
$4 = {0x24, 0x24, 0x24}

(gdb) cfp + 1
CFP (count=3, addr=0x7ffff73fef90):
$5 = {pc = 0x5555567a78f8, sp = 0x7ffff72ff040, iseq = 0x7ffff26032d0, self = 140737344619296, ep = 0x7ffff72ff038, block_code = 0x0,
  __bp__ = 0x7ffff72ff040, jit_return = 0x555558c2b000}

Stack (size=0):
```
2023-03-31 00:20:40 -07:00
Takashi Kokubun f500df097f Fix ivar dump for RVARGC in .gdbinit
It was crashing with:
No symbol "ROBJECT_EMBED_LEN_MAX" in current context.
2023-03-30 23:58:09 -07:00
Takashi Kokubun 0247ccddab Fix a warning in .gdbinit
Warning: 'set logging on', an alias for the command 'set logging enabled', is deprecated.
Use 'set logging enabled on'.
2023-01-09 14:29:18 -08:00
nick evans 01e8d393bc Fix gdb incompatibilies in rp_class, rb_ps_vm
Other changes are needed to bring .gdbinit up-to-date with current ruby.
It looks like lldb is the preferred approach now, and that config *is*
being kept up-to-date.  Still, this might be helpful to someone?
2022-08-20 12:24:37 +09:00
Adam Jensen 132e01a1c3 .gdbinit: Fix indentation in print_id [ci skip] 2021-02-06 13:03:40 -05:00
卜部昌平 0300dec32b kill OBJ_TAINT etc.
Now that RUBY_FL_TAINT is recycled to become new RUBY_FL_SHAREABLE.
Setting/clearing this flag from extension libraries break Ractor.
Especially problematic one is OBJ_INFECT, which would make non-shareable
objects travel across Ractor boundaries.

Such operations should just be prohibited.
2021-01-27 09:30:15 +09:00
Peter Zhu d7cda3b002 Add T_MOVED to rp command of GDB 2020-12-04 08:43:32 -08:00
卜部昌平 1f4db23ac1 .gdbinit: struct RHash::basic is not a pointer 2020-06-12 10:35:44 +09:00
卜部昌平 c74b044aab .gdbinit: as.heap.aux.shared no longer exist
Maybe 182ae1407b missed it.
2020-06-12 10:23:15 +09:00
Takashi Kokubun afd3f64f8c
Redmine /projects/ruby-trunk is now redirected
to /projects/ruby-master
2019-12-31 22:06:19 -08:00
Nobuyoshi Nakada 7069f64c41
Prefix global_symbols with `ruby_` 2019-05-16 15:43:16 +09:00
ktsj 124957566f .gdbinit (rp): follow up changes in r66390
RHASH_ARRAY_{LEN,BOUND}_{MASK,SHIFT} have been renamed to
RHASH_AR_TABLE_{SIZE,BOUND}_{MASK,SHIFT}.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-17 06:59:11 +00:00
ko1 8f675cdd00 support theap for T_HASH. [Feature #14989]
* hash.c, internal.h: support theap for small Hash.
  Introduce RHASH_ARRAY (li_table) besides st_table and small Hash
  (<=8 entries) are managed by an array data structure.
  This array data can be managed by theap.
  If st_table is needed, then converting array data to st_table data.

  For st_table using code, we prepare "stlike" APIs which accepts hash value
  and are very similar to st_ APIs.

  This work is based on the GSoC achievement
  by tacinight <tacingiht@gmail.com> and refined by ko1.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30 22:11:51 +00:00
nobu 1a836261bd .gdbinit: startup without shell for macOS Sierra and later
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-10 04:26:54 +00:00
nobu 891d00b492 .gdbinit: expand RBASIC macro for old gdb on mac
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-14 03:18:10 +00:00
ko1 3b43173c64 add "print_flags" gdb command.
* .gdbinit (print_flags): added to show raw FLAGS info for objects.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-13 02:50:21 +00:00
yui-knk 8b9e877b1f Unused macro and field
* node.h (nd_cnt, struct RNode): nd_cnt has been unused
  since r60239, and also cnt field.
* .gdbinit (nd_cnt): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-29 01:58:57 +00:00
yui-knk 7db2db67fa Unused macro
* node.h (nd_noex): nd_noex has been unused since r24128.
* .gdbinit (nd_noex): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-29 01:40:01 +00:00
yui-knk 3d1a523d4c Unused macro
* node.h (nd_frml): nd_frml has been unused since r34134.
* .gdbinit (nd_frml): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-29 01:19:06 +00:00
yui-knk d6d130c18a Unused macro
* node.h (nd_argc): nd_argc has been unused since r24128.
* .gdbinit (nd_argc): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-29 01:00:54 +00:00
yui-knk 3e2ff59f10 Unused macro and field
* node.h (nd_cfnc, struct RNode): nd_cfnc has been unused
  since r49938, and also cfunc field.
* .gdbinit (nd_cfnc): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-28 14:24:14 +00:00
ktsj 61f26a1bf9 .gdbinit (print_lineno): support a succinct bitvector implementation [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-10 06:02:37 +00:00
ktsj 580424d533 .gdbinit (print_lineno): follow up changes in r61534, r61536
insns_info was refactored.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09 01:46:07 +00:00
ktsj 389c80cec1 .gdbinit: fix print_pathobj
$str is not C string but RString.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-18 06:24:52 +00:00
ktsj f3a892429d .gdbinit: follow up changes in r60726
rb_iseq_constant_body::line_info_size and line_info_table have
been renamed to insns_info_size, insns_info.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-18 05:45:21 +00:00
kazu fb5bc568ca fixup r60440 [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-08 14:14:54 +00:00
ktsj c84586b785 .gdbinit: follow up changes in r60440
ruby_current_vm has been renamed to ruby_current_vm_ptr.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29 06:16:10 +00:00
ko1 837fd5e494 Use rb_execution_context_t instead of rb_thread_t
to represent execution context [Feature #14038]

* vm_core.h (rb_thread_t): rb_thread_t::ec is now a pointer.
  There are many code using `th` to represent execution context
  (such as cfp, VM stack and so on). To access `ec`, they need to
  use `th->ec->...` (adding one indirection) so that we need to
  replace them by passing `ec` instead of `th`.

* vm_core.h (GET_EC()): introduced to access current ec. Also
  remove `ruby_current_thread` global variable.

* cont.c (rb_context_t): introduce rb_context_t::thread_ptr instead of
  rb_context_t::thread_value.

* cont.c (ec_set_vm_stack): added to update vm_stack explicitly.

* cont.c (ec_switch): added to switch ec explicitly.

* cont.c (rb_fiber_close): added to terminate fibers explicitly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26 08:32:49 +00:00
nobu 3fc0c18193 debug.c: imemo_mask
* .gdbinit (rp, rp_imemo, rb_ps_thread): update imemo_mask.

* debug.c (ruby_dummy_gdb_enums): include imemo_types.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 23:19:57 +00:00
nobu 6a34a8c403 .gdbinit: newline at rp_id [ci skip]
* .gdbinit (rp_id): add a newline.

* .gdbinit (print_id): should not print a newline here.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-08 05:14:18 +00:00
nobu f52a49130f .gdbinit: print_id in rp_id [ci skip]
* .gdbinit (rp_id): use print_id instead of calling
  lookup_id_str() in a debugger context.

* symbol.c (ID_ENTRY_UNIT): made visible to debuggers.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-06 06:11:25 +00:00
naruse 2698d34dbd output some strings without quotes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-12 12:49:38 +00:00
naruse b7127e6356 Follow latest VM changes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-11 08:50:08 +00:00
nobu bd4a419d3e .gdbinit: fix nd_tree
* .gdbinit (nd_tree): use rb_str_tmp_new to get rid of
  `__extension__'.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-17 04:44:12 +00:00
normal 9d09240d9e rb_execution_context_t: move stack, stack_size and cfp from rb_thread_t
The goal is to reduce rb_context_t and rb_fiber_t size
by removing the need to store the entire rb_thread_t in
there.

[ruby-core:81045] Work-in-progress: soon, we will move more fields here.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-09 05:06:41 +00:00
nobu 655aa318db .gdbinit: suppress gdb message [ci skip]
* .gdbinit (rp): check number of instance variables to get rid of
  "Invalid number 0 of repetitions."  message at an empty object.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-18 10:37:53 +00:00
nobu c85cdc12a4 .gdbinit: RArray in history [ci skip]
* .gdbinit (rp): put the contents of RArray in value history, for
  later use.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-18 10:19:52 +00:00
nobu 982a448ead .gdbinit: rp_bignum
* .gdbinit (rp_bignum): print bignum from higher digits.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-25 02:59:47 +00:00
nobu 4f1a54d2d7 .gdbinit: fix on empty strings [ci skip]
* .gdbinit (output_string): get rid of "Invalid number 0 of
  repetitions" error on empty strings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-25 06:05:51 +00:00
nobu 0da52e5626 .gdbinit: op symbols [ci skip]
* .gdbinit (rp_id): add unhandled operator symbols.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-25 06:05:50 +00:00
nobu 53a1b9f28f .gdbinit: refine rp [ci skip]
* .gdbinit (rp, output_string, rp): show the contents after NUL
  char.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-15 06:08:09 +00:00
nobu 49f38abe5e .gdbinit: refine rp
* .gdbinit (rp): refine output of T_STRUCT and T_BIGNUM to show
  all elements.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-25 05:58:24 +00:00
naruse ed83af606a Use rb_mod_name instead of classname
classname() is static function.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-15 12:42:04 +00:00
nobu c937bd4a92 .gdbinit: improve rp [ci skip]
* .gdbinit (rp): improve T_OBJECT dump.  show the contents of the
  instance variables table.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-12 06:12:09 +00:00
naruse fe5f47a6ee * .gdbinit: follow r55766's VM change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-24 07:56:51 +00:00
naruse 14d9ceed15 * .gdbinit (rb_ps_thread): show the detail of cfunc in ruby level
backtrace.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-01 09:24:59 +00:00