<html><head><base href="x-msg://438/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">OK, cool.<div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><span class="Apple-style-span" style="font-size: medium; ">On 11 Dec 2009, at 10:07, Jay K wrote:</span></div></span></span></span></span></span></span></span></span></div></span></span></div><div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; "> > We should do the same for POSIX too I think.<br> <br>Posix just calls abort.<br> <br>Posix:<br>PROCEDURE Crash () =<br> BEGIN<br> Cstdlib.abort ();<br> LOOP END; (* wait *)<br> END Crash;<br><br> <br>Win32:<br> <br><br>PROCEDURE Crash () =<br> CONST Magic = 1 * ADRSIZE (INTEGER); (* == offset of "fp" in this frame *)<br> VAR fp: ADDRESS := ADR (fp) + Magic; (* == my frame pointer *)<br> BEGIN<br> IF WinBase.IsDebuggerPresent () # 0 THEN (* I moved these three lines up. *)<span class="Apple-converted-space"> </span><br> WinBase.DebugBreak ();<br> END;<br> RTThread.SuspendOthers ();<br> RTMachInfo.DumpStack (LOOPHOLE (Crash, ADDRESS), fp);<br> RTSignal.RestoreHandlers (); (* so we really do crash... *)<br> Exit (-1);<br> END Crash;<br><br> <br>That said..I'm missing something and I should review the code.<br>Obviously there are calls elsewhere to DumpStack, and they or may not be similarly crufty.<br> <br> <br>/Actually/ one thing I'd like is for the m3core to be able to dump better callstacks.<br>Like, the ability to carry more debuginfo of its own custom format in itself.<br>Like, to get line numbers.<br> <br> <br> - Jay<br> <br><hr id="stopSpelling">From:<span class="Apple-converted-space"> </span><a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br>Date: Fri, 11 Dec 2009 10:00:35 -0500<br>To:<span class="Apple-converted-space"> </span><a href="mailto:jkrell@elego.de">jkrell@elego.de</a><br>CC:<span class="Apple-converted-space"> </span><a href="mailto:m3commit@elegosoft.com">m3commit@elegosoft.com</a><br>Subject: Re: [M3commit] CVS Update: cm3<br><br>We should do the same for POSIX too I think.<div><div><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><div style="word-wrap: break-word; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; color: rgb(0, 0, 0); word-spacing: 0px; "><div><span class="ecxApple-style-span" style="font-size: medium; "><font class="ecxApple-style-span" color="#0000ff" face="'Gill Sans'"><br></font></span></div></span></span></span></span></span></span></span></span></div></span></span></div><div><div>On 11 Dec 2009, at 12:42, Jay Krell wrote:</div><br class="ecxApple-interchange-newline"><blockquote><div>CVSROOT:<span class="ecxApple-tab-span" style="white-space: pre; "> </span>/usr/cvs<br>Changes by:<span class="ecxApple-tab-span" style="white-space: pre; "> </span>jkrell@birch.<span class="ecxApple-tab-span" style="white-space: pre; "> </span>09/12/11 12:42:57<br><br>Modified files:<br><span class="ecxApple-tab-span" style="white-space: pre; "></span>cm3/m3-libs/m3core/src/runtime/WIN32/: Tag:<span class="Apple-converted-space"> </span><br><span class="ecxApple-tab-span" style="white-space: pre; "></span> release_branch_cm3_5_8<span class="Apple-converted-space"> </span><br><span class="ecxApple-tab-span" style="white-space: pre; "></span> RTOS.m3<span class="Apple-converted-space"> </span><br><br>Log message:<br><span class="ecxApple-tab-span" style="white-space: pre; "></span>port from head: very small change that makes debugging sometimes much better<br><span class="ecxApple-tab-span" style="white-space: pre; "></span>(break right into debugger, don't waste time trying to suspend threads<br><span class="ecxApple-tab-span" style="white-space: pre; "></span>and dump stacks, the debugger does a much better job of suspending<br><span class="ecxApple-tab-span" style="white-space: pre; "></span>threads and usually (if you have symbols) of dumping stacks)<br><span class="ecxApple-tab-span" style="white-space: pre; "></span>If you aren't using a debugger, then no change.<br><span class="ecxApple-tab-span" style="white-space: pre; "></span><br><span class="ecxApple-tab-span" style="white-space: pre; "></span>The thing about RestoreHandlers can probably just be removed since<br><span class="ecxApple-tab-span" style="white-space: pre; "></span>in my brief experience the DebugBreak works fine before it.<br><span class="ecxApple-tab-span" style="white-space: pre; "></span><br><span class="ecxApple-tab-span" style="white-space: pre; "></span>Really it can probably just go like this:<br><span class="ecxApple-tab-span" style="white-space: pre; "></span>If debugger<br><span class="ecxApple-tab-span" style="white-space: pre; "></span>debugbreak<br><span class="ecxApple-tab-span" style="white-space: pre; "></span>ELSE<br><span class="ecxApple-tab-span" style="white-space: pre; "></span>suspend others, maybe<br><span class="ecxApple-tab-span" style="white-space: pre; "></span>dumpstack one of the important parts<br><span class="ecxApple-tab-span" style="white-space: pre; "></span>restore handlers probably can be removed<br><span class="ecxApple-tab-span" style="white-space: pre; "></span>Exit(-1) also important though maybe should be TerminateProcess which is much quicker/cleaner<br><span class="ecxApple-tab-span" style="white-space: pre; "></span>doesn't run all the dllmains<br><span class="ecxApple-tab-span" style="white-space: pre; "></span><br><span class="ecxApple-tab-span" style="white-space: pre; "></span>though currently I just made the small change of moving the debugbreak much earlier</div></blockquote></div></div></div></span></blockquote></div><br></div></body></html>