Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] sim: allow memory maps to default to mapped files
@ 2010-12-27 13:10 Mike Frysinger
  2010-12-28  7:38 ` Joel Brobecker
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Mike Frysinger @ 2010-12-27 13:10 UTC (permalink / raw)
  To: gdb-patches; +Cc: toolchain-devel

I find it annoying when using --memory-mapfile that I also need to look
up and manually specify the file size to the following --memory-region
option.  So make a length of 0 in the following --memory-region trigger
an auto-sizing of the map to the length of the file being mapped.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

2010-12-27  Mike Frysinger  <vapier@gentoo.org>

	* sim-memopt.c (do_memopt_add): Set nr_bytes to s.st_size before
	bytes has been calculated and when mmap_next_fd is valid and
	nr_bytes is 0.
	(memory_option_handler): Allow missing size when mmap_next_fd is
	valid.
---
 sim/common/sim-memopt.c |   40 ++++++++++++++++++++++++++++++----------
 1 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/sim/common/sim-memopt.c b/sim/common/sim-memopt.c
index 99e6add..0f71262 100644
--- a/sim/common/sim-memopt.c
+++ b/sim/common/sim-memopt.c
@@ -154,7 +154,27 @@ do_memopt_add (SIM_DESC sd,
       /* Allocate new well-aligned buffer, just as sim_core_attach(). */
       void *aligned_buffer;
       int padding = (addr % sizeof (unsigned64));
-      unsigned long bytes = (modulo == 0 ? nr_bytes : modulo) + padding;
+      unsigned long bytes;
+
+#ifdef HAVE_MMAP
+      struct stat s;
+
+      if (mmap_next_fd >= 0)
+	{
+	  /* Check that given file is big enough. */
+	  int rc = fstat (mmap_next_fd, &s);
+
+	  if (rc < 0)
+	    sim_io_error (sd, "Error, unable to stat file: %s\n",
+			  strerror (errno));
+
+	  /* Autosize the mapping to the file length.  */
+	  if (bytes == 0)
+	    nr_bytes = s.st_size;
+	}
+#endif
+
+      bytes = (modulo == 0 ? nr_bytes : modulo) + padding;
 
       free_buffer = NULL;
       free_length = bytes;
@@ -163,14 +183,9 @@ do_memopt_add (SIM_DESC sd,
       /* Memory map or malloc(). */
       if (mmap_next_fd >= 0)
 	{
-	  /* Check that given file is big enough. */
-	  struct stat s;
-	  int rc;
-
 	  /* Some kernels will SIGBUS the application if mmap'd file
 	     is not large enough.  */ 
-	  rc = fstat (mmap_next_fd, &s);
-	  if (rc < 0 || s.st_size < bytes)
+	  if (s.st_size < bytes)
 	    {
 	      sim_io_error (sd,
 			    "Error, cannot confirm that mmap file is large enough "
@@ -383,10 +398,15 @@ memory_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
 	chp = parse_addr (chp, &level, &space, &addr);
 	if (*chp != ',')
 	  {
-	    sim_io_eprintf (sd, "Missing size for memory-region\n");
-	    return SIM_RC_FAIL;
+	    /* let the file autosize */
+	    if (mmap_next_fd == -1)
+	      {
+		sim_io_eprintf (sd, "Missing size for memory-region\n");
+		return SIM_RC_FAIL;
+	      }
 	  }
-	chp = parse_size (chp + 1, &nr_bytes, &modulo);
+	else
+	  chp = parse_size (chp + 1, &nr_bytes, &modulo);
 	/* old style */
 	if (*chp == ',')
 	  modulo = strtoul (chp + 1, &chp, 0);
-- 
1.7.3.1


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

* Re: [PATCH] sim: allow memory maps to default to mapped files
  2010-12-27 13:10 [PATCH] sim: allow memory maps to default to mapped files Mike Frysinger
@ 2010-12-28  7:38 ` Joel Brobecker
  2010-12-28  7:39   ` Joel Brobecker
  2010-12-28  7:46   ` Mike Frysinger
  2010-12-30 21:09 ` [PATCH v2] " Mike Frysinger
  2011-01-11 19:05 ` [PATCH] " Mike Frysinger
  2 siblings, 2 replies; 17+ messages in thread
From: Joel Brobecker @ 2010-12-28  7:38 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches, toolchain-devel

