Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Debug mode in Mata


From   "Sergiy Radyakin" <[email protected]>
To   [email protected]
Subject   Re: st: Debug mode in Mata
Date   Mon, 12 Jan 2009 17:20:44 -0500

Dear Tim,

AFAIK matadebug is undocumented. From what I understand it makes Mata
more verbose as to what it is doing. E.g.

net install use10.pkg, from(http://fmwww.bc.edu/RePEc/bocode/u)
set matadebug off
mata des10()
                 des10():  3001  expected 1 arguments but received 0
                 <istmt>:     -  function returned error
r(3001);

set matadebug on
mata des10()

execution begins..
                 des10():  3001  expected 1 arguments but received 0 {3}
                 <istmt>:     -  function returned error {14}
r(3001);

Note the "execution begins.." message and numbers in {} brackets in
the second run, when matadebug is on. I hope these are somehow related
either to the source code of the respective function (e.g. line
numbers) or to the compiled file (e.g. offset of the failed command).

Perhaps the Stata developers could tell us more.
(I have also long wished to have Stata report the filename and line
number of the command that failed in the error message (for .do/.ado
files))

Best regards, Sergiy Radyakin






On Mon, Jan 12, 2009 at 5:48 AM, Mak, Timothy
<[email protected]> wrote:
> Hi Sergiy,
>
> Would it be possible to give more information as to how -set metadebug on- works?
>
> I tried to introduce some faults to my program and see how the above helps me find it, but I didn't notice any difference. In any case, I'm hoping for a (virtual?) engine that runs Mata line by line for debug purposes, if you see what I mean... I hear this sort of thing is available to help people debug their C programs (or maybe C++?), for example... (I'm no computing language person so forgive me for not being clear...)
>
> Thanks,
>
> Tim
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of Sergiy Radyakin
> Sent: 09 January 2009 20:21
> To: [email protected]
> Subject: Re: st: Debug mode in Mata
>
> It is already there, but hidden from users:
>   set matadebug on
>
> Or what kind of debug do you mean?
>
> Regards, Sergiy Radyakin
>
> On Fri, Jan 9, 2009 at 2:19 PM, Mak, Timothy
> <[email protected]> wrote:
>> Hi,
>>
>> Is it just me who finds that debugging in Mata is a real pain, which
>> renders Stata somewhat more difficult to program than R?
>>
>> Is there plan to introduce a debug mode for Mata programming?
>>
>> Tim
>>
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/statalist/faq
>> *   http://www.ats.ucla.edu/stat/stata/
>>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index