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: [patch] smart pointer support


>>>>> "Sami" == sami wagiaalla <swagiaal@redhat.com> writes:

Sami> Great!.. Thanks for the pointers. I am not going to be working on that
Sami> bug right away, but I will add a pointer to this discussion in case
Sami> someone else picks it up by the time I get to it.

Thanks.

This is looking good.

Sami> +	      if (exp->language_defn->la_language == language_cplus)
Sami> +		{
Sami> +		  while (unop_user_defined_p(op, arg2))

Space before paren.

Also, I don't think the language_cplus check should be needed.
None of the other calls to unop_user_defined_p are gated that way.

Sami> +		      struct value *value = value_x_unop (arg2, op, noside);
Sami> +		      if (value)
Sami> +			arg2 = value;

This seems strange.  When can the result here be NULL?  And what does
that mean?  It seems like this either ought to be impossible, or it
should be an error of some kind.

Sami> +      if (exp->language_defn->la_language == language_cplus)
Sami> +	{
Sami> +	  while ((unop_user_defined_p(op, arg1)))
Sami> +	    {
Sami> +	      struct value *value = value_x_unop (arg1, op, noside);
Sami> +	      if (value)
Sami> +		arg1 = value;

Same notes as above :)

Sami> +++ b/gdb/testsuite/gdb.cp/smartp.cc

We haven't been super diligent about this -- but please put a GPL header
on this file.

Sami> +if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
Sami> +    untested "Couldn't compile test program"
Sami> +    return -1
Sami> +}
Sami> +
Sami> +# Get things started.
Sami> +
Sami> +gdb_exit
Sami> +gdb_start
Sami> +gdb_reinitialize_dir $srcdir/$subdir
Sami> +gdb_load ${binfile}

I think prepare_for_testing can be used here.

Tom


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