> I find it annoying when using --memory-mapfile that I also need to look
> up and manually specify the file size to the following --memory-region
> option.  So make a length of 0 in the following --memory-region trigger
> an auto-sizing of the map to the length of the file being mapped.

Generally speaking, and that's not your fault, it would be nice to
have some documentation about this module in the GDB Users' Manual.
Would you be willing to help us in that department? - nothing fancy,
but something very basic that quickly lists all available option
and what they mean.  This can be treated as a separate patch.

In terms of the user interface for this change, why not just make
the size optional? So, either the user specifies "ADDR,SIZE", or
he says "ADDR".  That way, you do not need to treat zero as special.

I see, now, that this patch has already been checked in - I must have
missed the approval email.  But the suggestions are both still interesting,
IMO.

-- 
Joel


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

* Re: [PATCH] sim: allow memory maps to default to mapped files
  2010-12-28  7:38 ` Joel Brobecker
@ 2010-12-28  7:39   ` Joel Brobecker
  2010-12-28  8:02     ` Mike Frysinger
  2010-12-28  7:46   ` Mike Frysinger
  1 sibling, 1 reply; 17+ messages in thread
From: Joel Brobecker @ 2010-12-28  7:39 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches, toolchain-devel

> I see, now, that this patch has already been checked in - I must have
> missed the approval email.  But the suggestions are both still interesting,
> IMO.

Actually, it looks like the patch was not approved! Can you clarify
a bit its status? Minor comments below:

+	  /* Check that given file is big enough. */

Second space after the period.

+	    /* let the file autosize */

Period and two spaces at end of sentence.

-- 
Joel


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

* Re: [PATCH] sim: allow memory maps to default to mapped files
  2010-12-28  7:38 ` Joel Brobecker
  2010-12-28  7:39   ` Joel Brobecker
@ 2010-12-28  7:46   ` Mike Frysinger
  2010-12-28 11:00     ` Joel Brobecker
                       ` (3 more replies)
  1 sibling, 4 replies; 17+ messages in thread
From: Mike Frysinger @ 2010-12-28  7:46 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches, toolchain-devel

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

On Tuesday, December 28, 2010 01:35:36 Joel Brobecker wrote:
> > I find it annoying when using --memory-mapfile that I also need to look
> > up and manually specify the file size to the following --memory-region
> > option.  So make a length of 0 in the following --memory-region trigger
> > an auto-sizing of the map to the length of the file being mapped.
> 
> Generally speaking, and that's not your fault, it would be nice to
> have some documentation about this module in the GDB Users' Manual.
> Would you be willing to help us in that department? - nothing fancy,
> but something very basic that quickly lists all available option
> and what they mean.  This can be treated as a separate patch.

i dont mind writing documentation, but i dont understand texi, so ive avoided 
the format when possible.  i believe all of the gdb documentation is based in 
that format ?

> In terms of the user interface for this change, why not just make
> the size optional? So, either the user specifies "ADDR,SIZE", or
> he says "ADDR".  That way, you do not need to treat zero as special.

that's basically what my change does.  "addr,0" or just "addr" now work.  
sorry if my commit msg wasnt clear.

> I see, now, that this patch has already been checked in - I must have
> missed the approval email.  But the suggestions are both still interesting,
> IMO.

i dont recall committing this, nor do i see it in cvs ...
-mike

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

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

* Re: [PATCH] sim: allow memory maps to default to mapped files
  2010-12-28  7:39   ` Joel Brobecker
@ 2010-12-28  8:02     ` Mike Frysinger
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Frysinger @ 2010-12-28  8:02 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches, toolchain-devel

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

On Tuesday, December 28, 2010 01:40:29 Joel Brobecker wrote:
> +	  /* Check that given file is big enough. */
> 
> Second space after the period.
> 
> +	    /* let the file autosize */
> 
> Period and two spaces at end of sentence.

i was trying to follow the style of the surrounding code, but if that style is 
offf, i'll just go with what you suggest here
-mike

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

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

* Re: [PATCH] sim: allow memory maps to default to mapped files
  2010-12-28  7:46   ` Mike Frysinger
@ 2010-12-28 11:00     ` Joel Brobecker
  2010-12-28 14:34     ` Joel Brobecker
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 17+ messages in thread
From: Joel Brobecker @ 2010-12-28 11:00 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches, toolchain-devel

