summaryrefslogtreecommitdiff
path: root/ddb
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2017-08-27 18:36:25 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2017-08-27 18:36:25 +0200
commitba569a7ebe749ea925008baf2b8ff4d1e4cd6cef (patch)
treeb02d38133b9798c402e43897164a67094b4665d1 /ddb
parent7913f633c6fea18d8c6683ad465617d54c9eb535 (diff)
ddb: More gracefully handle address errors
* i386/i386/db_interface.h (db_read_bytes): Return boolean_t instead of void. * i386/i386/db_interface.c (db_user_to_kernel_address): Return -1 instead of calling db_error() if address is bogus. (db_read_bytes): Return FALSE instead of calling db_error() if address is bogus. * ddb/db_access.c (db_get_task_value): Return 0 if db_read_bytes failed. * ddb/db_examine.c (db_xcdump): Only print * if db_read_bytes failed.
Diffstat (limited to 'ddb')
-rw-r--r--ddb/db_access.c3
-rw-r--r--ddb/db_examine.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/ddb/db_access.c b/ddb/db_access.c
index 16d4d3ef..509c1ba4 100644
--- a/ddb/db_access.c
+++ b/ddb/db_access.c
@@ -72,7 +72,8 @@ db_get_task_value(
db_expr_t value;
int i;
- db_read_bytes(addr, size, data, task);
+ if (!db_read_bytes(addr, size, data, task))
+ return 0;
value = 0;
#if BYTE_MSF
diff --git a/ddb/db_examine.c b/ddb/db_examine.c
index 836b0e89..6f94b686 100644
--- a/ddb/db_examine.c
+++ b/ddb/db_examine.c
@@ -473,7 +473,10 @@ db_xcdump(
if (!DB_CHECK_ACCESS(next_page_addr, sizeof(int), task))
bcount = next_page_addr - addr;
}
- db_read_bytes(addr, bcount, data, task);
+ if (!db_read_bytes(addr, bcount, data, task)) {
+ db_printf("*\n");
+ continue;
+ }
for (i = 0; i < bcount && off != 0; i += size) {
if (i % 4 == 0)
db_printf(" ");