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


On 08/05/2010 06:57 PM, Ulrich Weigand wrote:
sami wagiaalla wrote:

	* infcall.c (call_function_by_hand): Set VALUE_LVAL of the
	returned value to lval_memory.


@@ -1026,6 +1026,7 @@ When the function is done executing, GDB will silently stop."),
  	    retval = allocate_value (values_type);
  	    gdbarch_return_value (gdbarch, value_type (function), values_type,
  				  retbuf, value_contents_raw (retval), NULL);
+	    VALUE_LVAL (retval) = lval_memory;
  	    break;

This part looks broken. Setting VALUE_LVAL to lval_memory implies the value actually *has* location information pointing to memory, that is in particular, a memory address.

Since this value doesn't have that information, and in general it may
not even exist (function return values may be passed in registers), I
don't see how this can be valid here.


Hmm I see. I was under the impression that here the value is copied from the inferior's return location to gdb memory. As the patch stands (with the kfail) this can be removed, but I am actually looking for guidance on how to ensure that this value is available for gdb to perform further function calls that utilize it, especially when the return value is a copy not a reference. As is described in this bug: http://sourceware.org/bugzilla/show_bug.cgi?id=11606



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