Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Question about ZSHOW "S" vs $STACK() ??bug??

41 views
Skip to first unread message

Kevin Toppenberg

unread,
Jan 12, 2025, 8:23:07 PMJan 12
to Everything MUMPS

In my debugger, I have a way to display the stack.  But I am finding that there is more than one way, and sometimes they are not in sync.

For example, if I do ZSHOW "S":ZZ and then cycle through ZZ to get the information, I currently get this:
zz
}~S
 }~1 = "        Indirection"
 }~2 = HndlMCode+16^TMGIDE2C
 }~3 = HndlMCode+12^TMGIDE2C
 }~4 = CMDPROMPT+40^TMGIDE2A
 }~5 = CMDPROMPT+8^TMGIDE2A
 }~6 = SP1+5^TMGIDE2
 }~7 = main^TMGTEST
 }~8 = "        Indirection"
 }~9 = PL2+46^TMGIDE
 }~10 = PL2+43^TMGIDE
 }~11 = M2+7^TMGIDE
 }~12 = "+1^GTM$DMOD    (Direct mode) "

This view has the most recent code at position #1.  #7 is where I pause in the debugger just after starting main^TMGTESET.  Entries 1-6 are from inside my debugger.

But if I loop through entries in $STACK() using this code
  . NEW % FOR %=0:1:$STACK DO
  . . W (%+1),".  ",$STACK(%)," -- ",$STACK(%,"PLACE"),": ",$STACK(%,"MCODE"),"  ",$STACK(%,"ECODE"),!

I get this.  This view has most recent code at highest number, those sometimes the end of the list has empty entries. 

1.  -dir -- +1^GTM$DMOD:
2.  DO -- M2+7^TMGIDE:   DO PROMPTLAUNCH("AllInOne")  ;"<--- this is where debugged program is run.
3.  DO -- PL2+43^TMGIDE:   DO
4.  DO -- PL2+46^TMGIDE:   . XECUTE tmgDbgLine         ;"<---- this launches the users mumps command
5.  XECUTE -- @: DO T4^TMGTEST
6.  DO -- T4+1^TMGTEST:   SET A=1/0  ,M9,Z150373210,
7.   -- :
8.   -- :
9.   -- :
10.   -- :
11.   -- :
----- Press Key To Continue -----

Notice that entry #5 is NOT the code I am currently running.  It was from a former test.  I have completed that test, returned to direct mode, and even typed ZGOTO, which I thought reset the stack etc before running more code.  I even entered KILL from the direct mode ydb prompt to clear the variable table.  I then went back into the debugger, lanched main^TMGTEST, but STILL the $STACK() shows do T4^TMGTEST.

Why is $STACK() not synchronized with ZSHOW "S" ??

Thanks
Kevin

Sam Habiel

unread,
Jan 13, 2025, 9:54:54 AMJan 13
to Kevin Toppenberg, Everything MUMPS
Kevin,

Did you check what your $Stack(-1) as well?

Can you create an issue in Gitlab with a standalone test case (that means it runs alone, and does not need VistA)? https://gitlab.com/YottaDB/DB/YDB/-/issues.

--Sam

--
You received this message because you are subscribed to the Google Groups "Everything MUMPS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to everythingmum...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/everythingmumps/0897909d-9136-41b3-9173-0957195d8a9dn%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Toppenberg

unread,
Jan 13, 2025, 6:33:53 PMJan 13
to Everything MUMPS
I'll see if I can come up with a stand alone test. 

I didn't check -1.  What does that do?

KT

Kevin Toppenberg

unread,
Jan 13, 2025, 8:06:25 PMJan 13
to Everything MUMPS
I just submitted an issue here: https://gitlab.com/YottaDB/DB/YDB/-/issues/1121
I tried -1, and it doesn't return anything.

Kevin

Kevin Toppenberg

unread,
Jan 14, 2025, 12:33:54 PMJan 14
to Everything MUMPS
Turns out that I just didn't understand how the system works.  If $ECODE is not set to "", then the stack is somehow maintained. 
Issue resolved

KT

David Wicksell

unread,
Jan 19, 2025, 7:40:52 PMJan 19
to Everything MUMPS
That's correct behavior. If you don't reset the error state by setting $ECODE to the empty string, then the
process-stack maintains the error frames so that you can debug after the fact.

David Wicksell
Fourth Watch Software LC

Kevin Toppenberg

unread,
Jan 19, 2025, 8:08:09 PMJan 19
to Everything MUMPS
Thanks David,

Kevin
Reply all
Reply to author
Forward
0 new messages