assembler function labeling problem
assembler function labeling problem
- Subject: assembler function labeling problem
- From: John Richetta <email@hidden>
- Date: Thu, 17 Sep 2009 16:07:30 -0700
[I believe this to be a good list for this question; if not, please
point me in the right direction, and accept my apologies for the OT
noise.]
I'm currently developing some iPhone code that stands to gain a lot
from a little VFP optimization. I've gotten the basics working, using
a separate .s file in my Xcode project, which seems to be assembling
and linking into my app fine, and I can call a simple function, do a
little work, and return. I'm running on 10.5, using GNU/Apple "as"
version 1.38.
My problem is that I'm trying to do reliable, hassle-free debugging
work with GDB, and accurate profiling with Shark, and it appears that
I can't really get the right symbol information passed to the tools (I
assume this info is placed inside the code, but maybe there are
external symbol info files used for this? I'm not up on the mechanics
of modern debugging/symbol info...). Maybe, I could get more insight
into my problem by analyzing .o or executable files with otool and nm,
but I suspect it might be the long way to solve my problem.
The issue: I have a routine that does some work, call it Test1, and
after the first few instructions, I've got a label, more code, more
labels, etc. The problem arises because while Test1 is declared
using .globl, and is correctly(?) understood to be the containing
routine for the first few instructions, once I step to (or in Shark's
case, sample) the instructions following the first local label inside
what I know is the function, the tools think that we are somewhere
else (in a different function?). This makes reading code, and
accurately profiling my routine, rather hard.
I'm not clear to what extent the the tools understand functions, but
it seems there may be some notion of this, since Xcode's display of
the code goes only from the start of the routine up to the first label
within it (it refuses to show me a disassembly of the whole routine).
Also, Shark does not seem to know about the local labels, so code
beyond the start of Test1 is at best hard to find in my profiling info
(haven't found it yet...).
I have investigated using some sort of directives to declare the
extent of my function. ".func" and ".endfunc" looked promising
(though I don't quite understand some fine points under .func) but
apparently, Apple's version of the assembler doesn't support these
(there seem to be many variations in assembler syntax, ARM instruction
names, etc. - all minimally documented in widely scattered
sources...). I also wondered if there might be a more appropriate
kind of label to use inside a function (that indicates it is "more
local," meaning interior to the function), but I have found no such
entity.
Can anyone offer me any assistance? Grateful thanks in advance, -jar
_______________________________________________
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