diff -Naur gdb-6.3/gdb/gdbtk/generic/gdbtk-cmds.c gdb-6.3-modified/gdb/gdbtk/generic/gdbtk-cmds.c --- gdb-6.3/gdb/gdbtk/generic/gdbtk-cmds.c 2005-05-15 21:49:09.000000000 -1100 +++ gdb-6.3-modified/gdb/gdbtk/generic/gdbtk-cmds.c 2005-05-17 16:46:58.164964427 -1100 @@ -2114,8 +2114,18 @@ if (objc == 1) { - if (deprecated_selected_frame - && (get_frame_pc (deprecated_selected_frame) != read_pc ())) + /* This function can be called, before the target is properly + set-up, the following prevents an error, by trying to + read_pc when there is no pc to read. It defaults pc, + before the target is connected to the entry point of the + program */ + if (!target_has_registers) + { + pc = entry_point_address (); + sal = find_pc_line (pc, 0); + } + else if (deprecated_selected_frame + && (get_frame_pc (deprecated_selected_frame) != read_pc ())) { /* Note - this next line is not correct on all architectures. For a graphical debugger we really want to highlight the