exceptions

Robert Clipsham robert at octarineparrot.com
Wed Feb 24 08:35:58 PST 2010


On 24/02/10 15:21, Ellery Newcomer wrote:
> On 02/24/2010 09:00 AM, Daniel Keep wrote:
>>
>>
>> Ellery Newcomer wrote:
>>> On 02/24/2010 03:10 AM, bearophile wrote:
>>>> Ellery Newcomer:
>>>>> Okay, does anyone know a good way to figure out where something like
>>>>> this is coming from:
>>>>> object.Exception: lengths don't match for array copy
>>>>
>>>> void main() {
>>>> auto a1 = new int[5];
>>>> auto a2 = new int[4];
>>>> a1[] = a2;
>>>> }
>>>>
>>>> Bye,
>>>> bearophile
>>>
>>> I want line numbers
>>
>> You could use Tango and enable stack tracing. That or hook up a debugger.
>
> I am using tango, how do I enable stack tracing?

----
import tango.core.tools.TraceExceptions;
----

If you want to use gdb then type 'b _d_throw_exception' (or 'b _d_throw' 
for dmd) before you run your app. This will break on every exception 
thrown, so you may have to hit 'c' a few times to continue at each 
thrown exception until you find the one you need.


More information about the Digitalmars-d-learn mailing list