Re: [PATCH] Objective-C language support.

Michael Snyder
2002-10-09T00:01:31Z

Adam Fedor wrote:
>
> This patch adds Objective-C language support to gdb based upon a patch
> provided by Apple Computer Inc from their version of gdb. Note that the
> patch only contains changes to existing files. New files (objc-lang.h,
> objc-lang.c, objc-exp.y) and a gdb.objc testsuite directory are located at
>
> ftp://ftp.gnustep.org/pub/gnustep/contrib/gdb-objc-patch.tar.gz
>

Jim, could you take a quick look at this small change?
[Adam, the comment needs a period followed by two spaces.]

> * elfread.c (elf_symtab_read): Skip ObjC symbols.

> Index: gdb/elfread.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/elfread.c,v
> retrieving revision 1.23
> diff -u -p -r1.23 elfread.c
> --- gdb/elfread.c 24 Jul 2002 23:51:35 -0000 1.23
> +++ gdb/elfread.c 17 Sep 2002 19:29:59 -0000
> @@ -349,7 +349,12 @@ elf_symtab_read (struct objfile *objfile
> }
> else if (sym->section->flags & SEC_CODE)
> {
> - if (sym->flags & BSF_GLOBAL)
> + if (sym->name[0] == '.' && (strncmp (sym->name + 1, "objc_", 4) == 0))
> + {
> + /* Looks like an Objective-C special symbol */
> + continue;
> + }
> + else if (sym->flags & BSF_GLOBAL)
> {
> ms_type = mst_text;
> }