Keyboard replacement with stack trace

버전 1.1.0.0 (1.28 KB) 작성자: Romesh
Display a stack trace showing where keyboard was used
다운로드 수: 242
업데이트 날짜: 2013/2/20

라이선스 보기

The 'keyboard' command is great for debugging, but if you have multiple instances of keyboard, it is very difficult to tell which one is being called. This complicates debugging somewhat.

kdb() is a drop-in replacement for keyboard, and it shows a stack trace, preview of the next line to be executed, and a hyperlink to that line of code. For example, if foo() calls bar() calls baz() and we have a 'keyboard' command in baz(), the user sees

>> foo
K>>

whereas with kdb() the user sees

>> foo

baz:2 << bar:2 << foo:3
3 y = x+2;
K>>

The '3' is a hyperlink to line 3 of baz.m, and depending on settings the Matlab editor may automatically open to the appropriate kdb() statement. The only caveat is that unlike keyboard, kdb() cannot be the last statement in the function.

인용 양식

Romesh (2024). Keyboard replacement with stack trace (https://www.mathworks.com/matlabcentral/fileexchange/40415-keyboard-replacement-with-stack-trace), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2011b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Desktop에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

버전 게시됨 릴리스 정보
1.1.0.0

Updated with suggestions from Per Isakson to support packages

1.0.0.0