Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] Use value_at_lazy() when dereferencing type int expressions
@ 2002-06-18 14:38 Don Howard
  2002-06-18 15:33 ` Don Howard
  2002-06-18 16:16 ` Andrew Cagney
  0 siblings, 2 replies; 4+ messages in thread
From: Don Howard @ 2002-06-18 14:38 UTC (permalink / raw)
  To: gdb-patches



The following allows gdb expressions like

set *YYYY = zzzz

to be evaluated without reading target memory at *YYYY.

No testsuite regressions on x86 linux.


2002-06-18  Don Howard  <dhoward@redhat.com>

	* valops.c (value_ind): Use value_at_lazy() when dereferencing
	type int expressions.

Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.60
diff -p -u -w -r1.60 valops.c
--- valops.c    14 Jun 2002 14:34:26 -0000      1.60
+++ valops.c    18 Jun 2002 21:28:52 -0000
@@ -961,7 +961,7 @@ value_ind (struct value *arg1)
      to do.  "long long" variables are rare enough that
      BUILTIN_TYPE_LONGEST would seem to be a mistake.  */
   if (TYPE_CODE (base_type) == TYPE_CODE_INT)
-    return value_at (builtin_type_int,
+    return value_at_lazy (builtin_type_int,
                     (CORE_ADDR) value_as_long (arg1),
                     VALUE_BFD_SECTION (arg1));
   else if (TYPE_CODE (base_type) == TYPE_CODE_PTR)






-- 
dhoward@redhat.com
gdb engineering




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Use value_at_lazy() when dereferencing type int expressions
  2002-06-18 14:38 [patch] Use value_at_lazy() when dereferencing type int expressions Don Howard
@ 2002-06-18 15:33 ` Don Howard
  2002-06-18 16:16 ` Andrew Cagney
  1 sibling, 0 replies; 4+ messages in thread
From: Don Howard @ 2002-06-18 15:33 UTC (permalink / raw)
  To: gdb-patches



I forgot to give credit to Jim Blandy for suggesting this solution.

2002-06-18  Don Howard  <dhoward@redhat.com>

	* valops.c (value_ind): Use value_at_lazy() when dereferencing
	type int expressions.  Thanks to Jim Blandy <jimb@redhat.com> for
	suggesting this solution.



On Tue, 18 Jun 2002, Don Howard wrote:

> 
> 
> The following allows gdb expressions like
> 
> set *YYYY = zzzz
> 
> to be evaluated without reading target memory at *YYYY.
> 
> No testsuite regressions on x86 linux.
> 
> 
> 2002-06-18  Don Howard  <dhoward@redhat.com>
> 
> 	* valops.c (value_ind): Use value_at_lazy() when dereferencing
> 	type int expressions.
> 
> Index: valops.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/valops.c,v
> retrieving revision 1.60
> diff -p -u -w -r1.60 valops.c
> --- valops.c    14 Jun 2002 14:34:26 -0000      1.60
> +++ valops.c    18 Jun 2002 21:28:52 -0000
> @@ -961,7 +961,7 @@ value_ind (struct value *arg1)
>       to do.  "long long" variables are rare enough that
>       BUILTIN_TYPE_LONGEST would seem to be a mistake.  */
>    if (TYPE_CODE (base_type) == TYPE_CODE_INT)
> -    return value_at (builtin_type_int,
> +    return value_at_lazy (builtin_type_int,
>                      (CORE_ADDR) value_as_long (arg1),
>                      VALUE_BFD_SECTION (arg1));
>    else if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
> 
> 

-- 
dhoward@redhat.com
gdb engineering



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Use value_at_lazy() when dereferencing type int expressions
  2002-06-18 14:38 [patch] Use value_at_lazy() when dereferencing type int expressions Don Howard
  2002-06-18 15:33 ` Don Howard
@ 2002-06-18 16:16 ` Andrew Cagney
  2002-06-18 16:41   ` Don Howard
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2002-06-18 16:16 UTC (permalink / raw)
  To: Don Howard; +Cc: gdb-patches

> -    return value_at (builtin_type_int,
> +    return value_at_lazy (builtin_type_int,

Hmm, yes!

Andrew



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Use value_at_lazy() when dereferencing type int expressions
  2002-06-18 16:16 ` Andrew Cagney
@ 2002-06-18 16:41   ` Don Howard
  0 siblings, 0 replies; 4+ messages in thread
From: Don Howard @ 2002-06-18 16:41 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

On Tue, 18 Jun 2002, Andrew Cagney wrote:

> > -    return value_at (builtin_type_int,
> > +    return value_at_lazy (builtin_type_int,
> 
> Hmm, yes!
> 
> Andrew
> 
> 

Committed.

-- 
dhoward@redhat.com
gdb engineering



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-06-18 23:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-18 14:38 [patch] Use value_at_lazy() when dereferencing type int expressions Don Howard
2002-06-18 15:33 ` Don Howard
2002-06-18 16:16 ` Andrew Cagney
2002-06-18 16:41   ` Don Howard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox