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


Tom Tromey wrote:

> Along these lines, I'm curious to know why value_must_coerce_to_target
> returns 0 for TYPE_CODE_STRUCT.  Maybe that is just an oversight?
> Perhaps it should also check for lval_internalvar_component?

Well, I guess this is because the value-coerce-to-target mechanism was
introduced by Dan for a specific purpose, that is to allow lazy handling
of GDB-internally generated literal values (in particular string constants).

It was never intended to handle pushing arbitrary non-lvalues, like those
generated from inferior calls (or arbitray value arithmetic) to the target.

Now maybe this could be extended to do so; but it seems we'd have to carefully
think about exactly when we want this to happen.  For example, if you have
a variable residing in a register, you currently cannot take its address in
GDB.  If value_coerce_to_target were to blindly push *everything* to the
target, this would succeed, and you'd have a pointer to a malloc'ed location
holding a copy of the register value -- which is presumably not what you
intended ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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