Cache for Windows (x86-64) 2016.1.1
- Log in to post comments
Cache for Windows (x86-64) 2016.1.1
sure, many times
I did this test before posting my question to see if the overloading stops the copying. It does stop and I see compiler generates code like
q ##class(A)$this.Abc()
but this way can not be seen as solution because this trick must be done for each such method in each derived class
John, because of debugging:
- you set breakpoint in A.Abc() but it never hit because cache executes B.Abc()
- because of some reason, debuger is not able to step in nether of the copies
Please check my update. Any comments?
Indeed, the documentation of ##Expression describes the behaviour and ##SafeExpression avoids the copying.
Many thanks, Eduard!
That's perfectly OK for my objective: all I need, is just a text like "location of your exception is <location>". Will <location> be A.Abc or B.Abc doesn't really matter.
I had a problem with $classname in some situations but I'll recheck it. Thank you.
That's too complicated for my needs. I export with my own tool so it would be easier to change the tool to clear breakpoints before the export
It will but with two nuances:
- ^%oddENV("callererrorinfo") must be set
- the format could be a bit cryptic, like
Location = "zrun+3^digi.test.main.1"
while my home made location will says "assertion XYZ failed in digi.test.mai.run"
BTW: can you tell what UI/api is supposes for setting values of ^%oddENV, in particular "callererrorinfo"?
here is one real example of my self backed location:
<EXCEPTION>
assertion failed: digi.chimport.debugMakeStatus: invalid param: 'acc' stack:
zthrowif+2^digi.core.AssertException.1 +1
zdebugMakeStatus+7^digi.chimport.1 +1
ztestChImport+43^digi.test.main.1 +1
%DispatchClassMethod+8^digi.test.framework.1 +1
zdoall+11^digi.test.main.1 +1
zrun+3^digi.test.main.1 +1
zDebugStub+30^%Debugger.System.1 +2
</EXCEPTION>
sorry, not sure what you mean. please elaborate
Of course if your debugger is as bad as Cache Studio's than you have to find a way to live without ![]()
After so many year with Microsoft Visual Studio the debugger is the thing I use every day. Not because my code is so bad that I have to hunt the bugs all the time. I like to step through each line of new code with debugger to ensure that it not only works well but also "smells" well (names are reasonable, log texts are reasonable etc).
In Cache I use debugger to run my unit tests using my very simple unit test framework - if a test fails, you can very quickly step it through without any zen meditations.
Many thanks for the tip about track variables option, I never knew it. Very useful. After c++ the lack of basic syntax checking drives me mad sometimes.
About (10) in your list. I would say each app must have a diagnostic log with configurable level of details. This is the way to get ideas about events/names/ids involved. Not stone-age temporary traces in the source code.
Looks interesting, thanks for sharing.
What is your problem with breakpoints? As I recall, they are just a collection property of Project object, so you shouldn't have any problems at least to clear them.
BTW: why it is important for you to have project items sorted alphabetically?
I don't like idea to set breakpoints in source code. At least because once set, you have to remember to remove it. This way is the only way for hardcore OS-level debugging but for application programming today I would prefer adequate debugger
yes, I agree, all this would be really useful to have. At least as an external Lint tool.
But I know what they answer about (6): "it is not possible because of Dynamic Dispatch".
While Dynamic Dispatch is almost never needed but <method not exist> is every day experience
From CacheQuality web site:
Pricing
We have different pricing model accordingly with your needs, starting at a rate of 4.200$
To me this is a way to expensive just to know that method or property doesn't exist. Moreover, I want to know it immediately at project compile time. An external tool could parse the code during the night and tell some complex statistics but simple things must tell compiler
The 'crash' is my post is actually incorrect. Studio never crashes, it always stops responding. So no error codes.
Now it took me about 15 minutes to reproduce the problem. I placed several breakpoints in my code and randomly clicked the stack every time debugger stopped, and at first everything worked OK. But then, without any evident reason, Studio stopped responding. Process info reports this:
| Execution Details | |||
|
| Last Global Reference: | %apiOLE("debug") |
| Routine: | %Debugger.System.1 |
| Source Location: | +415^%Debugger.System.1 |
I refreshed the page several times, the info remains the same
"I don't tend to use the call stack view"
I'm not able to comprehend that
In my world stack view is as natural as.. as... as... I don't know, there is nothing more natural as working stack view in any debugger.
The trick with LOG^%ETN is for a case when you need the stack saved to a diagnostic log. But usual case for stack view is you have your debugger stopped on a breakpoint in some library routine and want to know what path brought you here. What you do? I look at stack view and click it to navigate to a call place.
so it's not really feasible.
It is not possible to change the behaviour but I think it is possible to add some optional compiler function to give a warning when any type mismatch detected
...you can probably go without the SQL layer...
I guess you must at least use Extent query to be able iterate the objects. Or can you manage without?
I always thought Extent is the only way. If I have for example persons in the database, how can I iterate all of them?
Let's say we must iterate all Persons. Sure, by knowing its storage scheme, we can do it with Order but it's like invoking virtual function by memory offset in c++ world. The only object-oriented (i.e. without knowing too much of object internals) way I know is to use Extent. I wonder why generated class does not provide methods like GetFirst/GetLast/GetNext, this way users of the class could iterate extent in object-oriented way.
Please check my comment in the post below
I wonder why when working with objects, we still must use SQL (Extent Query) to be able iterate all instances of a class. Do you know reasons for this design?
Very same as with raw Order: user opens a list, you give him first 100 objects and when he presses Next page, you continue from index 101
Check this "Using Caché Objects ▶ Introduction to Persistent Objects ▶ Extent Queries"
https://community.intersystems.com/product-documentation/using-cach%C3%…
I just mean that if I have simple task to show 1000 records split into 10 pages, with "raw" globals I can do it simple with $order but with objects there is nothing similar to $Order so I have to use SQL
The idea is extremely simple: each class includes auto-generated query 'select ID from classname' that returns ids of all existing objects of this class
Cache for Windows (x86-64) 2016.1