//=======================================================================
//@V@:Note: This file generated by vgen V1.07 (10:55:46 14 Nov 1999).
//	gdbdlg.cpp:	Source for gdbDialog class
//=======================================================================
#include "videapp.h"
#include "videcmdw.h"
#include "gdbdlg.h"
#include "vdbcmdw.h"
#include <v/vnotice.h>

//@V@:BeginIDs
    enum {
    lblCmds = 3000,
    lblData,
    lblBPs,
    frmO
  };
//@V@:EndIds

#ifdef jdbjdb
	{"jdb: Print local variables",m_jdbLocals,notSens, notChk, noKeyLbl, noKey, noSub},
	{"jdb: List classes",m_jdbClasses,notSens, notChk, noKeyLbl, noKey, noSub},
	{"jdb: Run until return",m_jdbStepUp,notSens, notChk, noKeyLbl, noKey, noSub},
	{"jdb: Memory Usage",m_jdbMemory,notSens, notChk, noKeyLbl, noKey, noSub},
#endif

//@V@:BeginDialogCmd DefaultCmds
    static DialogCmd DefaultCmds[] =
      {
	{C_Frame, frmO, 0, "", NoList,CA_NoBorder | CA_NoSpace,isSens,NoFrame, 0,0},

	{C_Label, lblCmds, 0, "Commands",NoList,CA_None,
	    isSens,frmO,0, 0, 0 },

	{C_Button, m_DBRun, 0, "  RUN ",NoList,CA_None,
	    isSens,frmO,0, lblCmds, 0, "Run Program (debug)" },
	{C_Button, m_Continue, 0, " Cont ",NoList,CA_None,
	    isSens,frmO,m_DBRun, lblCmds, 0, "Continue execution from current point" },

	{C_Button, m_StepInto, 0, " Step ",NoList,CA_None,
	    isSens,frmO,0, m_DBRun, 0, "Step into current line" },
	{C_Button, m_StepOver, 0, " Next ",NoList,CA_None,
	    isSens,frmO,m_DBRun, m_DBRun, 0, "Step over current line to Next line" },

	{C_Button, m_RunTo, 0, " Until",NoList,CA_None,
	    isSens,frmO,0, m_StepInto, 0,
	       "Execute until reach line greater than currennt" },
	{C_Button, m_Kill, 0, " Kill ",NoList,CA_None,
	    isSens,frmO,m_DBRun, m_StepInto, 0, "Kill execution of program being debugged" },

	{C_Button, m_Up, 0, "  Up  ",NoList,CA_None,
	    isSens,frmO,0, m_RunTo, 0, "Move Up Stack Frame" },
	{C_Button, m_Down, 0, " Down ",NoList,CA_None,
	    isSens,frmO,m_DBRun, m_RunTo, 0, "Move Down Stack Frame" },

	{C_Label, lblData, 0, "Display Values",NoList,CA_None,
	    isSens,frmO,0, m_Up, 0 },

	{C_Button, m_Args, 0, " Args ",NoList,CA_None,
	    isSens,frmO,0, lblData, 0, "Print arguments to current function" },
	{C_Button, m_CallStack, 0, " Stack",NoList,CA_None,
	    isSens,frmO,m_DBRun, lblData, 0, "Show call backtrack of stack" },

	{C_Button, m_Inspect, 0, " Print",NoList,CA_None,
	    isSens,frmO,0, m_Args, 0, "Print value of highlighted expression" },
	{C_Button, m_InspectInd, 0, "Print*",NoList,CA_None,
	    isSens,frmO,m_DBRun, m_Args, 0, "Print *(value) of highlighted expression" },

	{C_Button, m_Locals, 0, "Locals",NoList,CA_None,
	    isSens,frmO,0, m_Inspect, 0, "Show local variabales" },
	{C_Button, m_DBHelp, 0, " Help ",NoList,CA_None,
	    isSens,frmO,m_DBRun, m_Inspect, 0, "Show gdb's help" },

	{C_Label, lblBPs, 0, "Breakpoints",NoList,CA_None,
	    isSens,frmO,0, m_Locals, 0 },

	{C_Button, m_SetBP, 0, " Set  ",NoList,CA_None,
	    isSens,frmO,0, lblBPs, 0, "Set breakpoint at current line" },
	{C_Button, m_DeleteBP, 0, "Delete",NoList,CA_None,
	    isSens,frmO,m_DBRun, lblBPs, 0, "Delete breakpoint at current line" },

	{C_Button, m_DeleteBreakpoints, 0, "DelAll",NoList,CA_None,
	    isSens,frmO,0, m_SetBP, 0, "Delete all breakpoints" },
	{C_Button, m_ShowBreakpoints, 0, " Show ",NoList,CA_None,
	    isSens,frmO,m_DBRun, m_SetBP, 0, "Show current preakpoints" },

#ifdef XXX
	{C_Button, m_XXXX, 0, "  XXXX  ",NoList,CA_None,
	    isSens,frmO,0, 0, 0, "XXXX" },
	{C_Button, m_XXXX, 0, "  XXXX  ",NoList,CA_None,
	    isSens,frmO,m_DBRun, 0, 0, "XXXX" },

	{C_Button, m_XXXX, 0, "  XXXX  ",NoList,CA_None,
	    isSens,frmO,0, 0, 0, "XXXX" },
	{C_Button, m_XXXX, 0, "  XXXX  ",NoList,CA_None,
	    isSens,frmO,m_DBRun, 0, 0, "XXXX" },

	{C_Button, m_XXXX, 0, "  XXXX  ",NoList,CA_None,
	    isSens,frmO,0, 0, 0, "XXXX" },
	{C_Button, m_XXXX, 0, "  XXXX  ",NoList,CA_None,
	    isSens,frmO,m_DBRun, 0, 0, "XXXX" },
#endif


	{C_EndOfList,0,0,0,0,CA_None,0,0,0}
    };
//@V@:EndDialogCmd


//=========================>>> gdbDialog::gdbDialog <<<====================
  gdbDialog::gdbDialog(vBaseWindow* bw, char* title) :
    vDialog(bw, 0, title)
  {
      UserDebug(Constructor,"gdbDialog::gdbDialog()\n")

    AddDialogCmds(DefaultCmds);		// add the predefined commands
  }

//========================>>> gdbDialog::~gdbDialog <<<====================
  gdbDialog::~gdbDialog()
  {
    UserDebug(Destructor,"gdbDialog::~gdbDialog() destructor\n")
  }

//====================>>> gdbDialog::DialogCommand <<<=======================
  void gdbDialog::DialogCommand(ItemVal id, ItemVal retval, CmdType ctype)
  {
    // Dialog commands to here

    // find the current window

    videCmdWindow* vcw = ((videApp*)theApp)->getCurCmdWin();
    if (!vcw)
	vcw = ((videApp*)theApp)->GetMsgWindow();	// try this one
    if (!vcw)
	return;

    ((videApp*)theApp)->debugCommand(vcw,id);	// and pass to the debugger
  }

