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: [1/2] Inspect extra signal information


On Monday 12 January 2009 19:39:09, Eli Zaretskii wrote:
> > From: Pedro Alves <pedro@codesourcery.com>
> > Date: Mon, 12 Jan 2009 18:52:06 +0000
> > 
> > 	* defs.h (enum lval_type): New value: lval_computed.
> > 	* value.h (struct lval_funcs): New type.
> > 	(allocate_computed_value, value_computed_funcs)
> > 	(value_computed_closure): New declarations.
> > 	* value.c (struct value): Add a structure to the location union
> > 	for computed lvalues, containing 'funcs' and 'closure' members.
> > 	(allocate_computed_value, value_computed_funcs)
> > 	(value_computed_closure): New functions.
> 
> I think this introduces a general-purpose infrastructure that must be
> documented in gdbint.texinfo.
> 

I'm taking a stab at this.  I don't see struct value documented in
the internals manual though.  What kind of detail do you require here?

I'm thinking of adding a "Values" section somewhere, don't know
where yet.

@section Values

@value{GDBN} uses @code{struct value}, or simply named a @dfn{value}, as an
internal abstraction for the representation of a variety of inferior
objects and @value{GDBN} convenience objects.

Values have an associated @code{struct type}, that describes a virtual
view of the data stored in or accessed through the value.

A value is in addition descriminated by its lvalue-ness, given its
@code{enum lval_type} enumeration:

@table @code
@item @code{not_lval}
This value is not an lval.  It can't be assigned to.

@item @code{lval_memory}
This value represents an object in memory.

@item @code{lval_register}
This value represents an object that lives in a register.

@item @code{lval_internalvar}
Represents the value of an internal variable.

@item @code{lval_internalvar_component}
Represents part of a gdb internal variable.  E.g., a structure field.

@item @code{lval_computed}

These are values with arbitrary functions to handle reads and writes,
and "copy operators" and "destructors".  They allow creating
specialized value objects for specific purposes, all abstracted way
from the the core value support code.  The creator of such a value
specifies specialized read, write, copy and release callbacks,
described by the @code{struct lval_funcs} struture declared in
@file{value.h} to the @code{allocate_computed_value} function.  An
example use is the implementations of the @code{$_siginfo} convenience
variable in @file{infrun.c}.

@end table

@subsection Lazy values

...

-- 
Pedro Alves


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