@@ -297,38 +297,38 @@ end
297
297
298
298
Perform one "debugger" command. `cmd` should be one of:
299
299
300
- - "n" : advance to the next line
301
- - "s" : step into the next call
302
- - "c" : continue execution until termination or reaching a breakpoint
303
- - " finish" : finish the current frame and return to the parent
300
+ - `:n` : advance to the next line
301
+ - `:s` : step into the next call
302
+ - `:c` : continue execution until termination or reaching a breakpoint
303
+ - `: finish` : finish the current frame and return to the parent
304
304
305
305
or one of the 'advanced' commands
306
306
307
- - "nc" : step forward to the next call
308
- - "se" : execute a single statement
309
- - "si" : execute a single statement, stepping in if it's a call
310
- - "sg" : step into the generator of a generated function
307
+ - `:nc` : step forward to the next call
308
+ - `:se` : execute a single statement
309
+ - `:si` : execute a single statement, stepping in if it's a call
310
+ - `:sg` : step into the generator of a generated function
311
311
312
312
`rootistoplevel` and `ret` are as described for [`JuliaInterpreter.maybe_reset_frame!`](@ref).
313
313
"""
314
- function debug_command (@nospecialize (recurse), frame:: Frame , cmd:: AbstractString , rootistoplevel:: Bool = false )
314
+ function debug_command (@nospecialize (recurse), frame:: Frame , cmd:: Symbol , rootistoplevel:: Bool = false )
315
315
istoplevel = rootistoplevel && frame. caller === nothing
316
316
cmd0 = cmd
317
- if cmd == " si "
317
+ if cmd == :si
318
318
stmt = pc_expr (frame)
319
- cmd = is_call (stmt) ? " s " : " se "
319
+ cmd = is_call (stmt) ? :s : :se
320
320
end
321
321
try
322
- cmd == " nc " && return maybe_reset_frame! (recurse, frame, next_call! (recurse, frame, istoplevel), rootistoplevel)
323
- cmd == " n " && return maybe_reset_frame! (recurse, frame, next_line! (recurse, frame, istoplevel), rootistoplevel)
324
- cmd == " se " && return maybe_reset_frame! (recurse, frame, step_expr! (recurse, frame, istoplevel), rootistoplevel)
322
+ cmd == :nc && return maybe_reset_frame! (recurse, frame, next_call! (recurse, frame, istoplevel), rootistoplevel)
323
+ cmd == :n && return maybe_reset_frame! (recurse, frame, next_line! (recurse, frame, istoplevel), rootistoplevel)
324
+ cmd == :se && return maybe_reset_frame! (recurse, frame, step_expr! (recurse, frame, istoplevel), rootistoplevel)
325
325
326
326
enter_generated = false
327
- if cmd == " sg "
327
+ if cmd == :sg
328
328
enter_generated = true
329
- cmd = " s "
329
+ cmd = :s
330
330
end
331
- if cmd == " s "
331
+ if cmd == :s
332
332
pc = maybe_next_call! (recurse, frame, istoplevel)
333
333
(isa (pc, BreakpointRef) || pc === nothing ) && return maybe_reset_frame! (recurse, frame, pc, rootistoplevel)
334
334
stmt0 = stmt = pc_expr (frame, pc)
@@ -345,7 +345,7 @@ function debug_command(@nospecialize(recurse), frame::Frame, cmd::AbstractString
345
345
end
346
346
if isa (ret, BreakpointRef)
347
347
newframe = leaf (frame)
348
- cmd0 == " si " && return newframe, ret
348
+ cmd0 == :si && return newframe, ret
349
349
newframe = maybe_step_through_wrapper! (recurse, newframe)
350
350
return newframe, BreakpointRef (newframe. framecode, 0 )
351
351
end
@@ -354,21 +354,21 @@ function debug_command(@nospecialize(recurse), frame::Frame, cmd::AbstractString
354
354
frame. pc += 1
355
355
return frame, frame. pc
356
356
end
357
- if cmd == " c "
357
+ if cmd == :c
358
358
r = root (frame)
359
359
ret = finish_stack! (recurse, r, rootistoplevel)
360
360
return isa (ret, BreakpointRef) ? (leaf (r), ret) : nothing
361
361
end
362
- cmd == " finish" && return maybe_reset_frame! (recurse, frame, finish! (recurse, frame, istoplevel), rootistoplevel)
362
+ cmd == : finish && return maybe_reset_frame! (recurse, frame, finish! (recurse, frame, istoplevel), rootistoplevel)
363
363
catch err
364
364
frame = unwind_exception (frame, err)
365
- if cmd == " c "
366
- return debug_command (recurse, frame, " c " , istoplevel)
365
+ if cmd == :c
366
+ return debug_command (recurse, frame, :c , istoplevel)
367
367
else
368
- return debug_command (recurse, frame, " nc " , istoplevel)
368
+ return debug_command (recurse, frame, :nc , istoplevel)
369
369
end
370
370
end
371
371
throw (ArgumentError (" command $cmd not recognized" ))
372
372
end
373
- debug_command (frame:: Frame , cmd:: AbstractString , rootistoplevel:: Bool = false ) =
373
+ debug_command (frame:: Frame , cmd:: Symbol , rootistoplevel:: Bool = false ) =
374
374
debug_command (finish_and_return!, frame, cmd, rootistoplevel)
0 commit comments