Thread overview | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 24, 2010 exceptions | ||||
---|---|---|---|---|
| ||||
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 |
February 24, 2010 Re: exceptions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ellery Newcomer | 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
|
February 24, 2010 Re: exceptions | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | 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
|
February 24, 2010 Re: exceptions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ellery Newcomer |
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.
|
February 24, 2010 Re: exceptions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Keep | 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?
|
February 24, 2010 Re: exceptions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ellery Newcomer | Ellery Newcomer:
> I want line numbers
You can file a low priority bug request on this then.
Bye,
bearophile
|
February 24, 2010 Re: exceptions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ellery Newcomer | Ellery Newcomer: > I want line numbers http://d.puremagic.com/issues/show_bug.cgi?id=3851 Bye, bearophile |
February 24, 2010 Re: exceptions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ellery Newcomer | 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. |
February 24, 2010 Re: exceptions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert Clipsham | On 02/24/2010 10:35 AM, Robert Clipsham wrote:
> 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.
Thanks!
b _d_throw gives me
Function "_d_throw" not defined.
same for _d_throw_exception.
I can get a breakpoint on _d_arraycopy, but there seem to be way too many calls for it to be useful.
|
February 24, 2010 Re: exceptions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ellery Newcomer | On 24/02/10 17:51, Ellery Newcomer wrote:
>> ----
>> 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.
>
> Thanks!
>
> b _d_throw gives me
>
> Function "_d_throw" not defined.
>
> same for _d_throw_exception.
>
> I can get a breakpoint on _d_arraycopy, but there seem to be way too
> many calls for it to be useful.
Hmm, that's odd... if you type b _d_t<tab> or b _d_<tab> then you should get a list of runtime functions, do you see anything listed there that could be related? It seems odd to me that that function isn't there, it always is for me. I'm pretty sure I use a debug version of the runtime though, so that could be it. Your best option is probably to use Tango's built in stack tracing for now if you can't get gdb working properly. I've never had issues with it, but I use a custom version of gdb with the D patches applied, as well as a compiler built with debug symbols, and the runtime/other libraries built with them too in most cases.
|
Copyright © 1999-2021 by the D Language Foundation