Debugging a Function

Debugging a Function - How to debug a function - 消息

#1 已发布: 2020/8/17 14:37:14
Ryan Freund

Ryan Freund

20个赞,共339个帖子。

组: User

Is it possible to find an error in a function with program debugging features? Meaning - the program stops and highlights errors in red. If there is an error in a function it stops and reports the error where the function is called. Is it possible to have some sort of indicator within the function?

In my specific case I have a large function that is reporting that the number of rows and/or columns of matrices do not match. I have many matrices / variables to go thru and having a hard time spotting the culprits.

Thanks!
#2 已发布: 2020/8/17 15:58:17
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: Moderator

To display the debugger window: View> Debugger window
This shows the definitions valid in the current execution context.

To step through the sheet use the Continue and Step into buttons in the toolbar (or simply F11)

To pause on error (to inspect debug window) set: Calculation> On error> pause

You also can set breakpoints (context menu of math regions).
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
2位用户喜欢此帖子
sergio 2020/8/17 16:31:00, Ryan Freund 2020/8/18 09:15:00
#3 已发布: 2020/8/17 18:27:31
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Construct piece-wise to sanity piece-wise.
Deceptively simple !
#4 已发布: 2020/8/18 04:18:11
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Hi. I prefer the use of trace: https://smath.com/wiki/trace.ashx at some strategic points to see the procedure internal values and if they are what I expect.

Best regards.
Alvaro.
  • 有新帖
  • 无新帖