Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* more fortran problems
@ 2010-09-17 23:36 Mathew Yeates
  2010-09-18  0:02 ` Michael Snyder
  0 siblings, 1 reply; 5+ messages in thread
From: Mathew Yeates @ 2010-09-17 23:36 UTC (permalink / raw)
  To: gdb

I am dealing with an array of logicals.
With the line
if (Tau_mask(itau,imix)) then

I  type
(gdb) set Tau_mask(itau,imix) = .TRUE.
(gdb) print Tau_mask(itau,imix)
.TRUE.
.

but the code below the "if" statement isnt executed.

So, now I'm trying set the memory location.
(gdb) print &Tau_mask
$6 = (PTR TO -> ( logical(kind=4) (*,*))) 0x2859630
(gdb) set (int)0x2859630=.TRUE.
Left operand of assignment is not an lvalue

What am I doing wrong?

-Mathew


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

* Re: more fortran problems
  2010-09-17 23:36 more fortran problems Mathew Yeates
@ 2010-09-18  0:02 ` Michael Snyder
  2010-09-18  0:16   ` Mathew Yeates
  2010-09-20 17:18   ` Doug Evans
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Snyder @ 2010-09-18  0:02 UTC (permalink / raw)
  To: Mathew Yeates; +Cc: gdb

Mathew Yeates wrote:

> So, now I'm trying set the memory location.
> (gdb) print &Tau_mask
> $6 = (PTR TO -> ( logical(kind=4) (*,*))) 0x2859630
> (gdb) set (int)0x2859630=.TRUE.
> Left operand of assignment is not an lvalue
> 
> What am I doing wrong?

This is not unique to Fortran.  The usual gdb syntax for this would be

    set *(int *) 0x2859630= [...]


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

* Re: more fortran problems
  2010-09-18  0:02 ` Michael Snyder
@ 2010-09-18  0:16   ` Mathew Yeates
  2010-09-20 17:18   ` Doug Evans
  1 sibling, 0 replies; 5+ messages in thread
From: Mathew Yeates @ 2010-09-18  0:16 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb

yeah, I finally got it. And now the code below the "if" statement is
being executed!

So .... this works but is kind of ugly. Maybe gdb is computing the
address incorrectly?

-Mathew

On Fri, Sep 17, 2010 at 5:02 PM, Michael Snyder <msnyder@vmware.com> wrote:
> Mathew Yeates wrote:
>
>> So, now I'm trying set the memory location.
>> (gdb) print &Tau_mask
>> $6 = (PTR TO -> ( logical(kind=4) (*,*))) 0x2859630
>> (gdb) set (int)0x2859630=.TRUE.
>> Left operand of assignment is not an lvalue
>>
>> What am I doing wrong?
>
> This is not unique to Fortran.  The usual gdb syntax for this would be
>
>   set *(int *) 0x2859630= [...]
>
>


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

* Re: more fortran problems
  2010-09-18  0:02 ` Michael Snyder
  2010-09-18  0:16   ` Mathew Yeates
@ 2010-09-20 17:18   ` Doug Evans
  2010-09-20 17:24     ` Doug Evans
  1 sibling, 1 reply; 5+ messages in thread
From: Doug Evans @ 2010-09-20 17:18 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Mathew Yeates, gdb

On Fri, Sep 17, 2010 at 5:02 PM, Michael Snyder <msnyder@vmware.com> wrote:
> Mathew Yeates wrote:
>
>> So, now I'm trying set the memory location.
>> (gdb) print &Tau_mask
>> $6 = (PTR TO -> ( logical(kind=4) (*,*))) 0x2859630
>> (gdb) set (int)0x2859630=.TRUE.
>> Left operand of assignment is not an lvalue
>>
>> What am I doing wrong?
>
> This is not unique to Fortran.  The usual gdb syntax for this would be
>
>   set *(int *) 0x2859630= [...]

[for reference sake]

There's also the gdb extension:  set {int} 0x2859630 = [...]


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

* Re: more fortran problems
  2010-09-20 17:18   ` Doug Evans
@ 2010-09-20 17:24     ` Doug Evans
  0 siblings, 0 replies; 5+ messages in thread
From: Doug Evans @ 2010-09-20 17:24 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Mathew Yeates, gdb

On Mon, Sep 20, 2010 at 10:18 AM, Doug Evans <dje@google.com> wrote:
> On Fri, Sep 17, 2010 at 5:02 PM, Michael Snyder <msnyder@vmware.com> wrote:
>> Mathew Yeates wrote:
>>
>>> So, now I'm trying set the memory location.
>>> (gdb) print &Tau_mask
>>> $6 = (PTR TO -> ( logical(kind=4) (*,*))) 0x2859630
>>> (gdb) set (int)0x2859630=.TRUE.
>>> Left operand of assignment is not an lvalue
>>>
>>> What am I doing wrong?
>>
>> This is not unique to Fortran.  The usual gdb syntax for this would be
>>
>>   set *(int *) 0x2859630= [...]
>
> [for reference sake]
>
> There's also the gdb extension:  set {int} 0x2859630 = [...]

Heh, except this extension doesn't seem to have been added to the
fortran parser.
[I don't know fortran well enough to say that it's a good idea though.]


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

end of thread, other threads:[~2010-09-20 17:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-17 23:36 more fortran problems Mathew Yeates
2010-09-18  0:02 ` Michael Snyder
2010-09-18  0:16   ` Mathew Yeates
2010-09-20 17:18   ` Doug Evans
2010-09-20 17:24     ` Doug Evans

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