[GAP Forum] Reply: Help for debugging GAP
Asst. Prof. Dmitrii (Dima) Pasechnik
dima at ntu.edu.sg
Thu Oct 20 18:24:51 BST 2011
Dear Wangtao,
All what you can find is in code comments, which are often quite detailed.
You can set up tracing outputs of appropriate functions, compile code
using different compilers, and compare the resulting traces.
The 1st discrepancy will indicate where the 1st incorrect call is happening...
Best,
Dmitrii
On 20 October 2011 20:17, wangtao <wangtao2010 at ict.ac.cn> wrote:
> Dear, Prof.
> Thank you for your suggestions.
> I am afraid that I failed to describe the problem clearly last time.
> 1. Compile GAP with loongcc.
> 2. Test the GAP with Combinations([0]). The expected result is [[] [0]], but the actual result is [[] []].
> So the GAP compiled by loongcc fail on this test case.
> 3. Then I want to debug GAP to figure out which instruction make the GAP fail.
> 4. Although I am sure that EvFunccall is compiled improperly, I cannot make sure which instruction is improper. The difficulty for me is that EvFunccall is invoked so many times, I cannot make sure which one generates the error.
>
> So, I want to know the process of evaluation of the Combinations in GAP. Is there any design documents?
> Thank you again for your help.
>
> Best regards
> WangTao
>
> -----邮件原件-----
> 发件人: Asst. Prof. Dmitrii (Dima) Pasechnik [mailto:dima at ntu.edu.sg]
> 发送时间: 2011年10月19日 12:30
> 收件人: wangtao
> 抄送: forum at gap-system.org
> 主题: Re: [GAP Forum] Help for debugging GAP
>
> Dear Wangtao,
>
> On 19 October 2011 10:56, wangtao <wangtao2010 at ict.ac.cn> wrote:
>
>> I want to know some detail information of how GAP are debugging. For
>> example, the result of Combinations([0]) should be [] [0], but the result of
>> the executable GAP compiled by loongcc(the compiler we are developing) is []
>> [], thus, there is error in loongcc that generates improper instructions.
>> But I have no idea where to set the break point in GAP because I don't know
>> how Combinations([0]) is evaluated, namely, which gap function is called
>> firstly and which secondly, etc. I've read GAP user manual and find no
>> answer.
>
> You should read GAP source to find out.
> Actually, Combinations is implemented in GAP language,
> which makes it quite easy to understand.
>
> To see this, you don't even need to read the source, you can do
> gap> Print(Combinations);
> at the GAP prompt)
> When called with one argument, Combinations calls CombinationsA,
> which is also implemented in GAP language.
>
> Hope this helps,
> Dmitrii
>
>
>>
>>
>>
>> Can anybody give me some help? You can show me the call stack when gap is
>> evaluating Combinations([0]) or give me some material about how gap is
>> design.
>>
>> Thank you very much.
>>
>>
>>
>> Best regards
>>
>> Wang Tao
>>
>> ============================================================
>>
>> Wang Tao
>>
>> Compiler Team, National key laboratory of Computer Architecture
>>
>> Institute of Computing technology, Chinese Academy of Science
>>
>> Mail: Wangtao2010 at ict.ac.cn
>>
>>
>>
>> _______________________________________________
>> Forum mailing list
>> Forum at mail.gap-system.org
>> http://mail.gap-system.org/mailman/listinfo/forum
>>
>
> CONFIDENTIALITY: This email is intended solely for the person(s) named and may be confidential and/or privileged. If you are not the intended recipient, please delete it, notify us and do not copy, use, or disclose its content.
>
> Towards A Sustainable Earth: Print Only When Necessary. Thank you.
>
>
>
More information about the Forum
mailing list