Re: Check memory accesses

Daniel Jacobowitz
2006-11-19T00:05:25Z

On Wed, Nov 15, 2006 at 03:24:07PM +0300, Vladimir Prus wrote:
> + /* region->hi means there's no upper bound. */
> + if (memaddr + len < region->hi || region->hi == 0)

"region->hi == 0", you mean (in the comment)? Also, two spaces after
period.

> +++ gdb/memattr.c (/patches/gdb/memcheck/gdb_mainline) (revision 2094)
> @@ -29,6 +29,7 @@
> #include "language.h"
> #include "vec.h"
> #include "gdb_string.h"
> +#include "gdb_locale.h"

Shouldn't need this? It's part of defs.h (deliberately, since
everywhere should use _()).

> if (m->enabled_p == 1)
> {
> + /* If address is in memory return, return that memory range. */

I think you mean "if the adderss is in the memory region".

> + /* When no memory map is defined at all, we always set 'default_mem_attrib',
> + so that we do not make the all memory inaccessible for targets that don't
> + provide a memory map. */

Always return, rather than "always set"? Also, "make all memory".

--
Daniel Jacobowitz
CodeSourcery