Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Addressable unit in memory viewer display

I'm trying to read address space starting at 0xfff44000 up to 0xfff457e0
this covers EDMA module in MPC5554.

So, I'm adding Memory monitor starting at 0xfff44000 and I see this in
memory view:

  0xfff44000 : 0xFFF44000 <Hex>
  Address   0 - 3     4 - 7     8 - B     C - F               
  FFF44000  00000040  40000010  00000000  00000003          
  FFF44010  C3F8402C  FFF80042  40040FF0  C3FD0000          
  FFF44020  40005660  C3FC8BFC  C3FCC000  40000000          
  FFF44030  00000000  00000000  00000000  80000000          
  FFF44040  00000000  9421FFF0  9421FFF0  9421FFF0          
  FFF44050  9421FFF0  9421FFF0  9421FFF0  00000001          
  FFF44060  40040FD0  40040FE0  00000000  400055D8          
  FFF44070  00000003  FFF80000  00000040  40000010          

What must be a result of:

215-data-read-memory 4294197248 x 1 1 100
215^done,addr="0xfff44000",nr-bytes="100",total-bytes="100",next-row="0x
fff44064",prev-row="0xfff43f9c",next-page="0xfff44064",prev-page="0xfff4
3f9c",memory=[{addr="0xfff44000",data=["0x00","0x00","0x00","0x00","0x00
","0x00","0x00","0x03","0xc3","0xf8","0x40","0x2c","0xff","0xf8","0x00",
"0x42","0x40","0x04","0x0f","0xf0","0xc3","0xfd","0x00","0x00","0x40","0
x00","0x56","0x60","0xc3","0xfc","0x8b","0xfc","0xc3","0xfc","0xc0","0x0
0","0x40","0x00","0x00","0x00","0x00","0x00","0x00","0x00","0x00","0x00"
,"0x00","0x00","0x00","0x00","0x00","0x00","0x80","0x00","0x00","0x00","
0x00","0x00","0x00","0x00","0x94","0x21","0xff","0xf0","0x94","0x21","0x
ff","0xf0","0x94","0x21","0xff","0xf0","0x94","0x21","0xff","0xf0","0x94
","0x21","0xff","0xf0","0x94","0x21","0xff","0xf0","0x00","0x00","0x00",
"0x01","0x40","0x04","0x0f","0xd0","0x40","0x04","0x0f","0xe0","0x00","0
x00","0x00","0x00"]}]
216-data-read-memory 4294196928 x 1 1 752
216^done,addr="0xfff43ec0",nr-bytes="752",total-bytes="752",next-row="0x
fff441b0",prev-row="0xfff43bd0",next-page="0xfff441b0",prev-page="0xfff4
3bd0",memory=[{addr="0xfff43ec0",data=["0x40","0x00","0x55","0xd8","0x00
","0x00","0x00","0x03","0xff","0xf8","0x00","0x00","0x00","0x00","0x00",
"0x40","0x40","0x00","0x00","0x10","0x00","0x00","0x00","0x00","0x00","0
x00","0x00","0x03","0xc3","0xf8","0x40","0x2c","0xff","0xf8","0x00","0x4
2","0x40","0x04","0x0f","0xf0","0xc3","0xfd","0x00","0x00","0x40","0x00"
,"0x56","0x60","0xc3","0xfc","0x8b","0xfc","0xc3","0xfc","0xc0","0x00","
0x40","0x00","0x00","0x00","0x00","0x00","0x00","0x00","0x00","0x00","0x
00","0x00","0x00","0x00","0x00","0x00","0x80","0x00","0x00","0x00","0x00
","0x00","0x00","0x00","0x94","0x21","0xff","0xf0","0x94","0x21","0xff",
"0xf0","0x94","0x21","0xff","0xf0","0x94","0x21","0xff","0xf0","0x94","0
x21","0xff","0xf0",......

data-read-memory in this example asks for 100 columns of 1 byte memory
words - isn't it forcing gdb to read one-by-one?

when I run matching command directly in gdb console
x/100xb 0xfff44000
0xfff44000:	0x00	0x00	0xe4	0x00	0x00	0x00	0x00
0x00
0xfff44008:	0x00	0x00	0x00	0x00	0x00	0x00	0x00
0x00
0xfff44010:	0x00	0x00	0x00	0x00	0x00	0x00	0x00
0x00
0xfff44018:	0x00	0x00	0x00	0x00	0x00	0x00	0x00
0x00
0xfff44020:	0x00	0x00	0x00	0x00	0x00	0x00	0x00
0x00
0xfff44028:	0x00	0x00	0x00	0x00	0x00	0x00	0x00
0x00
0xfff44030:	Cannot access memory at address 0xfff44030

I see error at 0xfff44030 (0xfff44030-0xfff440ff is reserved) which may
explains why data-read-memory fails/returns wrong values.

