This is the mail archive of the gdb@sourceware.cygnus.com 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]

Re: memory region attributes


"J.T. Conklin" wrote:

Sorry, this just sat in my in tray :-(

> Synopsis:
>     (gdb) mem <start address> <end_address> [attribute ...]
> 
> Attributes:
>     rw - memory is read/write (default)
>     ro - memory is read only, GDB will refuse to issue a write
>          command.
>     wo - memory is write only, GDB will refuse to issue a read
>          command.
> 
>     8,16,32  - access memory in X sized operations
> 
>     hwbreak  - GDB internal breakpoints use hw breakpoints
>     swbreak  - GDB internal breakpoints use sw breakpoints (default)
> 
>     cache    - enable host-side caching
>     nocache  - disable host-side caching (default)
> 
> Examples:
>     (gdb) mem &start &etext ro cache
>     (gdb) mem &uart_base &uart_base + 0x0f 8

J.T. as a representation of the actual memory, you may want to look at
what the simulators are using (sim/common/sim-core.c,
sim/common/sim-memopt.c).  The code started out with a simile model as
you've described but ended up with a slightly more complex
representation of target memory.  It is very much a reflection of the
tricks that hardware engineeers like to play with address decode lines
:-)

Briefly:

	o	The regions can be layered.
		That way it is clear what happens
		if two regions overlap.

		This reflects memory with ``holes''

	o	Memory regions can be shaddowed/aliases
		Region 0x100..0x200 also at 0x1100..0x1200
		This reflects how some address lines
		are not decoded.

	o	Similarly, memory can be repeated
		across a region.  The same block
		appearing at 0x0..0x10, 0x10..0x20,
		and so on for an entire 1mb.

Hmm,  perhaphs, instead of something like this where the user specifies
constants mem should take an equation that returns the relevant
attributes. That way the user can built up an arbitrary set of rules
about what memory can be accessed.

	Andrew

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