Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: DJ Delorie <dj@redhat.com>
Cc: gdb@sourceware.org
Subject: Re: is sim/common documented anywhere?
Date: Thu, 23 Aug 2012 01:12:00 -0000	[thread overview]
Message-ID: <201208222111.38601.vapier@gentoo.org> (raw)
In-Reply-To: <201208222341.q7MNfg9Y017675@greed.delorie.com>

[-- Attachment #1: Type: Text/Plain, Size: 1947 bytes --]

On Wednesday 22 August 2012 19:41:42 DJ Delorie wrote:
> I've read through the comments and README.  Mostly what's missing is
> some guide to help tell people where to begin, what parts to worry
> about, and WHY you'd use any given piece.

yes, some of the fundamental pieces explaining how it all comes together is 
missing

> Example: how do I set up the chip's RAM/ROM regions? 

you use sim_core_attach to attach memory regions.  the mapmask allows you to 
set different permissions on it.  be aware that the sim currently has an issue 
when used in conjunction with gdb -- the read/write bits not only lock out the 
simulated code from accessing the region, but gdb too :(.

so you can't setup something like executable-only memory by specifying 
access_exec as then when you try to use `x` or `dis` from gdb, you'd get back 
an error -- the memory may not be read.  similarly, if you were to try to use 
`load` to load an executable with custom contents into that region you'd again 
get denied -- gdb is not allowed to write to it.

i mentioned this a while ago seeking ideas, but didn't get any response.

> Do I want them to be user-configurable?

yes.  the idea of the sim is two fold: provide simulation of the ISA with no 
SoC related details (peripherals/memory regions/etc...), and then t optionally 
provide support for common SoCs.

> If so, what's the best way to manage them?

check out sim-model.c.  this lets you specify --model on the command line to 
select different SoCs.  this sets up CPU_MODEL (cpu) which you can then parse 
in the early init phases of the sim (sim_open) to attach an appropriate set of 
memory regions based on the model.

you can also use SIM_AC_OPTION_DEFAULT_MODEL() in your configure.ac to select 
the default model for the sim if you want one.

if you have different ISAs to select between, you probably want to use --
architecture for that.

HTH
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-08-23  1:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22 22:58 DJ Delorie
2012-08-22 23:23 ` Mike Frysinger
2012-08-22 23:42   ` DJ Delorie
2012-08-23  1:12     ` Mike Frysinger [this message]
2012-08-24 20:04       ` DJ Delorie
2012-08-24 22:10         ` Mike Frysinger
2012-08-25  0:50           ` DJ Delorie
2012-08-25  5:32             ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201208222111.38601.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=dj@redhat.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox