This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: GCC/ObjC enhancements, comments requested


>>>>> "OP" == Ovidiu Predescu <ovidiu@aracnet.com> writes:

MD>  Hey, if worse came to worst, "gcc -g" generates this knowledge.
MD> Looks to me like "objdump --debugging" reports everything that's
MD> needed.  Link in GNU BFD and load up them reflection data
MD> structures!

OP> BFD can't help us here because it gives information only on the
OP> name of the functions contained in an object file, the argument
OP> types are lost (at least for C and C++ functions, ObjC does encode
OP> the argument and return value types of each method).

Nuhhhh-uhhhhh!  Lookie:

mgd@wijiji[~] $ cat hello.c
static void
twoargs (int val, const char *msg)
{
  printf ("%d %s\n", val, msg);
}

main ()
{
  twoargs (1, "Hello World");
}

mgd@wijiji[~] $ gcc -g hello.c -o hello
mgd@wijiji[~] $ objdump --debugging hello | less
[....CHOMP....]
static void twoargs (int val /* 0x44 */, char *msg /* 0x48 */)
{ /* 0x108e8 */
  /* file /net/pele/disk12/Users/mgd/hello.c line 3 addr 0x108e8 */
  /* file /net/pele/disk12/Users/mgd/hello.c line 4 addr 0x108f4 */
  /* file /net/pele/disk12/Users/mgd/hello.c line 5 addr 0x1090c */
  /* file /net/pele/disk12/Users/mgd/hello.c line 5 addr 0x1090c */
} /* 0x10914 */
int main ()
{ /* 0x10914 */
  /* file /net/pele/disk12/Users/mgd/hello.c line 8 addr 0x10914 */
  /* file /net/pele/disk12/Users/mgd/hello.c line 9 addr 0x10918 */
  /* file /net/pele/disk12/Users/mgd/hello.c line 10 addr 0x1092c */
} /* 0x10934 */  
[....CHOMP....]


(Now requiring and loading up debugging information is probably much
to expensive a proposition, but clearly the compiler is setup to save
this stuff.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]