This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MI: fix base members in references


 >                                                   I guess we need to first
 > commit the primary references patch and then fix c_number_of_children. Not
 > that I find references to pointers very common thing, but better be correct.

The patch below seems to fix it for me.  Its a diff on 1.63 _with_ your
yet to be committed changes.

Since we have been the only two people directly contributing to for a while now
MI, and as it would stop the patches piling up, perhaps Vladimir (if
interested) and me could now be jointly made maintainers of MI.  For the extent
of changes that we could make without prior approval, I have in mind all the
files in the mi directory plus varobj.c.  That should insulate the rest of GDB
while exposing Insight slightly.  In any case we would be conservative in our
changes, and now might be a good time to start with the next release from the
main trunk being a long way off.

WDYT?

-- 
Nick                                           http://www.inet.net.nz/~nickrob


*** /home/nickrob/src6/gdb/varobj.c~	2006-12-07 10:54:18.000000000 +1300
--- /home/nickrob/src6/gdb/varobj.c	2006-12-07 23:11:34.000000000 +1300
*************** cplus_number_of_children (struct varobj 
*** 2179,2184 ****
--- 2179,2186 ----
    if (!CPLUS_FAKE_CHILD (var))
      {
        type = get_type_deref (var);
+       if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ 	type = get_target_type (type);
  
        if (((TYPE_CODE (type)) == TYPE_CODE_STRUCT) ||
  	  ((TYPE_CODE (type)) == TYPE_CODE_UNION))
*************** cplus_number_of_children (struct varobj 
*** 2205,2210 ****
--- 2207,2214 ----
        int kids[3];
  
        type = get_type_deref (var->parent);
+       if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ 	type = get_target_type (type);
  
        cplus_class_num_children (type, kids);
        if (strcmp (var->name, "public") == 0)
*************** cplus_name_of_child (struct varobj *pare
*** 2269,2274 ****
--- 2273,2281 ----
    else
      type = get_type_deref (parent);
  
+   if (TYPE_CODE (type) == TYPE_CODE_PTR)
+     type = get_target_type (type);
+ 
    name = NULL;
    switch (TYPE_CODE (type))
      {
*************** cplus_value_of_child (struct varobj *par
*** 2404,2411 ****
    else
      type = get_type_deref (parent);
  
!   value = NULL;
  
    if (((TYPE_CODE (type)) == TYPE_CODE_STRUCT) ||
        ((TYPE_CODE (type)) == TYPE_CODE_UNION))
      {
--- 2411,2420 ----
    else
      type = get_type_deref (parent);
  
!   if (TYPE_CODE (type) == TYPE_CODE_PTR)
!     type = get_target_type (type);
  
+   value = NULL;
    if (((TYPE_CODE (type)) == TYPE_CODE_STRUCT) ||
        ((TYPE_CODE (type)) == TYPE_CODE_UNION))
      {
*************** cplus_type_of_child (struct varobj *pare
*** 2481,2486 ****
--- 2490,2498 ----
    else
      t = get_type_deref (parent);
  
+   if (TYPE_CODE (t) == TYPE_CODE_PTR)
+     t = get_target_type (t);
+ 
    type = NULL;
    switch (TYPE_CODE (t))
      {


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