This is the mail archive of the gdb@sources.redhat.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: Connect 2 mips simulator


Hi -

On Fri, Sep 07, 2001 at 01:36:17PM +0200, Manganotto Filippo wrote:
: 	I'm working with Zampieri Marco. We have downloaded GDB from CVS
: and installed it. We find option --memory-mapfile FILE, but we doesn't
: know how to use it, because when we run
:     $>TARGET-run --memory-mapfile pippo.txt --memory-region=... hello
: [...]
: than we create an empty file called "pippo.txt", an the run
:     $>Error, cannot confirm that mmap file is large enough (>= 32768
: bytes)

A typical use of the mmap system call requires that the file being mapped
into memory be at least as large as the chosen mapped  memory size, so
that there is a one-to-one relationship between an existing byte in a
file, and a mapped byte in memory.  This means that an empty file, or
a too-small file will not be acceptable.

An easy way to create a file of a chosen size is to use the dd command
like this:

	dd if=/dev/zero of=pippo.txt bs=32768 count=1

This copies 1 block of 32768 bytes from /dev/zero to pippo.txt.
You will have a nice small zero-filled file.

- FChE

PGP signature


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