digitalmars.D.learn - exceptions
- Ellery Newcomer (3/3) Feb 23 2010 Okay, does anyone know a good way to figure out where something like
- bearophile (8/11) Feb 24 2010 void main() {
- Ellery Newcomer (2/13) Feb 24 2010 I want line numbers
- Daniel Keep (2/18) Feb 24 2010 You could use Tango and enable stack tracing. That or hook up a debugge...
- Ellery Newcomer (2/20) Feb 24 2010 I am using tango, how do I enable stack tracing?
- Robert Clipsham (8/31) Feb 24 2010 ----
- Ellery Newcomer (7/40) Feb 24 2010 Thanks!
-
Robert Clipsham
(10/24)
Feb 24 2010
Hmm, that's odd... if you type b _d_t
or b _d_ then you should... - Ellery Newcomer (14/43) Feb 24 2010 Oooh! nice trick!
- Robert Clipsham (5/18) Feb 24 2010 Add -L-ldl to your command line when compiling, it should be linked in
- grauzone (4/55) Feb 25 2010 By the way, that's because someone defined _d_throw to have Windows
- bearophile (4/5) Feb 24 2010 You can file a low priority bug request on this then.
- bearophile (4/5) Feb 24 2010 http://d.puremagic.com/issues/show_bug.cgi?id=3851
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
Feb 23 2010
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 copyvoid main() { auto a1 = new int[5]; auto a2 = new int[4]; a1[] = a2; } Bye, bearophile
Feb 24 2010
On 02/24/2010 03:10 AM, bearophile wrote:Ellery Newcomer:I want line numbersOkay, does anyone know a good way to figure out where something like this is coming from: object.Exception: lengths don't match for array copyvoid main() { auto a1 = new int[5]; auto a2 = new int[4]; a1[] = a2; } Bye, bearophile
Feb 24 2010
Ellery Newcomer wrote:On 02/24/2010 03:10 AM, bearophile wrote:You could use Tango and enable stack tracing. That or hook up a debugger.Ellery Newcomer:I want line numbersOkay, does anyone know a good way to figure out where something like this is coming from: object.Exception: lengths don't match for array copyvoid main() { auto a1 = new int[5]; auto a2 = new int[4]; a1[] = a2; } Bye, bearophile
Feb 24 2010
On 02/24/2010 09:00 AM, Daniel Keep wrote:Ellery Newcomer wrote:I am using tango, how do I enable stack tracing?On 02/24/2010 03:10 AM, bearophile wrote:You could use Tango and enable stack tracing. That or hook up a debugger.Ellery Newcomer:I want line numbersOkay, does anyone know a good way to figure out where something like this is coming from: object.Exception: lengths don't match for array copyvoid main() { auto a1 = new int[5]; auto a2 = new int[4]; a1[] = a2; } Bye, bearophile
Feb 24 2010
On 24/02/10 15:21, Ellery Newcomer wrote:On 02/24/2010 09:00 AM, Daniel Keep 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.Ellery Newcomer wrote:I am using tango, how do I enable stack tracing?On 02/24/2010 03:10 AM, bearophile wrote:You could use Tango and enable stack tracing. That or hook up a debugger.Ellery Newcomer:I want line numbersOkay, does anyone know a good way to figure out where something like this is coming from: object.Exception: lengths don't match for array copyvoid main() { auto a1 = new int[5]; auto a2 = new int[4]; a1[] = a2; } Bye, bearophile
Feb 24 2010
On 02/24/2010 10:35 AM, Robert Clipsham wrote:On 24/02/10 15:21, Ellery Newcomer wrote: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.On 02/24/2010 09:00 AM, Daniel Keep 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.Ellery Newcomer wrote:I am using tango, how do I enable stack tracing?On 02/24/2010 03:10 AM, bearophile wrote:You could use Tango and enable stack tracing. That or hook up a debugger.Ellery Newcomer:I want line numbersOkay, does anyone know a good way to figure out where something like this is coming from: object.Exception: lengths don't match for array copyvoid main() { auto a1 = new int[5]; auto a2 = new int[4]; a1[] = a2; } Bye, bearophile
Feb 24 2010
On 24/02/10 17:51, Ellery Newcomer wrote: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.---- 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.
Feb 24 2010
On 02/24/2010 12:37 PM, Robert Clipsham wrote:On 24/02/10 17:51, Ellery Newcomer wrote:Oooh! nice trick! Ah, it's '_d_throw 4' and quotes help. Yahoo! Do I need to do anything special to get stack tracing to work? when I try to compile a simple program it barfs on me and gives undefined reference to `dladdr' from import tango.core.tools.TraceExceptions; void main(){ int[] i = [1,2]; int[] j = new int[3]; j[] = i[]; } oh well. Thanks a ton, I'm back in business now!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.---- 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.
Feb 24 2010
On 24/02/10 20:20, Ellery Newcomer wrote:Oooh! nice trick! Ah, it's '_d_throw 4' and quotes help. Yahoo! Do I need to do anything special to get stack tracing to work? when I try to compile a simple program it barfs on me and gives undefined reference to `dladdr' from import tango.core.tools.TraceExceptions; void main(){ int[] i = [1,2]; int[] j = new int[3]; j[] = i[]; } oh well. Thanks a ton, I'm back in business now!Add -L-ldl to your command line when compiling, it should be linked in anyway, apparently it isn't though. You may have to put it before tango in your command line, maybe not... if it doesn't work, play with its position until it does.
Feb 24 2010
Ellery Newcomer wrote:On 02/24/2010 12:37 PM, Robert Clipsham wrote:By the way, that's because someone defined _d_throw to have Windows calling convention, even on Linux. I wonder what that's useful for.On 24/02/10 17:51, Ellery Newcomer wrote:Oooh! nice trick! Ah, it's '_d_throw 4' and quotes help. Yahoo!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.---- 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.Do I need to do anything special to get stack tracing to work? when I try to compile a simple program it barfs on me and gives undefined reference to `dladdr' from import tango.core.tools.TraceExceptions;You must link to libdl (-ldl).void main(){ int[] i = [1,2]; int[] j = new int[3]; j[] = i[]; } oh well. Thanks a ton, I'm back in business now!
Feb 25 2010
Ellery Newcomer:I want line numbersYou can file a low priority bug request on this then. Bye, bearophile
Feb 24 2010
Ellery Newcomer:I want line numbershttp://d.puremagic.com/issues/show_bug.cgi?id=3851 Bye, bearophile
Feb 24 2010