OSDN Git Service

* generic/gdbtk-cmds.c (gdb_entry_point): Return an empty
authorKeith Seitz <keiths@redhat.com>
Mon, 23 Apr 2001 20:28:28 +0000 (20:28 +0000)
committerKeith Seitz <keiths@redhat.com>
Mon, 23 Apr 2001 20:28:28 +0000 (20:28 +0000)
string when there is no active target (i.e., there is no
entry point to return yet).

gdb/gdbtk/ChangeLog
gdb/gdbtk/generic/gdbtk-cmds.c

index 0c1c64b..21d76cd 100644 (file)
        the event notification.
        (gdbtk_delete_tracepoints): Ditto for tracepoints.
 
+       * generic/gdbtk-cmds.c (gdb_entry_point): Return an empty
+       string when there is no active target (i.e., there is no
+       entry point to return yet).
+
 2001-04-20  Keith Seitz  <keiths@cygnus.com>
 
        * library/srctextwin.ith (handle_set_hook): Rename to set_variable.
index 4d9622a..08b5a92 100644 (file)
@@ -3335,8 +3335,16 @@ gdb_entry_point (clientData, interp, objc, objv)
 {
   char *addrstr;
 
-  addrstr = paddr_nz (entry_point_address ());
-  Tcl_SetStringObj (result_ptr->obj_ptr, addrstr, -1);
+  /* If we have not yet loaded an exec file, then we have no
+     entry point, so return an empty string.*/
+  if ((int) current_target.to_stratum > (int) dummy_stratum)
+    {
+      addrstr = paddr_nz (entry_point_address ());
+      Tcl_SetStringObj (result_ptr->obj_ptr, addrstr, -1);
+    }
+  else
+    Tcl_SetStringObj (result_ptr->obj_ptr, "", -1);
+
   return TCL_OK;
 }