• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: x86 inline assembler to stop in debugger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: x86 inline assembler to stop in debugger


  • Subject: Re: x86 inline assembler to stop in debugger
  • From: Eric Albert <email@hidden>
  • Date: Sun, 29 Jan 2006 14:23:21 -0800

On Jan 29, 2006, at 10:19 AM, Dave McCaldon wrote:

Technical Q&A QA1361 shows how to detect if you are running under the debugger, somewhere I found a snippet of inline assembler that uses this to trap into the debugger (useful for ASSERTs etc).

#define DebugBreak() __asm__ volatile ("twnei %0,0" : : "r" (AmIBeingDebugged()))

Can anyone confirm what the x86 version of this is?  I'm guessing something along the lines of:

#define DebugBreak() if (AmIBeingDebugged()) { __asm__ volatile ("int 3"); }

It's more common to use "int3" as the instruction rather than "int $3", but either will work.

Hope this helps,
Eric
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: x86 inline assembler to stop in debugger
      • From: Dave McCaldon <email@hidden>
References: 
 >x86 inline assembler to stop in debugger (From: Dave McCaldon <email@hidden>)

  • Prev by Date: Subprojects with Makefiles
  • Next by Date: Re: Subprojects with Makefiles
  • Previous by thread: x86 inline assembler to stop in debugger
  • Next by thread: Re: x86 inline assembler to stop in debugger
  • Index(es):
    • Date
    • Thread