• 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: Crash/Freeze in Xcode debugger w/infinite loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash/Freeze in Xcode debugger w/infinite loop


  • Subject: Re: Crash/Freeze in Xcode debugger w/infinite loop
  • From: Eric Albert <email@hidden>
  • Date: Mon, 24 Apr 2006 20:20:04 +0200

On Apr 23, 2006, at 12:53 PM, Trygve Inda wrote:

I was able to cause Xcode 2.2.1 to freeze with this code:

OSStatus DB_CallbackEndianFlip (OSType dataDomain, OSType dataType, short
id, void *dataPtr, UInt32 dataSize, Boolean isNative, void *refcon)
{
UInt32 count = dataSize >> 2; // number of 4-byte elements


    while (--count >= 0) ((long *)dataPtr)[count] = isNative ?
    EndianS32_NtoB (((long *)dataPtr)[count]) :
    EndianS32_BtoN (((long *)dataPtr)[count]);

    return (noErr);
}

Just a quick note here that you don't need the isNative check. Instead, I'd suggest this:


	UInt32 count = dataSize >> 2;
	long *longPtr = (long *) dataPtr;
	for(int i = 0; i < count; i++) {
		longPtr[i] = Endian32_Swap(longPtr[i]);
	}
	return noErr;

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


References: 
 >Crash/Freeze in Xcode debugger w/infinite loop (From: Trygve Inda <email@hidden>)

  • Prev by Date: Re: huge temporary files
  • Next by Date: Re: vpowf parameters backwards on Intel?
  • Previous by thread: Re: Crash/Freeze in Xcode debugger w/infinite loop
  • Next by thread: Incorporating plutil into build
  • Index(es):
    • Date
    • Thread