But changing word size to 4 bytes in this way:
x/25xw 0xfff44000
0xfff44000:	0x0000e400	0x00000000	0x00000000
0x00000000
0xfff44010:	0x00000000	0x00000000	0x00000000
0x00000000
0xfff44020:	0x00000000	0x00000000	0x00000000
0x00000000
0xfff44030:	0x00000000	0x00000000	0x00000000
0x00000000
0xfff44040:	0x00000000	0x00000000	0x00000000
0x00000000
0xfff44050:	0x00000000	0x00000000	0x00000000
0x00000000
0xfff44060:	0x00000000
reads memory correctly (also reserved range at 0xfff44030). 
This is real content of memory (you can see that it is completely
different than that displayed in eclipse)

When I was writing about expression (*( struct EDMA_tag *)
0xFFF44000), I assumed gdb will request sizeof(EDMA_tag) bytes from
0xfff44000-0xfff457e0 range which makes the issue. I think that solving
data-read-memory issue will solve expression issue.

I'm using GDB6.5.
Insight reads whole memory correctly.

Best Regards,
Sebastian


-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Vladimir Prus
Sent: Tuesday, July 08, 2008 3:04 PM
To: CDT General developers list.
Subject: Re: [cdt-dev] Addressable unit in memory viewer display

On Tuesday 08 July 2008 16:35:21 Sebastian Paluch wrote:
> Hello,
> 
>  
> 
> We are working on PowerPc MPC5554 and having problems with memory view
> when trying to see peripheral registers regions. 
> 
> In following example Eclipse is asking about 100 bytes reading one by
> one: 
> 
>  
> 
> 400-data-read-memory 4294197248 x 1 1 100
> 
>
400^done,addr="0xfff44000",nr-bytes="100",total-bytes="100",next-row="0x
>
fff44064",prev-row="0xfff43f9c",next-page="0xfff44064",prev-page="0xfff4
>
3f9c",memory=[{addr="0xfff44000",data=["0x00","0x00","0x00","0x00","0x00
>
","0x00","0x00","0x03","0xc3","0xf8","0x40","0x2c","0xff","0xf8","0x00",
>
"0x42","0x40","0x04","0x0f","0xf0","0x20","0x28","0x63","0x6f","0x40","0
>
x00","0x56","0x60","0x53","0x70","0x69","0x44","0x65","0x73","0x63","0x7
>
2","0x69","0x70","0x74","0x6f","0x72","0x53","0x74","0x20","0x2a","0x29"
>
,"0x2e","0x00","0x42","0x75","0x73","0x48","0x64","0x6c","0x2d","0x3e","
>
0x4d","0x6f","0x64","0x75","0x94","0x21","0xff","0xf0","0x94","0x21","0x
>
ff","0xf0","0x94","0x21","0xff","0xf0","0x94","0x21","0xff","0xf0","0x94
>
","0x21","0xff","0xf0","0x94","0x21","0xff","0xf0","0xff","0xf9","0x00",
>
"0x00","0xff","0xf9","0x40","0x00","0xff","0xf9","0x80","0x00","0xff","0
> xf9","0xc0","0x00"]}]
> 
>  
> 
> But register in this location 

What is "this location" -- it appears that the output above is perfectly
fine.

> are not byte accessible, but four bytes. 
> 
> Direct gdb call fails when not byte accessible address is reached,
> data-read-memory command does not instead it returns garbage's.

What do you mean by "garbase". In GDB 6.8, the -data-read-memory would
return
error (for the entire operation) if it find any memory error. The CVS
HEAD version
of GDB will return all the memory until the first error, and return
"n/a" for 
the reminder of the requested memory region, which Eclipse shows using
"?"

But it seems something is wrong with the target. GDB does not read the
memory
byte-by-byte -- it issues a read request for 100 bytes. It's up to your
target
to produce those 100 bytes in whatever way is suitable. Also, it's not
apparent
to me why your target would refuse byte access -- is reading the memory
location
has some side effects? If no, then I think reading individual bytes will
be OK.

> Because of those issues Expression resolving is also not working when
> operating the same memory i.e. (*( struct EDMA_tag *)      0xFFF44000)
> is not showing correct values.

I don't understand you. When this expression is evaluated, GDB is
supposed
to read sizeof(EDMA_tag) bytes from the target. I would have hoped this
size to be multiple of 4, if it mirrors hardware registers layout. Then,
I don't see where error comes from -- except if the structure is as
large
as not to fit in one memory transfer.

> Is there any way to make it working? 

It seems this is an issue with your target, not with CDT.

- Volodya
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


***
The information in this e-mail is confidential and intended solely for the individual or entity to whom it is addressed.  If you have received this e-mail in error please notify the sender by return e-mail delete this e-mail and refrain from any disclosure or action based on the information.
***


Back to the top