Re: Trying to get extended Luabind error info

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Trying to get extended Luabind error info

Arvid Norberg
On Jan 10, 2006, at 11:33, Alexander Gladysh wrote:

> Hi all!
>
> Trying to get extended Luabind error info, but lua_getstack() fails.
> Am I doing something wrong?
>
> Thanks in advance,
> Alexander.
> [...]
>
> std::string SafeDoString(lua_State * pState, const std::string &  
> buffer)
> {
>   try
>   {
>     if (luaL_loadbuffer(pState, buffer.c_str(), buffer.length(),
> buffer.c_str()))
>     {
>       return FormatError(pState, "Load buffer");
>     }
>
>     if (lua_pcall(pState, 0, 0, 0))
>     {

At this point the callstack to the place where the error occured has  
been unwound and doesn't exist anymore. It is too late to acquire the  
information.

I've updated the documentation in the luabind_rc_0_7 branch to  
include a section about how to add source and line number to error  
messages (under Error handling).

>       return FormatError(pState, "Pcall");
>     }
>
>     return std::string("(No errors)");
>   }
>   catch (luabind::error & e)
>   {
>     return FormatError(e.state(), std::string("Luabind: ") + e.what
> ());
>   }
> }
> [...]

--
Arvid Norberg




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Trying to get extended Luabind error info

Alexander Gladysh
Hi, Arvid!

Thank you very much for your help! I have a couple of notes about the
updates to the documentation:

1. I think that it worth quoting Lua manual in 'panic section' that if
Lua calls the panic handler, then "the corresponding Lua state will
not be consistent; the only safe operation with it is to close it" --
this is an important thing to mention.

2. In the 'MSVC exceptions' section you mention that catch(...)
statement would catch 'hardware exceptions, like segmentation fault'.
I believe that more correct term would be something like 'non-C++
structural exceptions' or simply 'structural exceptions'.

3. Nitpicking about 'Build Options' section: it would be more correct
to write Windows with first capital letter, and Visual Studio as two
words (and MSVC as all capitals).

With best regards,
Alexander.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Trying to get extended Luabind error info

Arvid Norberg
On Jan 11, 2006, at 12:11, Alexander Gladysh wrote:
> Hi, Arvid!

Hi Alexander.

> Thank you very much for your help! I have a couple of notes about the
> updates to the documentation:
>
> 1. I think that it worth quoting Lua manual in 'panic section' that if
> Lua calls the panic handler, then "the corresponding Lua state will
> not be consistent; the only safe operation with it is to close it" --
> this is an important thing to mention.

Sounds reasonable. This just started off as a hint though, of what  
could be wrong when non-tables were indexed.

> 2. In the 'MSVC exceptions' section you mention that catch(...)
> statement would catch 'hardware exceptions, like segmentation fault'.
> I believe that more correct term would be something like 'non-C++
> structural exceptions' or simply 'structural exceptions'.

I have a memory of it being called structural exceptions, or  
something similar too. But google didn't give me any hints that  
referred to the right thing, that's why I got a bit unsure. I will  
give it a few more shots.

> 3. Nitpicking about 'Build Options' section: it would be more correct
> to write Windows with first capital letter, and Visual Studio as two
> words (and MSVC as all capitals).

ok.

> With best regards,
> Alexander.

--
Arvid Norberg




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Trying to get extended Luabind error info

Alexander Gladysh
> > 2. In the 'MSVC exceptions' section you mention that catch(...)
> > statement would catch 'hardware exceptions, like segmentation fault'.
> > I believe that more correct term would be something like 'non-C++
> > structural exceptions' or simply 'structural exceptions'.
>
> I have a memory of it being called structural exceptions, or
> something similar too. But google didn't give me any hints that
> referred to the right thing, that's why I got a bit unsure. I will
> give it a few more shots.

See, for example, http://www.howzatt.demon.co.uk/articles/oct04.html,
section 'Interaction with normal SEH'.

Thanks,
Alexander.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user