# GDB tcl entry point
# just initialize everything.

# set up preferences
pref init
manage init

# If running in the IDE, register the source window
if {$GDBTK_IDE} then {
  set reg [ide_window_register generic gdb \
	     [list idewindow_proc [list manage open src]]]
  bind_for_toplevel_only . <Destroy> \
    [list ide_window_register deregister $reg]
}

# some initial commands to get gdb in the right mode
gdb_cmd {set height 0}
gdb_cmd {set width 0}

# gdbtk_tcl_preloop() is called after gdb is initialized
# but before the mainloop is started.
proc gdbtk_tcl_preloop { } {
  
  # this will make sure a source window was created
  # and return its name to us.
  set src [manage open src]
  # get things started by assuming we want to see the file with
  # "main" in it.
  $src location 0 [gdb_loc main]
}
