Re: [eigen] plea for a new feature to help debugging |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] plea for a new feature to help debugging
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Fri, 4 Feb 2011 07:48:20 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=BvJpfrCTc0VziJD0z8tsGIvGL2L38TlcihhoFMla5To=; b=j5Uoidpa2Mip33+NIYJ2MDzRO7vCP7sd8suDG6vanvbNQIyTSSKYF5rXbzUJBYz99D 7PJgvivrdutu1o6BmtxlCzWuX716dhG2aviiglz+m0p7jeP3ILHtg0WaOhwQ4R4HMSDz JodcL4N3DaziKWgd3kjnWdNM9ZvDzE9quJ1IU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=ev0fFE0I2mh7iPQJNNzQyju15Dc4epEE6YQ+/bYWVvvztSzJUFfpw/hYhCSn4L/j/X pTYhcNA5l/u3aPKPSTHbc2VUA4geQeC4Py2mqFxXZKWIlenUbUb/kM4EXQGflg3yEfWZ dBhD2U3RpcG8wTWCNRuxnhsR/Hn2zW1iWFh+A=
I was going to be the same: this is the way that our asserts are meant
to be used.
Like this:
g++ myprogram.cpp -g3 -I eigen -o myprogram
$ gdb ./myprogram
> run
.....
Program received SIGABRT, "oops ! you did an out-of-range coeff access!"
> backtrace
there goes your whole backtrace, will all the local variables and
debug info you could ask for :)
Benoit
2011/2/4 Matthieu Brucher <matthieu.brucher@xxxxxxxxx>:
> Hi,
> This is correct, as macro expension occurs before the code is compiled and
> this before the function is inlined.
> Current debuggers can stop when an exception is raised/..., and in this
> case, you would have a complete traceback of what actually happened. So I
> suggest you try those tools, because there are far better than logs.
> Matthieu
>
> 2011/2/4 Helmut Jarausch <jarausch@xxxxxxxxxxxxxxxxxxx>
>>
>> Hi,
>>
>> I know all developers of Eigen are busy due to bug fixing for Eigen3.
>>
>> Still I want to start a discussion about a new feature for Eigen.
>> If an index to a matrix is out-of-range, one doesn't get any
>> information where this occurred. This is a restriction of C++
>> since it seems impossible to get the value of the __LINE__ macro at the
>> line where an inline function is expanded.
>> But it would be helpful to know the name of the matrix whose index was
>> out-of-range. To do this one needs an additional constructor parameter
>> 'Name' which is defaulted to say 'NoName'. The matrix class would have
>> an additional string variable 'ID' which can be used for the error
>> message given to the exception object.
>> Of course, this additional variable ID would be present in the
>> DEBUG case (i.e. EIGEN_NO_DEBUG is undefined), only.
>>
>> Usage:
>>
>> VectorXi T(5,"T"); // second parameter is ignored if EIGEN_NO_DEBUG
>>
>> This would be very help, esp. for beginners.
>>
>> Helmut.
>>
>>
>
>
>
> --
> Information System Engineer, Ph.D.
> Blog: http://matt.eifelle.com
> LinkedIn: http://www.linkedin.com/in/matthieubrucher
>