从geant获取堆栈跟踪 [英] Getting stack trace from geant
问题描述
I'm trying to compile a project (see this SO question) using Gobo compiler and its tools and I'm getting error messages refering to standard library equal(..)
. I'm sure that error is somewhere in the code I have and not in standard library but I don't know how to get some more info from geant
. I'd like to know which class, function, line of code from my code invoked equal(..)
or any other standard library function which might call it. And yes, I've already tried going through all equal(..)
s in my code.
我收到的错误消息是这样的:
Error messages I get are like this:
[CATCALL]类SQL_GENERATOR_TSQL65(ANY,95,8):实际参数#1的类型'STRING_8'与类'UC_STRING'中的功能'is_equal'中的形式参数的类型'UC_STRING'不符
[CATCALL] class SQL_GENERATOR_TSQL65 (ANY,95,8): type 'STRING_8' of actual argument #1 does not conform to type 'UC_STRING' of formal argument in feature `is_equal' in class 'UC_STRING'
这指向library\free_elks\src\elks\kernel\any.e
:
frozen equal (a: detachable ANY; b: like a): BOOLEAN
-- Are `a' and `b' either both void or attached
-- to objects considered equal?
do
if a = Void then
Result := b = Void
else
Result := b /= Void and then
a.is_equal (b) -- <<<<<<< THIS LINE
end
ensure
definition: Result = (a = Void and b = Void) or else
((a /= Void and b /= Void) and then
a.is_equal (b))
end
推荐答案
报告的CAT调用是系统错误(与类错误相对),即是整个系统分析的结果.类UC_STRING
重新定义了功能is_equal
.结果,它只能与UC_STRING
类型的参数(或其后代)一起使用.
Reported CAT-calls are system errors (as opposed to class errors), i.e. appear as a result of the whole system analysis. The class UC_STRING
redefines the feature is_equal
. As a result it can be used only with arguments of type UC_STRING
(or its descendants).
某些代码将UC_STRING
视为STRING_8
(UC_STRING
继承自STRING_8
).一旦将UC_STRING
附加到类型为STRING_8
的实体,该代码就有获得CAT调用的风险.这是一个示例:
Some code treats UC_STRING
as STRING_8
(UC_STRING
inherits from STRING_8
). As soon as UC_STRING
is attached to an entity of type STRING_8
, the code is at risk of getting the CAT-call. Here is an example:
s: STRING_8
t: STRING_8
u: UC_STRING
...
s := u
if equal (s, t) then ...
您提到的equal
的代码在UC_STRING
的实例上调用is_equal
,但是接收STRING_8
作为参数.但是,UC_STRING
中的is_equal
版本只能将UC_STRING
作为参数,而不能处理STRING_8
.这就是为什么您会收到错误消息.
The code of equal
that you mention calls is_equal
on an instance of UC_STRING
, but receives STRING_8
as an argument. However, the version of is_equal
in UC_STRING
can handle only UC_STRING
as an argument, not STRING_8
. That's why you get the error.
问题可以通过
- 在
UC_STRING
中更改is_equal
的参数类型以接受STRING_8
- 将
UC_STRING
的所有重新连接删除到STRING_8
- 禁用CAT调用错误
- changing the argument type of
is_equal
inUC_STRING
to acceptSTRING_8
- removing all reattachments of
UC_STRING
toSTRING_8
- disabling the CAT-call errors
在您的情况下,最后一个似乎是最好的.
The last one seems to be the best in your case.
这篇关于从geant获取堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!