[M3commit] CVS Update: cm3

Jay Krell jkrell at elego.de
Sun Sep 19 16:50:29 CEST 2010


CVSROOT:	/usr/cvs
Changes by:	jkrell at birch.	10/09/19 16:50:29

Added files:
	cm3/m3-libs/m3core/src/runtime//common/: RTDebugC.c 

Log message:
	Provide RTDebug.IsDebuggerPresent and RTDebug.DebugBreak.
	
	Win32:
	RTDebug.IsDebuggerPresent => IsDebuggerPresent
	RTDebug.DebugBreak => DebugBreak
	
	Apple:
	RTDebug.IsDebuggerPresent => experimentally derived on my Intel 10.5 system.
	(could also test ppc emulation)
	sigaction(sigtrap, 0, &sa);
	peek at sa
	
	RTDebug.DebugBreak => works
	sigaction(sigtrap, 0, &old);
	signal(sigtrap, sigign);
	raise(sigtrap);
	sigaction(sigtrap, &old, 0);
	
	others:
	
	RTDebug.IsDebuggerPresent => false
	experimented on Linux and found Apple approach not viable
	RTDebug.DebugBreak => works, same as Apple
	
	smaller alternative would be definitely appreciated
	note that DebugBreak must be trivially continuable in debugger
	abort() is not it!
	
	bonus points if it is macro or builtin and small for C so the break occurs
	right in the code; on Win32 there is also __debugbreak() which
	generates one instruction right there, very nice
	(though notice that Win32 DebugBreak is "fatal" not in a debuger,
	whereas my Posix version isn't, because I can't implement
	IsDebuggerPresent)
	
	bonus points also if IsDebuggerPresent is fast, and
	updates itself as debugger is detached/reattached,
	though current version doesn't; Win32 does




More information about the M3commit mailing list