> > I see, now, that this patch has already been checked in - I must have
> > missed the approval email.  But the suggestions are both still interesting,
> > IMO.
> 
> i dont recall committing this, nor do i see it in cvs ...

Apologies. I must have been something really good, earlier today...

-- 
Joel


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

* Re: [PATCH] sim: allow memory maps to default to mapped files
  2010-12-28  7:46   ` Mike Frysinger
  2010-12-28 11:00     ` Joel Brobecker
@ 2010-12-28 14:34     ` Joel Brobecker
  2010-12-28 23:17       ` Eli Zaretskii
  2011-01-09  3:39       ` Mike Frysinger
  2010-12-28 19:16     ` Eli Zaretskii
  2010-12-29  1:52     ` Michael Snyder
  3 siblings, 2 replies; 17+ messages in thread
From: Joel Brobecker @ 2010-12-28 14:34 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches, toolchain-devel

> i dont mind writing documentation, but i dont understand texi, so ive
> avoided the format when possible.  i believe all of the gdb
> documentation is based in that format ?

Yes, that's correct. texi isn't very difficult, and we have Eli who
helps with any issues around it. There are @[cmd] markers that help
describe the text, and once you know that, you should be able to write
documentation by copy/paste. I found an "introduction to Texinfo" page,
which might be helpful giving you the basics in a short amount of time:

http://lilypond.org/doc/v2.12/Documentation/devel/contrib-guide/Texinfo-introduction-and-usage-policy

> that's basically what my change does.  "addr,0" or just "addr" now work.  
> sorry if my commit msg wasnt clear.

OK.  The patch looks good to me, except for the little formatting nits
that I already pointed out. But can you give it a few more days for
others to comment?  In particular, Doug Evans is more proficient with
the simulator than I am, I believe (which is not hard, considering
that I have barely ever touched that code).

-- 
Joel


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

* Re: [PATCH] sim: allow memory maps to default to mapped files
  2010-12-28  7:46   ` Mike Frysinger
  2010-12-28 11:00     ` Joel Brobecker
  2010-12-28 14:34     ` Joel Brobecker
@ 2010-12-28 19:16     ` Eli Zaretskii
  2010-12-29  1:52     ` Michael Snyder
  3 siblings, 0 replies; 17+ messages in thread
From: Eli Zaretskii @ 2010-12-28 19:16 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: brobecker, gdb-patches, toolchain-devel

> From: Mike Frysinger <vapier@gentoo.org>
> Date: Tue, 28 Dec 2010 02:38:02 -0500
> Cc: gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org
> 
> i dont mind writing documentation, but i dont understand texi, so ive avoided 
> the format when possible.

If you can write it as plain text, I can add the Texinfo markup.

Thanks.


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

* Re: [PATCH] sim: allow memory maps to default to mapped files
  2010-12-28 14:34     ` Joel Brobecker
@ 2010-12-28 23:17       ` Eli Zaretskii
  2011-01-09  3:39       ` Mike Frysinger
  1 sibling, 0 replies; 17+ messages in thread
From: Eli Zaretskii @ 2010-12-28 23:17 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: vapier, gdb-patches, toolchain-devel

> Date: Tue, 28 Dec 2010 16:01:20 +0400
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org
> 
> http://lilypond.org/doc/v2.12/Documentation/devel/contrib-guide/Texinfo-introduction-and-usage-policy

IMO, this mixes too much Lilypond-specific stuff with general-purpose
Texinfo information, so much si that someone who knows no Texinfo will
have hard time figuring out what is specific to Lilypond and what is
general.


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

* Re: [PATCH] sim: allow memory maps to default to mapped files
  2010-12-28  7:46   ` Mike Frysinger
                       ` (2 preceding siblings ...)
  2010-12-28 19:16     ` Eli Zaretskii
