]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2004-02-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
authorJim Blandy <jimb@codesourcery.com>
Wed, 18 Feb 2004 04:22:35 +0000 (04:22 +0000)
committerJim Blandy <jimb@codesourcery.com>
Wed, 18 Feb 2004 04:22:35 +0000 (04:22 +0000)
Committed by Jim Blandy  <jimb@redhat.com>.

* eval.c (evaluate_subexp_standard, case OP_OBJC_MSGCALL): Use
CORE_ADDR as type for selectors.  Correct types for GNU run time
message lookup function to use double indirection.
* objc-lang.c (lookup_child_selector): Use CORE_ADDR as return type.
* objc-lang.h (lookup_child_selector): Adapt prototype.

gdb/ChangeLog
gdb/eval.c
gdb/objc-lang.c
gdb/objc-lang.h

index aef385d7adf23fdf53bd9d543a616a21dfb13883..df32cf3ee366053d9335f571c808cd33856d08ad 100644 (file)
@@ -2,6 +2,12 @@
 
        Committed by Jim Blandy  <jimb@redhat.com>.
 
+       * eval.c (evaluate_subexp_standard, case OP_OBJC_MSGCALL): Use 
+       CORE_ADDR as type for selectors.  Correct types for GNU run time
+       message lookup function to use double indirection.
+       * objc-lang.c (lookup_child_selector): Use CORE_ADDR as return type.
+       * objc-lang.h (lookup_child_selector): Adapt prototype.
+
        * s390-nat.c (SUBOFF): New macro.
        (supply_gregset, fill_gregset): Use it to handle debugging
        of 32-bit exectuables running under a 64-bit kernel.
index 95a2e4a3f8ef42922d8194d9daef623c1ac2c72f..452aeb7f243f2411563dd3ce339889b71d7a7a60 100644 (file)
@@ -697,10 +697,10 @@ evaluate_subexp_standard (struct type *expect_type,
     case OP_OBJC_MSGCALL:
       {                                /* Objective C message (method) call.  */
 
-       static unsigned long responds_selector = 0;
-       static unsigned long method_selector = 0;
+       static CORE_ADDR responds_selector = 0;
+       static CORE_ADDR method_selector = 0;
 
-       unsigned long selector = 0;
+       CORE_ADDR selector = 0;
 
        int using_gcc = 0;
        int struct_return = 0;
@@ -750,8 +750,19 @@ evaluate_subexp_standard (struct type *expect_type,
           only).  */
        if (gnu_runtime)
          {
+           struct type *type;
+           type = lookup_pointer_type (builtin_type_void);
+           type = lookup_function_type (type);
+           type = lookup_pointer_type (type);
+           type = lookup_function_type (type);
+           type = lookup_pointer_type (type);
+
            msg_send = find_function_in_inferior ("objc_msg_lookup");
            msg_send_stret = find_function_in_inferior ("objc_msg_lookup");
+
+           msg_send = value_from_pointer (type, value_as_address (msg_send));
+           msg_send_stret = value_from_pointer (type, 
+                                       value_as_address (msg_send_stret));
          }
        else
          {
@@ -936,14 +947,13 @@ evaluate_subexp_standard (struct type *expect_type,
 
        if (gnu_runtime && (method != NULL))
          {
-           ret = call_function_by_hand (argvec[0], nargs + 2, argvec + 1);
            /* Function objc_msg_lookup returns a pointer.  */
-           argvec[0] = ret;
-           ret = call_function_by_hand (argvec[0], nargs + 2, argvec + 1);
+           VALUE_TYPE (argvec[0]) = lookup_function_type 
+                           (lookup_pointer_type (VALUE_TYPE (argvec[0])));
+           argvec[0] = call_function_by_hand (argvec[0], nargs + 2, argvec + 1);
          }
-       else
-         ret = call_function_by_hand (argvec[0], nargs + 2, argvec + 1);
 
+       ret = call_function_by_hand (argvec[0], nargs + 2, argvec + 1);
        return ret;
       }
       break;
index cc933db5e0fedede7f82afd8ebbe7b16a7bf8b63..5c184f35d7a15f7a9fcc89e283ae78c636f3564b 100644 (file)
@@ -133,7 +133,7 @@ lookup_objc_class (char *classname)
                                                           1, &classval));
 }
 
-int
+CORE_ADDR
 lookup_child_selector (char *selname)
 {
   struct value * function, *selstring;
@@ -754,7 +754,7 @@ end_msglist(void)
   int val = msglist_len;
   struct selname *sel = selname_chain;
   char *p = msglist_sel;
-  int selid;
+  CORE_ADDR selid;
 
   selname_chain = sel->next;
   msglist_len = sel->msglist_len;
index c88a0f7a5fa3cb8aa5bdd9b05b541ce1cc71f162..5a11c5dbf165dcc818c6cc2123cfcbe7e76e3fb4 100644 (file)
@@ -39,7 +39,7 @@ extern int c_value_print (struct value *, struct ui_file *,
                          int, enum val_prettyprint);
 
 extern CORE_ADDR lookup_objc_class     (char *classname);
-extern int       lookup_child_selector (char *methodname);
+extern CORE_ADDR lookup_child_selector (char *methodname);
 
 extern char *objc_demangle (const char *mangled, int options);