diff options
author | Pedro Alves <palves@redhat.com> | 2011-03-22 14:39:40 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2011-03-22 14:39:40 +0000 |
commit | ce406537179aa72cf126062f938ceed5eae0de4c (patch) | |
tree | ba934be238faa92922d726d0dba7751ddf29ad4b /gdb/infcmd.c | |
parent | da5d4055636ade8701e93544b7b1120bf7afedca (diff) | |
download | fsf-binutils-gdb-ce406537179aa72cf126062f938ceed5eae0de4c.zip fsf-binutils-gdb-ce406537179aa72cf126062f938ceed5eae0de4c.tar.gz fsf-binutils-gdb-ce406537179aa72cf126062f938ceed5eae0de4c.tar.bz2 |
* infcmd.c (post_create_inferior): Ignore NOT_AVAILABLE_ERROR
errors when reading the `stop_pc'.
* printcmd.c (pc_prefix): Use get_frame_pc_if_available instead of
get_frame_pc.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r-- | gdb/infcmd.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 8a85915..3dc13e3 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -395,6 +395,8 @@ strip_bg_char (char **args) void post_create_inferior (struct target_ops *target, int from_tty) { + volatile struct gdb_exception ex; + /* Be sure we own the terminal in case write operations are performed. */ target_terminal_ours (); @@ -404,8 +406,16 @@ post_create_inferior (struct target_ops *target, int from_tty) don't need to. */ target_find_description (); - /* Now that we know the register layout, retrieve current PC. */ - stop_pc = regcache_read_pc (get_current_regcache ()); + /* Now that we know the register layout, retrieve current PC. But + if the PC is unavailable (e.g., we're opening a core file with + missing registers info), ignore it. */ + stop_pc = 0; + TRY_CATCH (ex, RETURN_MASK_ERROR) + { + stop_pc = regcache_read_pc (get_current_regcache ()); + } + if (ex.reason < 0 && ex.error != NOT_AVAILABLE_ERROR) + throw_exception (ex); if (exec_bfd) { |