@ 2010-12-29  1:52     ` Michael Snyder
  3 siblings, 0 replies; 17+ messages in thread
From: Michael Snyder @ 2010-12-29  1:52 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: Joel Brobecker, gdb-patches, toolchain-devel

Mike Frysinger wrote:
> On Tuesday, December 28, 2010 01:35:36 Joel Brobecker wrote:
>>> I find it annoying when using --memory-mapfile that I also need to look
>>> up and manually specify the file size to the following --memory-region
>>> option.  So make a length of 0 in the following --memory-region trigger
>>> an auto-sizing of the map to the length of the file being mapped.
>> Generally speaking, and that's not your fault, it would be nice to
>> have some documentation about this module in the GDB Users' Manual.
>> Would you be willing to help us in that department? - nothing fancy,
>> but something very basic that quickly lists all available option
>> and what they mean.  This can be treated as a separate patch.
> 
> i dont mind writing documentation, but i dont understand texi, so ive avoided 
> the format when possible.  i believe all of the gdb documentation is based in 
> that format ?

Eli has been very generous about taking plain-text submissions
and tex-ifying them.


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

* [PATCH v2] sim: allow memory maps to default to mapped files
  2010-12-27 13:10 [PATCH] sim: allow memory maps to default to mapped files Mike Frysinger
  2010-12-28  7:38 ` Joel Brobecker
@ 2010-12-30 21:09 ` Mike Frysinger
  2011-01-11 19:05 ` [PATCH] " Mike Frysinger
  2 siblings, 0 replies; 17+ messages in thread
From: Mike Frysinger @ 2010-12-30 21:09 UTC (permalink / raw)
  To: gdb-patches; +Cc: toolchain-devel

I find it annoying when using --memory-mapfile that I also need to look
up and manually specify the file size to the following --memory-region
option.  So make a length of 0 in the following --memory-region trigger
an auto-sizing of the map to the length of the file being mapped.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

2010-12-27  Mike Frysinger  <vapier@gentoo.org>

	* sim-memopt.c (do_memopt_add): Set nr_bytes to s.st_size before
	bytes has been calculated and when mmap_next_fd is valid and
	nr_bytes is 0.
	(memory_option_handler): Allow missing size when mmap_next_fd is
	valid.
---
v2
	- fix typo in nr_bytes==0 handling

 sim/common/sim-memopt.c |   40 ++++++++++++++++++++++++++++++----------
 1 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/sim/common/sim-memopt.c b/sim/common/sim-memopt.c
