Skip to content

Commit d7e5f6d

Browse files
author
ono-max
committed
Set lineNumber of functionLocation correctly
Fixes #470
1 parent dd56fb8 commit d7e5f6d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/debug/server_cdp.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,12 +660,18 @@ def process_cdp args
660660
path = $1
661661
end
662662

663+
if frame.iseq.nil?
664+
line = 0
665+
else
666+
line = frame.iseq.first_line - 1
667+
end
668+
663669
{
664670
callFrameId: SecureRandom.hex(16),
665671
functionName: frame.name,
666672
functionLocation: {
667673
scriptId: path,
668-
lineNumber: 0
674+
lineNumber: line
669675
},
670676
location: {
671677
scriptId: path,

0 commit comments

Comments
 (0)