diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-07-09 20:30:59 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-07-09 20:30:59 +0000 |
commit | c0ac0ec78df5972b67b7048c85440c68764d3c8e (patch) | |
tree | a765f0f9fa8c516626ec18b1b5d8b6066d647942 /gdb | |
parent | e0452928e8435b2b7614a672a163cbd3c666d695 (diff) | |
download | gdb-c0ac0ec78df5972b67b7048c85440c68764d3c8e.zip gdb-c0ac0ec78df5972b67b7048c85440c68764d3c8e.tar.gz gdb-c0ac0ec78df5972b67b7048c85440c68764d3c8e.tar.bz2 |
gdb/
Report error on inaccessible memory.
* cli/cli-dump.c: Include gdbcore.h.
(dump_memory_to_file): Call read_memory instead of target_read_memory.
gdb/testsuite/
* gdb.base/dump.exp (inaccessible memory is reported): New test.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/cli/cli-dump.c | 3 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/dump.exp | 4 |
4 files changed, 17 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e9e9c19..d3347db 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2009-07-09 Jan Kratochvil <jan.kratochvil@redhat.com> + + Report error on inaccessible memory. + * cli/cli-dump.c: Include gdbcore.h. + (dump_memory_to_file): Call read_memory instead of target_read_memory. + 2009-07-09 Hui Zhu <teawater@gmail.com> * solib.c (solib_bfd_open): Output a warning if solib's @@ -60,7 +66,7 @@ Fix hang in floating varobjs. - * varob.c (varobj_invalidate): Advance to next + * varobj.c (varobj_invalidate): Advance to next element when processing floating varobj. 2009-07-07 Vladimir Prus <vladimir@codesourcery.com> diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c index 79d468e..5072b29 100644 --- a/gdb/cli/cli-dump.c +++ b/gdb/cli/cli-dump.c @@ -30,6 +30,7 @@ #include <ctype.h> #include "target.h" #include "readline/readline.h" +#include "gdbcore.h" #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE))) @@ -246,7 +247,7 @@ dump_memory_to_file (char *cmd, char *mode, char *file_format) value. */ buf = xmalloc (count); make_cleanup (xfree, buf); - target_read_memory (lo, buf, count); + read_memory (lo, buf, count); /* Have everything. Open/write the data. */ if (file_format == NULL || strcmp (file_format, "binary") == 0) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index b6a2025..3409002 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2009-07-09 Jan Kratochvil <jan.kratochvil@redhat.com> + + * gdb.base/dump.exp (inaccessible memory is reported): New test. + 2009-07-07 Tom Tromey <tromey@redhat.com> * gdb.base/call-rt-st.exp: Update for change to escape output. diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp index 072fcfd..4e616aa 100644 --- a/gdb/testsuite/gdb.base/dump.exp +++ b/gdb/testsuite/gdb.base/dump.exp @@ -58,6 +58,10 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${op gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir + +gdb_test "dump mem /dev/null 0x10 0x20" "Cannot access memory at address 0x10" \ + "inaccessible memory is reported" + gdb_load ${binfile} # Clean up any stale output files from previous test runs |