From ba569a7ebe749ea925008baf2b8ff4d1e4cd6cef Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 27 Aug 2017 18:36:25 +0200 Subject: 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. --- ddb/db_examine.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ddb/db_examine.c') 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(" "); -- cgit v1.2.3