commit de33df66fc64edf55aa81a7d08adccf911aa4fdf Author: Joel Brobecker Date: Tue Apr 14 15:23:25 2009 -0700 * stack.c (do_gdb_disassembly): Print an error message if an error was thrown while trying to perform the disassembly. diff --git a/gdb/stack.c b/gdb/stack.c index dfe3900..bbeff2c 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -507,6 +507,21 @@ do_gdb_disassembly (int how_many, CORE_ADDR low, CORE_ADDR high) { gdb_disassembly_stub (&args); } + /* If an exception was thrown while doing the disassembly, print + the error message, to give the user a clue of what happened. */ + if (exception.reason == RETURN_ERROR) + { + if (exception.error == MEMORY_ERROR) + { + /* For memory errors, prefer a short error message over + the error message provided in the exception. */ + gdb_flush (gdb_stdout); + gdb_flush (gdb_stderr); + fprintf_filtered (gdb_stderr, _("(cannot read memory)\n")); + } + else + exception_print (gdb_stderr, exception); + } } /* Print information about frame FRAME. The output is format according