(expr)
| 238 | |
| 239 | // Evaluate @expr in the current frame, logging and suppressing any exceptions |
| 240 | function evalInFrame(expr) { |
| 241 | if (!focusedFrame) { |
| 242 | print('No stack'); |
| 243 | return; |
| 244 | } |
| 245 | |
| 246 | skipUnwindHandler = true; |
| 247 | let cv; |
| 248 | try { |
| 249 | cv = saveExcursion( |
| 250 | () => focusedFrame.evalWithBindings(`(${expr})`, debuggeeValues)); |
| 251 | } finally { |
| 252 | skipUnwindHandler = false; |
| 253 | } |
| 254 | |
| 255 | if (cv === null) { |
| 256 | print(`Debuggee died while evaluating ${expr}`); |
| 257 | return; |
| 258 | } |
| 259 | |
| 260 | const {throw: exc, return: dv} = cv; |
| 261 | if (exc) { |
| 262 | print(`Exception caught while evaluating ${expr}: ${dvToString(exc)}`); |
| 263 | return; |
| 264 | } |
| 265 | |
| 266 | return {value: dv}; |
| 267 | } |
| 268 | |
| 269 | // Accept debugger commands starting with '#' so that scripting the debugger |
| 270 | // can be annotated |
no test coverage detected