• 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: Debugging assembly language code on iOS with Xcode 3
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging assembly language code on iOS with Xcode 3


  • Subject: Re: Debugging assembly language code on iOS with Xcode 3
  • From: Tom Seddon <email@hidden>
  • Date: Mon, 25 Apr 2011 00:31:15 +0100

On 19 Apr 2011, at 01:30, Wim Lewis wrote:

>
> On 18 Apr 2011, at 5:06 PM, Tom Seddon wrote:
>> My issue is that I'm having difficulty using Xcode 3.2.6 to debug ARM code running on the device, when the code is defined in its own .s file. The C code correctly calls the routine, and the correct result is obtained, but the debugger can't seem to work with it.
> Hmm. Maybe the ARM version of gdb is more sensitive to the lack of debugging information than the x86 version? You could try getting an assembly file for a function using cc -S (and maybe -fverbose-asm), in addition to the flags Xcode was using, to get an assembly file that generates the same debug info the C file would have; this should hopefully act the same as the original C file and be debuggable. Then strip things out of the assembly file until it stops working.

Good suggestion!

Having scraped through the fearsome `gcc -S' output, the least difficult solution seems to be to use a `.file' directive to name the file for debug info purposes, followed by a `.loc' directive before every instruction to assign debug info to it. Well, I say "least difficult", but this is obviously error-prone - so I just gave up and have been using intrinsics instead.

To be honest, using intrinsics doesn't work particularly well either. Debugging the result is just about possible, though, even after rearranging the code to make it run nicely in an unoptimised build.

--Tom

P.S. I tried using gcc's asm syntax, but the debugger just treats the whole asm block as a single statement and steps it as such. What with Xcode 4 not even having a disassembly window, and Xcode 3 not being so great either, the outlook for assembly language coding looks a bit grim!
 _______________________________________________
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: Debugging assembly language code on iOS with Xcode 3
      • From: Chris Cleeland <email@hidden>
References: 
 >Debugging assembly language code on iOS with Xcode 3 (From: Tom Seddon <email@hidden>)
 >Re: Debugging assembly language code on iOS with Xcode 3 (From: Wim Lewis <email@hidden>)

  • Prev by Date: Re: iOS Pick from a list
  • Next by Date: Re: Debugging assembly language code on iOS with Xcode 3
  • Previous by thread: Re: Debugging assembly language code on iOS with Xcode 3
  • Next by thread: Re: Debugging assembly language code on iOS with Xcode 3
  • Index(es):
    • Date
    • Thread