www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - corrupt stack? gdb bt

reply Ant <duitoolkit yahoo.ca> writes:
I created my assert to allow gdb to display the stack trace.
but now I got another problem.
Is this something I don't know?

Ant

###########################
// replace the phobos assert
extern (C) void _d_assert(char[] filename, uint line)
{
	printf("(dool) Assert failure '%.*s' (%d)\n\n", filename, line);
	//Object o; o.sizeof;
}
#################
(dool) Assert failure 'String' (1637)


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210424384 (LWP 2685)]
0x0806f234 in _vtbl_4dool6String6String ()
(gdb) bt
#0  0x0806f234 in _vtbl_4dool6String6String ()
#1  0x00000008 in ?? ()
#2  0x00000665 in ?? ()
#3  0xbffff76c in ?? ()
#4  0x0805aafa in _D4dool6String6String7opSliceFiiZC4dool6String6String ()
Previous frame inner to this frame (corrupt stack?)
Apr 22 2005
parent reply Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ant schrieb am Sat, 23 Apr 2005 00:33:39 -0400:
 I created my assert to allow gdb to display the stack trace.
 but now I got another problem.
 Is this something I don't know?

 Ant

 ###########################
 // replace the phobos assert
 extern (C) void _d_assert(char[] filename, uint line)
 {
 	printf("(dool) Assert failure '%.*s' (%d)\n\n", filename, line);
 	//Object o; o.sizeof;
 }
 #################
 (dool) Assert failure 'String' (1637)

I don't know why but you have to throw at the end of _d_assert. Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCbyaq3w+/yD4P9tIRAqBCAJ9p+bfFKww3rEGvF/rxjK3kD+G0yACfYpwC YzoJ7aeKKXMrKGGHf+cLcGs= =lddF -----END PGP SIGNATURE-----
Apr 26 2005
parent Ant <Ant_member pathlink.com> writes:
In article <ael3k2-oq3.ln1 lnews.kuehne.cn>, Thomas Kuehne says...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ant schrieb am Sat, 23 Apr 2005 00:33:39 -0400:
 I created my assert to allow gdb to display the stack trace.
 but now I got another problem.
 Is this something I don't know?

 Ant

 ###########################
 // replace the phobos assert
 extern (C) void _d_assert(char[] filename, uint line)
 {
 	printf("(dool) Assert failure '%.*s' (%d)\n\n", filename, line);
 	//Object o; o.sizeof;
 }
 #################
 (dool) Assert failure 'String' (1637)

I don't know why but you have to throw at the end of _d_assert.

thank you! I'll try that. here si the tech tips page snippet: " Provide a custom implementation of: extern (C) void _d_assert(char[] filename, uint line); to do the logging. _d_assert is the function called when an assert trips. By providing your own, it prevents the Phobos library version from being linked in. " Should it contain that information? Ant
Apr 27 2005