index 99e6add..5ef48cb 100644
--- a/sim/common/sim-memopt.c
+++ b/sim/common/sim-memopt.c
@@ -154,7 +154,27 @@ do_memopt_add (SIM_DESC sd,
       /* Allocate new well-aligned buffer, just as sim_core_attach(). */
       void *aligned_buffer;
       int padding = (addr % sizeof (unsigned64));
-      unsigned long bytes = (modulo == 0 ? nr_bytes : modulo) + padding;
+      unsigned long bytes;
+
+#ifdef HAVE_MMAP
+      struct stat s;
+
+      if (mmap_next_fd >= 0)
+	{
+	  /* Check that given file is big enough. */
+	  int rc = fstat (mmap_next_fd, &s);
+
+	  if (rc < 0)
+	    sim_io_error (sd, "Error, unable to stat file: %s\n",
+			  strerror (errno));
+
+	  /* Autosize the mapping to the file length.  */
+	  if (nr_bytes == 0)
+	    nr_bytes = s.st_size;
+	}
+#endif
+
+      bytes = (modulo == 0 ? nr_bytes : modulo) + padding;
 
       free_buffer = NULL;
       free_length = bytes;
@@ -163,14 +183,9 @@ do_memopt_add (SIM_DESC sd,
       /* Memory map or malloc(). */
       if (mmap_next_fd >= 0)
 	{
-	  /* Check that given file is big enough. */
-	  struct stat s;
-	  int rc;
-
 	  /* Some kernels will SIGBUS the application if mmap'd file
 	     is not large enough.  */ 
-	  rc = fstat (mmap_next_fd, &s);
-	  if (rc < 0 || s.st_size < bytes)
+	  if (s.st_size < bytes)
 	    {
 	      sim_io_error (sd,
 			    "Error, cannot confirm that mmap file is large enough "
@@ -383,10 +398,15 @@ memory_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
 	chp = parse_addr (chp, &level, &space, &addr);
 	if (*chp != ',')
 	  {
-	    sim_io_eprintf (sd, "Missing size for memory-region\n");
-	    return SIM_RC_FAIL;
+	    /* let the file autosize */
+	    if (mmap_next_fd == -1)
+	      {
+		sim_io_eprintf (sd, "Missing size for memory-region\n");
+		return SIM_RC_FAIL;
+	      }
 	  }
-	chp = parse_size (chp + 1, &nr_bytes, &modulo);
+	else
+	  chp = parse_size (chp + 1, &nr_bytes, &modulo);
 	/* old style */
 	if (*chp == ',')
 	  modulo = strtoul (chp + 1, &chp, 0);
-- 
1.7.3.1


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

* Re: [PATCH] sim: allow memory maps to default to mapped files
  2010-12-28 14:34     ` Joel Brobecker
  2010-12-28 23:17       ` Eli Zaretskii
@ 2011-01-09  3:39       ` Mike Frysinger
  2011-01-11 15:07         ` Doug Evans
  1 sibling, 1 reply; 17+ messages in thread
From: Mike Frysinger @ 2011-01-09  3:39 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches, toolchain-devel

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

On Tuesday, December 28, 2010 07:01:20 Joel Brobecker wrote:
> OK.  The patch looks good to me, except for the little formatting nits
> that I already pointed out. But can you give it a few more days for
> others to comment?  In particular, Doug Evans is more proficient with
> the simulator than I am, I believe (which is not hard, considering
> that I have barely ever touched that code).

i'll commit in a day or two if no one has any more feedback ...
-mike

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

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

* Re: [PATCH] sim: allow memory maps to default to mapped files
  2011-01-09  3:39       ` Mike Frysinger
@ 2011-01-11 15:07         ` Doug Evans
  2011-01-11 16:04           ` [toolchain-devel] " Mike Frysinger
  0 siblings, 1 reply; 17+ messages in thread
From: Doug Evans @ 2011-01-11 15:07 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: Joel Brobecker, gdb-patches, toolchain-devel

On Sat, Jan 8, 2011 at 7:39 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Tuesday, December 28, 2010 07:01:20 Joel Brobecker wrote:
>> OK.  The patch looks good to me, except for the little formatting nits
>> that I already pointed out. But can you give it a few more days for
>> others to comment?  In particular, Doug Evans is more proficient with
>> the simulator than I am, I believe (which is not hard, considering
>> that I have barely ever touched that code).
>
> i'll commit in a day or two if no one has any more feedback ...

Hi.  The only comment I have is that it would be nice to keep "struct
stat s;" in its original location, but it's not necessary.


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

* Re: [toolchain-devel] [PATCH] sim: allow memory maps to default to mapped files
  2011-01-11 15:07         ` Doug Evans
@ 2011-01-11 16:04           ` Mike Frysinger
  2011-01-11 17:02             ` Doug Evans
  0 siblings, 1 reply; 17+ messages in thread
From: Mike Frysinger @ 2011-01-11 16:04 UTC (permalink / raw)
  To: Doug Evans; +Cc: toolchain-devel, gdb-patches, Joel Brobecker

On Tue, Jan 11, 2011 at 10:07, Doug Evans wrote:
> On Sat, Jan 8, 2011 at 7:39 PM, Mike Frysinger wrote:
>> On Tuesday, December 28, 2010 07:01:20 Joel Brobecker wrote:
>>> OK.  The patch looks good to me, except for the little formatting nits
>>> that I already pointed out. But can you give it a few more days for
>>> others to comment?  In particular, Doug Evans is more proficient with
>>> the simulator than I am, I believe (which is not hard, considering
>>> that I have barely ever touched that code).
>>
>> i'll commit in a day or two if no one has any more feedback ...
>
> Hi.  The only comment I have is that it would be nice to keep "struct
> stat s;" in its original location, but it's not necessary.

i couldnt do that without duplicating the bytes and free_length setup,
and i thought not duplicating those was more important.
-mike


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

* Re: [toolchain-devel] [PATCH] sim: allow memory maps to default to mapped files
  2011-01-11 16:04           ` [toolchain-devel] " Mike Frysinger
@ 2011-01-11 17:02             ` Doug Evans
  2011-01-11 17:06               ` Doug Evans
  0 siblings, 1 reply; 17+ messages in thread
From: Doug Evans @ 2011-01-11 17:02 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: toolchain-devel, gdb-patches, Joel Brobecker

On Tue, Jan 11, 2011 at 8:04 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Tue, Jan 11, 2011 at 10:07, Doug Evans wrote:
>> On Sat, Jan 8, 2011 at 7:39 PM, Mike Frysinger wrote:
>>> On Tuesday, December 28, 2010 07:01:20 Joel Brobecker wrote:
>>>> OK.  The patch looks good to me, except for the little formatting nits
>>>> that I already pointed out. But can you give it a few more days for
>>>> others to comment?  In particular, Doug Evans is more proficient with
>>>> the simulator than I am, I believe (which is not hard, considering
>>>> that I have barely ever touched that code).
>>>
>>> i'll commit in a day or two if no one has any more feedback ...
>>
>> Hi.  The only comment I have is that it would be nice to keep "struct
>> stat s;" in its original location, but it's not necessary.
>
> i couldnt do that without duplicating the bytes and free_length setup,
> and i thought not duplicating those was more important.

Well, free_length can easily be moved down, it's really only bytes
that's the concern.
It's not worth spending time on it, but having the two ifdefs and having

  int a;
#ifdef FOO
  int b;

  mumble
#endif

feels like it could be cleaner, but for this it's not worth spending time on.


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

* Re: [toolchain-devel] [PATCH] sim: allow memory maps to default to mapped files
  2011-01-11 17:02             ` Doug Evans
@ 2011-01-11 17:06               ` Doug Evans
  0 siblings, 0 replies; 17+ messages in thread
From: Doug Evans @ 2011-01-11 17:06 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: toolchain-devel, gdb-patches, Joel Brobecker

On Tue, Jan 11, 2011 at 8:04 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Tue, Jan 11, 2011 at 10:07, Doug Evans wrote:
>> On Sat, Jan 8, 2011 at 7:39 PM, Mike Frysinger wrote:
>>> On Tuesday, December 28, 2010 07:01:20 Joel Brobecker wrote:
>>>> OK.  The patch looks good to me, except for the little formatting nits
>>>> that I already pointed out. But can you give it a few more days for
>>>> others to comment?  In particular, Doug Evans is more proficient with
>>>> the simulator than I am, I believe (which is not hard, considering
>>>> that I have barely ever touched that code).
>>>
>>> i'll commit in a day or two if no one has any more feedback ...
>>
>> Hi.  The only comment I have is that it would be nice to keep "struct
>> stat s;" in its original location, but it's not necessary.
>
> i couldnt do that without duplicating the bytes and free_length setup,
> and i thought not duplicating those was more important.

Well, free_length can easily be moved down, it's really only bytes
that's the concern.
It's not worth spending time on it, but having the two ifdefs and having

  int a;
#ifdef FOO
  int b;

  mumble
#endif

feels like it could be cleaner, but for this it's not worth spending time on.


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

* Re: [PATCH] sim: allow memory maps to default to mapped files
  2010-12-27 13:10 [PATCH] sim: allow memory maps to default to mapped files Mike Frysinger
  2010-12-28  7:38 ` Joel Brobecker
  2010-12-30 21:09 ` [PATCH v2] " Mike Frysinger
@ 2011-01-11 19:05 ` Mike Frysinger
  2 siblings, 0 replies; 17+ messages in thread
From: Mike Frysinger @ 2011-01-11 19:05 UTC (permalink / raw)
  To: gdb-patches; +Cc: toolchain-devel

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

On Monday, December 27, 2010 00:07:51 Mike Frysinger wrote:
> I find it annoying when using --memory-mapfile that I also need to look
> up and manually specify the file size to the following --memory-region
> option.  So make a length of 0 in the following --memory-region trigger
> an auto-sizing of the map to the length of the file being mapped.

ive merged this now
-mike

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

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

end of thread, other threads:[~2011-01-11 17:59 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-27 13:10 [PATCH] sim: allow memory maps to default to mapped files Mike Frysinger
2010-12-28  7:38 ` Joel Brobecker
2010-12-28  7:39   ` Joel Brobecker
2010-12-28  8:02     ` Mike Frysinger
2010-12-28  7:46   ` Mike Frysinger
2010-12-28 11:00     ` Joel Brobecker
2010-12-28 14:34     ` Joel Brobecker
2010-12-28 23:17       ` Eli Zaretskii
2011-01-09  3:39       ` Mike Frysinger
2011-01-11 15:07         ` Doug Evans
2011-01-11 16:04           ` [toolchain-devel] " Mike Frysinger
2011-01-11 17:02             ` Doug Evans
2011-01-11 17:06               ` Doug Evans
2010-12-28 19:16     ` Eli Zaretskii
2010-12-29  1:52     ` Michael Snyder
2010-12-30 21:09 ` [PATCH v2] " Mike Frysinger
2011-01-11 19:05 ` [PATCH] " Mike Frysinger

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