Skip to content

debug does not show context when navigating up & down stack #1135

@p-datadog

Description

@p-datadog

Your environment

  • ruby -v: any
  • rdbg -v:

Describe the bug
A clear and concise description of what the bug is.

When navigating up and down the stack, debug does not show any context around the source code.

To Reproduce

Type up or down

irb:rdbg([{"error":0,"meta":{"_dd.p.dm...):008> up
=> 109|             encoder.encode(serializable_trace).tap do |encoded|
=>#2	Datadog::Tracing::Transport::Traces::Encoder.encode_trace(encoder=Datadog::Core::Encoding::JSONEncoder, trace=#<Datadog::Tracing::TraceSegment:0x00007e..., logger=nil, native_events_supported=true) at ~/apps/dd-trace-rb/lib/datadog/tracing/transport/traces.rb:109

Expected behavior
A clear and concise description of what you expected to happen.

I expect to see context around the current line, as all other debuggers I have ever used show.

Additional context
Add any other context about the problem here.

There was a pull request fixing this bug - #1094. It was closed without being merged while there was apparent agreement that the current behavior is not good.

There was also no reason provided as to why debug does not currently show any context when navigating up and down stack frames.

Inspecting the code, the lack of context is hardcoded:

lib/debug/thread_client.rb:              show_src max_lines: 1
lib/debug/thread_client.rb:              show_src max_lines: 1
lib/debug/thread_client.rb:            show_src max_lines: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions