Bug 13018 - allow embedders to override the definition of CRASH()
Summary: allow embedders to override the definition of CRASH()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 523.x (Safari 3)
Hardware: All All
: P2 Enhancement
Assignee: Darin Fisher (:fishd, Google)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-08 17:37 PST by Darin Fisher (:fishd, Google)
Modified: 2007-03-08 19:25 PST (History)
0 users

See Also:


Attachments
patch (884 bytes, patch)
2007-03-08 17:42 PST, Darin Fisher (:fishd, Google)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Fisher (:fishd, Google) 2007-03-08 17:37:31 PST
allow embedders to override the definition of CRASH()

on some platforms, dereferencing 0xbbadbeef and writing 0 is really not the most ideal way to get attention in response to an assertion failure.

for example, __asm {int 3} is much nicer on the windows platform where JIT debugging can present the user with the option to continue past the assertion with the click of a button, and if you are already running in the debugger, the instruction will be treated like an ordinary breakpoint.  other platforms may have other preferred ways as well.
Comment 1 Darin Fisher (:fishd, Google) 2007-03-08 17:42:58 PST
Created attachment 13551 [details]
patch

simple patch to make it possible for the embedder to override the meaning of CRASH()
Comment 2 Darin Adler 2007-03-08 17:46:02 PST
Comment on attachment 13551 [details]
patch

Do you have a better implementation for any particular platform? The 0xbbadbeef thing is really sorta Mac-OS-X-specific.

r=me
Comment 3 Darin Fisher (:fishd, Google) 2007-03-08 18:29:04 PST
yes, PLATFORM(WIN_OS) should call DebugBreak() or __asm {int 3}.  the latter is good for x86-Linux too.
Comment 4 Mark Rowe (bdash) 2007-03-08 19:25:19 PST
Landed in r20079.