diff options
author | Adam Fedor <fedor@gnu.org> | 2002-11-19 03:36:44 +0000 |
---|---|---|
committer | Adam Fedor <fedor@gnu.org> | 2002-11-19 03:36:44 +0000 |
commit | 82eeeb9451dceed04a4d10f701097d1b92e223e2 (patch) | |
tree | dbb622c69e4e9ba95f318762c1dfaa7346f23c23 | |
parent | 646df18d28ce1f24671f22c3a4393b50c1ceb273 (diff) | |
download | gdb-82eeeb9451dceed04a4d10f701097d1b92e223e2.zip gdb-82eeeb9451dceed04a4d10f701097d1b92e223e2.tar.gz gdb-82eeeb9451dceed04a4d10f701097d1b92e223e2.tar.bz2 |
* expprint.c (print_subexp): Handle OP_OBJC_NSSTRING,
OP_OBJC_MSGCALL, and OP_OBJC_SELF.
(op_name): Handle OP_OBJC_SELF.
* Makefile.in (expprint.o): Add additional depends.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/Makefile.in | 2 | ||||
-rw-r--r-- | gdb/expprint.c | 56 |
3 files changed, 64 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a46a373..20277ed 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2002-11-18 Adam Fedor <fedor@gnu.org> + * expprint.c (print_subexp): Handle OP_OBJC_NSSTRING, + OP_OBJC_MSGCALL, and OP_OBJC_SELF. + (op_name): Handle OP_OBJC_SELF. + * Makefile.in (expprint.o): Add additional depends. + +2002-11-18 Adam Fedor <fedor@gnu.org> + * expression.h: Rename ObjC ops to OP_OBJC_MSGCALL, OP_OBJC_SELECTOR, OP_OBJC_NSSTRING, and OP_OBJC_SELF. * parse.c (length_of_subexp, prefixify_subexp): Likewise. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 08a0ee2..6183833 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1665,7 +1665,7 @@ exec.o: exec.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcmd_h) \ $(language_h) $(symfile_h) $(objfiles_h) $(completer_h) $(value_h) \ $(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) $(xcoffsolib_h) expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ - $(value_h) $(language_h) $(parser_defs_h) + $(value_h) $(language_h) $(parser_defs_h) $(target_h) $(gdb_string_h) f-lang.o: f-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(expression_h) $(parser_defs_h) $(language_h) $(f_lang_h) \ $(valprint_h) diff --git a/gdb/expprint.c b/gdb/expprint.c index aa8b876..ed9d50d 100644 --- a/gdb/expprint.c +++ b/gdb/expprint.c @@ -27,6 +27,8 @@ #include "language.h" #include "parser-defs.h" #include "frame.h" /* For frame_map_regnum_to_name. */ +#include "target.h" +#include "gdb_string.h" #ifdef HAVE_CTYPE_H #include <ctype.h> @@ -177,6 +179,51 @@ print_subexp (register struct expression *exp, register int *pos, fprintf_unfiltered (stream, "B'<unimplemented>'"); return; + case OP_OBJC_NSSTRING: /* Objective-C Foundation Class NSString constant. */ + nargs = longest_to_int (exp->elts[pc + 1].longconst); + (*pos) += 3 + BYTES_TO_EXP_ELEM (nargs + 1); + fputs_filtered ("@\"", stream); + LA_PRINT_STRING (stream, &exp->elts[pc + 2].string, nargs, 1, 0); + fputs_filtered ("\"", stream); + return; + + case OP_OBJC_MSGCALL: + { /* Objective C message (method) call. */ + char *selector; + (*pos) += 3; + nargs = longest_to_int (exp->elts[pc + 2].longconst); + fprintf_unfiltered (stream, "["); + print_subexp (exp, pos, stream, PREC_SUFFIX); + if (0 == target_read_string (exp->elts[pc + 1].longconst, + &selector, 1024, NULL)) + { + error ("bad selector"); + return; + } + if (nargs) + { + char *s, *nextS; + s = alloca (strlen (selector) + 1); + strcpy (s, selector); + for (tem = 0; tem < nargs; tem++) + { + nextS = strchr (s, ':'); + *nextS = '\0'; + fprintf_unfiltered (stream, " %s: ", s); + s = nextS + 1; + print_subexp (exp, pos, stream, PREC_ABOVE_COMMA); + } + } + else + { + fprintf_unfiltered (stream, " %s", selector); + } + fprintf_unfiltered (stream, "]"); + /* "selector" was malloc'd by target_read_string. Free it. */ + free (selector); + return; + } + case OP_ARRAY: (*pos) += 3; nargs = longest_to_int (exp->elts[pc + 2].longconst); @@ -391,6 +438,13 @@ print_subexp (register struct expression *exp, register int *pos, fputs_filtered ("this", stream); return; + /* Objective-C ops */ + + case OP_OBJC_SELF: + ++(*pos); + fputs_filtered ("self", stream); /* The ObjC equivalent of "this". */ + return; + /* Modula-2 ops */ case MULTI_SUBSCRIPT: @@ -684,6 +738,8 @@ op_name (int opcode) return "STRUCTOP_PTR"; case OP_THIS: return "OP_THIS"; + case OP_OBJC_SELF: + return "OP_OBJC_SELF"; case OP_SCOPE: return "OP_SCOPE"; case OP_TYPE: |