`break /foo/` for matched method

Đang mở
#683 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
ruby
Lĩnh vực
cli, devtools

Hướng nghiên cứu

No files, tests, or implementation entry points are named. Start by tracing how the debugger parses and installs the existing break command, then determine how pending breakpoints and future method definitions are handled. Done means an agreed regexp notation and behavior for matching method names, including tests for existing and future definitions.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

gdb has rbreak regexp (https://sourceware.org/gdb/onlinedocs/gdb/Set-Breaks.html) and maybe debug.gem can provide similar feature.

related to: https://github.com/ruby/debug/issues/655

Questions:

  • Notation:
    • break /foo/ all methods which names contains foo.
      • C1#foo, C2#foobar, C3#bazfoo, ...
    • break C#/foo/: C's methods which contains foo.
      • C#foo, C#foobar, ...
      • Seem's ugly...
    • break /C/#foo: Method foo of classes which names contain C.
      • C1#foo C2#foo, ...
      • Seems ugly too.
    • Only allow break /C#foo/ or break /C\.foo/ and so on?
    • Only allow to match method name?
      • It seems simple. We can extend it later.
  • Behavior:
    • Set breakpoints for existing matched methods (no problem)
    • Set breakpoints for future defined matched methods?
      • break /initialize/ means all initialize methods (and defined in future) can be trapped.
      • maybe it is convenient to support it.
    • Can we support break /obj.foo/ style?
      • maybe no if we allow future defined methods.

So current idea is:

  • break /regexp/ set method breakpoints where the method name matched with Class/Module/method name.
    • break /foo/ should be matched with:
      • C#foo
      • D.foo
      • E.bazfooboo
      • We can not match on class/module names (at least now).
  • It leaves as a pending breakpoint and set breakpoint in future definitions. User needs to del it if you don't need more.
Ngôn ngữ chính
Ruby
Star
1.3k
Fork
146
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ruby/debug

Tất cả issue của ruby/debug

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.