OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [tui/] [tuiStack.c] - Diff between revs 107 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 107 Rev 1765
/*
/*
   ** This module contains functions for displaying the locator information in the locator window.
   ** This module contains functions for displaying the locator information in the locator window.
 */
 */
 
 
#include "defs.h"
#include "defs.h"
#include "symtab.h"
#include "symtab.h"
#include "breakpoint.h"
#include "breakpoint.h"
#include "frame.h"
#include "frame.h"
 
 
#include "tui.h"
#include "tui.h"
#include "tuiData.h"
#include "tuiData.h"
#include "tuiStack.h"
#include "tuiStack.h"
#include "tuiSourceWin.h"
#include "tuiSourceWin.h"
 
 
 
 
/*****************************************
/*****************************************
** STATIC LOCAL FUNCTIONS FORWARD DECLS    **
** STATIC LOCAL FUNCTIONS FORWARD DECLS    **
******************************************/
******************************************/
 
 
static char *_getFuncNameFromFrame PARAMS ((struct frame_info *));
static char *_getFuncNameFromFrame PARAMS ((struct frame_info *));
static void _tuiUpdateLocation_command PARAMS ((char *, int));
static void _tuiUpdateLocation_command PARAMS ((char *, int));
 
 
 
 
 
 
/*****************************************
/*****************************************
** PUBLIC FUNCTION                        **
** PUBLIC FUNCTION                        **
******************************************/
******************************************/
 
 
/*
/*
   ** tuiClearLocatorDisplay()
   ** tuiClearLocatorDisplay()
 */
 */
void
void
#ifdef __STDC__
#ifdef __STDC__
tuiClearLocatorDisplay (void)
tuiClearLocatorDisplay (void)
#else
#else
tuiClearLocatorDisplay ()
tuiClearLocatorDisplay ()
#endif
#endif
{
{
  TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
  TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
  int i;
  int i;
 
 
  if (locator->handle != (WINDOW *) NULL)
  if (locator->handle != (WINDOW *) NULL)
    {
    {
      /* No need to werase, since writing a line of
      /* No need to werase, since writing a line of
         * blanks which we do below, is equivalent.
         * blanks which we do below, is equivalent.
       */
       */
      /* werase(locator->handle); */
      /* werase(locator->handle); */
      wmove (locator->handle, 0, 0);
      wmove (locator->handle, 0, 0);
      wstandout (locator->handle);
      wstandout (locator->handle);
      for (i = 0; i < locator->width; i++)
      for (i = 0; i < locator->width; i++)
        waddch (locator->handle, ' ');
        waddch (locator->handle, ' ');
      wstandend (locator->handle);
      wstandend (locator->handle);
      tuiRefreshWin (locator);
      tuiRefreshWin (locator);
      wmove (locator->handle, 0, 0);
      wmove (locator->handle, 0, 0);
      locator->contentInUse = FALSE;
      locator->contentInUse = FALSE;
    }
    }
 
 
  return;
  return;
}                               /* tuiClearLocatorDisplay */
}                               /* tuiClearLocatorDisplay */
 
 
 
 
/*
/*
   ** tuiShowLocatorContent()
   ** tuiShowLocatorContent()
 */
 */
void
void
#ifdef __STDC__
#ifdef __STDC__
tuiShowLocatorContent (void)
tuiShowLocatorContent (void)
#else
#else
tuiShowLocatorContent ()
tuiShowLocatorContent ()
#endif
#endif
{
{
  char *string;
  char *string;
  TuiGenWinInfoPtr locator;
  TuiGenWinInfoPtr locator;
 
 
  locator = locatorWinInfoPtr ();
  locator = locatorWinInfoPtr ();
 
 
  if (m_genWinPtrNotNull (locator) && locator->handle != (WINDOW *) NULL)
  if (m_genWinPtrNotNull (locator) && locator->handle != (WINDOW *) NULL)
    {
    {
      string = displayableWinContentAt (locator, 0);
      string = displayableWinContentAt (locator, 0);
      if (string != (char *) NULL)
      if (string != (char *) NULL)
        {
        {
          wmove (locator->handle, 0, 0);
          wmove (locator->handle, 0, 0);
          wstandout (locator->handle);
          wstandout (locator->handle);
          waddstr (locator->handle, string);
          waddstr (locator->handle, string);
          wstandend (locator->handle);
          wstandend (locator->handle);
          tuiRefreshWin (locator);
          tuiRefreshWin (locator);
          wmove (locator->handle, 0, 0);
          wmove (locator->handle, 0, 0);
          if (string != nullStr ())
          if (string != nullStr ())
            tuiFree (string);
            tuiFree (string);
          locator->contentInUse = TRUE;
          locator->contentInUse = TRUE;
        }
        }
    }
    }
 
 
  return;
  return;
}                               /* tuiShowLocatorContent */
}                               /* tuiShowLocatorContent */
 
 
 
 
/*
/*
   ** tuiSetLocatorInfo().
   ** tuiSetLocatorInfo().
   **        Function to update the locator, with the provided arguments.
   **        Function to update the locator, with the provided arguments.
 */
 */
void
void
#ifdef __STDC__
#ifdef __STDC__
tuiSetLocatorInfo (
tuiSetLocatorInfo (
                    char *fname,
                    char *fname,
                    char *procname,
                    char *procname,
                    int lineNo,
                    int lineNo,
                    Opaque addr,
                    Opaque addr,
                    TuiLocatorElementPtr element)
                    TuiLocatorElementPtr element)
#else
#else
tuiSetLocatorInfo (fname, procname, lineNo, addr, element)
tuiSetLocatorInfo (fname, procname, lineNo, addr, element)
     char *fname;
     char *fname;
     char *procname;
     char *procname;
     int lineNo;
     int lineNo;
     Opaque addr;
     Opaque addr;
     TuiLocatorElementPtr element;
     TuiLocatorElementPtr element;
#endif
#endif
{
{
#ifdef COMMENT
#ifdef COMMENT
  /* first free the old info */
  /* first free the old info */
  if (element->fileName)
  if (element->fileName)
    tuiFree (element->fileName);
    tuiFree (element->fileName);
  if (element->procName)
  if (element->procName)
    tuiFree (element->procName);
    tuiFree (element->procName);
 
 
  if (fname == (char *) NULL)
  if (fname == (char *) NULL)
    element->fileName = fname;
    element->fileName = fname;
  else
  else
    element->fileName = tuiStrDup (fname);
    element->fileName = tuiStrDup (fname);
  if (procname == (char *) NULL)
  if (procname == (char *) NULL)
    element->procName = procname;
    element->procName = procname;
  else
  else
    element->procName = tuiStrDup (procname);
    element->procName = tuiStrDup (procname);
#else
#else
  element->fileName[0] = (char) 0;
  element->fileName[0] = (char) 0;
  element->procName[0] = (char) 0;
  element->procName[0] = (char) 0;
  strcat_to_buf (element->fileName, MAX_LOCATOR_ELEMENT_LEN, fname);
  strcat_to_buf (element->fileName, MAX_LOCATOR_ELEMENT_LEN, fname);
  strcat_to_buf (element->procName, MAX_LOCATOR_ELEMENT_LEN, procname);
  strcat_to_buf (element->procName, MAX_LOCATOR_ELEMENT_LEN, procname);
#endif
#endif
  element->lineNo = lineNo;
  element->lineNo = lineNo;
  element->addr = (Opaque) addr;
  element->addr = (Opaque) addr;
 
 
  return;
  return;
}                               /* tuiSetLocatorInfo */
}                               /* tuiSetLocatorInfo */
 
 
 
 
/*
/*
   ** tuiUpdateLocatorFilename().
   ** tuiUpdateLocatorFilename().
   **        Update only the filename portion of the locator.
   **        Update only the filename portion of the locator.
 */
 */
void
void
#ifdef __STDC__
#ifdef __STDC__
tuiUpdateLocatorFilename (
tuiUpdateLocatorFilename (
                           char *fileName)
                           char *fileName)
#else
#else
tuiUpdateLocatorFilename (fileName)
tuiUpdateLocatorFilename (fileName)
     char *fileName;
     char *fileName;
#endif
#endif
{
{
  TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
  TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
 
 
  if (locator->content[0] == (Opaque) NULL)
  if (locator->content[0] == (Opaque) NULL)
    tuiSetLocatorContent ((struct frame_info *) NULL);
    tuiSetLocatorContent ((struct frame_info *) NULL);
  ((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName[0] = (char) 0;
  ((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName[0] = (char) 0;
  strcat_to_buf (((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName,
  strcat_to_buf (((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName,
                 MAX_LOCATOR_ELEMENT_LEN,
                 MAX_LOCATOR_ELEMENT_LEN,
                 fileName);
                 fileName);
 
 
  tuiShowLocatorContent ();
  tuiShowLocatorContent ();
 
 
  return;
  return;
}                               /* tuiUpdateLocatorFilename */
}                               /* tuiUpdateLocatorFilename */
 
 
 
 
/*
/*
   ** tui_vUpdateLocatorFilename().
   ** tui_vUpdateLocatorFilename().
   **        Update only the filename portion of the locator with args in a va_list.
   **        Update only the filename portion of the locator with args in a va_list.
 */
 */
void
void
#ifdef __STDC__
#ifdef __STDC__
tui_vUpdateLocatorFilename (
tui_vUpdateLocatorFilename (
                             va_list args)
                             va_list args)
#else
#else
tui_vUpdateLocatorFilename (args)
tui_vUpdateLocatorFilename (args)
     va_list args;
     va_list args;
#endif
#endif
{
{
  char *fileName;
  char *fileName;
 
 
  fileName = va_arg (args, char *);
  fileName = va_arg (args, char *);
  tuiUpdateLocatorFilename (fileName);
  tuiUpdateLocatorFilename (fileName);
 
 
  return;
  return;
}                               /* tui_vUpdateLocatorFilename */
}                               /* tui_vUpdateLocatorFilename */
 
 
 
 
/*
/*
   ** tuiSwitchFilename().
   ** tuiSwitchFilename().
   **   Update the filename portion of the locator. Clear the other info in locator.
   **   Update the filename portion of the locator. Clear the other info in locator.
   ** (elz)
   ** (elz)
 */
 */
void
void
#ifdef __STDC__
#ifdef __STDC__
tuiSwitchFilename (
tuiSwitchFilename (
                    char *fileName)
                    char *fileName)
#else
#else
tuiSwitchFilename (fileName)
tuiSwitchFilename (fileName)
     char *fileName;
     char *fileName;
#endif
#endif
{
{
  TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
  TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
 
 
  if (locator->content[0] == (Opaque) NULL)
  if (locator->content[0] == (Opaque) NULL)
    tuiSetLocatorContent ((struct frame_info *) NULL);
    tuiSetLocatorContent ((struct frame_info *) NULL);
  ((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName[0] = (char) 0;
  ((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName[0] = (char) 0;
 
 
  tuiSetLocatorInfo (fileName,
  tuiSetLocatorInfo (fileName,
                     (char *) NULL,
                     (char *) NULL,
                     0,
                     0,
                     (Opaque) NULL,
                     (Opaque) NULL,
           &((TuiWinElementPtr) locator->content[0])->whichElement.locator);
           &((TuiWinElementPtr) locator->content[0])->whichElement.locator);
 
 
  tuiShowLocatorContent ();
  tuiShowLocatorContent ();
 
 
  return;
  return;
}                               /* tuiSwitchFilename */
}                               /* tuiSwitchFilename */
 
 
 
 
/*
/*
   ** tuiGetLocatorFilename().
   ** tuiGetLocatorFilename().
   **   Get the filename portion of the locator.
   **   Get the filename portion of the locator.
   ** (elz)
   ** (elz)
 */
 */
void
void
#ifdef __STDC__
#ifdef __STDC__
tuiGetLocatorFilename (
tuiGetLocatorFilename (
                        TuiGenWinInfoPtr locator,
                        TuiGenWinInfoPtr locator,
                        char **filename)
                        char **filename)
#else
#else
tuiGetLocatorFilename (locator, filename)
tuiGetLocatorFilename (locator, filename)
     TuiGenWinInfoPtr locator;
     TuiGenWinInfoPtr locator;
     char **filename;
     char **filename;
#endif
#endif
{
{
 
 
  /* the current filename could be non known, in which case the xmalloc would
  /* the current filename could be non known, in which case the xmalloc would
     allocate no memory, because the length would be 0 */
     allocate no memory, because the length would be 0 */
  if (((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName)
  if (((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName)
    {
    {
      int name_length =
      int name_length =
      strlen (((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName);
      strlen (((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName);
 
 
      (*filename) = (char *) xmalloc (name_length + 1);
      (*filename) = (char *) xmalloc (name_length + 1);
      strcpy ((*filename),
      strcpy ((*filename),
              ((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName);
              ((TuiWinElementPtr) locator->content[0])->whichElement.locator.fileName);
    }
    }
 
 
  return;
  return;
}                               /* tuiGetLocatorFilename */
}                               /* tuiGetLocatorFilename */
 
 
 
 
/*
/*
   ** tuiUpdateLocatorInfoFromFrame().
   ** tuiUpdateLocatorInfoFromFrame().
   **        Function to update the locator, with the information extracted from frameInfo
   **        Function to update the locator, with the information extracted from frameInfo
 */
 */
void
void
#ifdef __STDC__
#ifdef __STDC__
tuiUpdateLocatorInfoFromFrame (
tuiUpdateLocatorInfoFromFrame (
                                struct frame_info *frameInfo,
                                struct frame_info *frameInfo,
                                TuiLocatorElementPtr element)
                                TuiLocatorElementPtr element)
#else
#else
tuiUpdateLocatorInfoFromFrame (frameInfo, element)
tuiUpdateLocatorInfoFromFrame (frameInfo, element)
     struct frame_info *frameInfo;
     struct frame_info *frameInfo;
     TuiLocatorElementPtr element;
     TuiLocatorElementPtr element;
#endif
#endif
{
{
  struct symtab_and_line symtabAndLine;
  struct symtab_and_line symtabAndLine;
 
 
  /* now get the new info */
  /* now get the new info */
  symtabAndLine = find_pc_line (frameInfo->pc,
  symtabAndLine = find_pc_line (frameInfo->pc,
                           (frameInfo->next != (struct frame_info *) NULL &&
                           (frameInfo->next != (struct frame_info *) NULL &&
                            !frameInfo->next->signal_handler_caller &&
                            !frameInfo->next->signal_handler_caller &&
                            !frame_in_dummy (frameInfo->next)));
                            !frame_in_dummy (frameInfo->next)));
  if (symtabAndLine.symtab && symtabAndLine.symtab->filename)
  if (symtabAndLine.symtab && symtabAndLine.symtab->filename)
    tuiSetLocatorInfo (symtabAndLine.symtab->filename,
    tuiSetLocatorInfo (symtabAndLine.symtab->filename,
                       _getFuncNameFromFrame (frameInfo),
                       _getFuncNameFromFrame (frameInfo),
                       symtabAndLine.line,
                       symtabAndLine.line,
                       (Opaque) frameInfo->pc,
                       (Opaque) frameInfo->pc,
                       element);
                       element);
  else
  else
    tuiSetLocatorInfo ((char *) NULL,
    tuiSetLocatorInfo ((char *) NULL,
                       _getFuncNameFromFrame (frameInfo),
                       _getFuncNameFromFrame (frameInfo),
                       0,
                       0,
                       (Opaque) frameInfo->pc,
                       (Opaque) frameInfo->pc,
                       element);
                       element);
 
 
  return;
  return;
}                               /* tuiUpdateLocatorInfoFromFrame */
}                               /* tuiUpdateLocatorInfoFromFrame */
 
 
 
 
/*
/*
   ** tuiSetLocatorContent().
   ** tuiSetLocatorContent().
   **        Function to set the content of the locator
   **        Function to set the content of the locator
 */
 */
void
void
#ifdef __STDC__
#ifdef __STDC__
tuiSetLocatorContent (
tuiSetLocatorContent (
                       struct frame_info *frameInfo)
                       struct frame_info *frameInfo)
#else
#else
tuiSetLocatorContent (frameInfo)
tuiSetLocatorContent (frameInfo)
     struct frame_info *frameInfo;
     struct frame_info *frameInfo;
#endif
#endif
{
{
  TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
  TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
  TuiWinElementPtr element;
  TuiWinElementPtr element;
  struct symtab_and_line symtabAndLine;
  struct symtab_and_line symtabAndLine;
 
 
  /* Allocate the element if necessary */
  /* Allocate the element if necessary */
  if (locator->contentSize <= 0)
  if (locator->contentSize <= 0)
    {
    {
      TuiWinContent contentPtr;
      TuiWinContent contentPtr;
 
 
      if ((locator->content = (OpaquePtr) allocContent (1, locator->type)) == (OpaquePtr) NULL)
      if ((locator->content = (OpaquePtr) allocContent (1, locator->type)) == (OpaquePtr) NULL)
        error ("Unable to Allocate Memory to Display Location.");
        error ("Unable to Allocate Memory to Display Location.");
      locator->contentSize = 1;
      locator->contentSize = 1;
    }
    }
 
 
  if (frameInfo != (struct frame_info *) NULL)
  if (frameInfo != (struct frame_info *) NULL)
    tuiUpdateLocatorInfoFromFrame (frameInfo,
    tuiUpdateLocatorInfoFromFrame (frameInfo,
           &((TuiWinElementPtr) locator->content[0])->whichElement.locator);
           &((TuiWinElementPtr) locator->content[0])->whichElement.locator);
  else
  else
    tuiSetLocatorInfo ((char *) NULL,
    tuiSetLocatorInfo ((char *) NULL,
                       (char *) NULL,
                       (char *) NULL,
                       0,
                       0,
                       (Opaque) NULL,
                       (Opaque) NULL,
           &((TuiWinElementPtr) locator->content[0])->whichElement.locator);
           &((TuiWinElementPtr) locator->content[0])->whichElement.locator);
  return;
  return;
}                               /* tuiSetLocatorContent */
}                               /* tuiSetLocatorContent */
 
 
 
 
/*
/*
   ** tuiUpdateLocatorDisplay().
   ** tuiUpdateLocatorDisplay().
   **        Function to update the locator display
   **        Function to update the locator display
 */
 */
void
void
#ifdef __STDC__
#ifdef __STDC__
tuiUpdateLocatorDisplay (
tuiUpdateLocatorDisplay (
                          struct frame_info *frameInfo)
                          struct frame_info *frameInfo)
#else
#else
tuiUpdateLocatorDisplay (frameInfo)
tuiUpdateLocatorDisplay (frameInfo)
     struct frame_info *frameInfo;
     struct frame_info *frameInfo;
#endif
#endif
{
{
  tuiClearLocatorDisplay ();
  tuiClearLocatorDisplay ();
  tuiSetLocatorContent (frameInfo);
  tuiSetLocatorContent (frameInfo);
  tuiShowLocatorContent ();
  tuiShowLocatorContent ();
 
 
  return;
  return;
}                               /* tuiUpdateLocatorDisplay */
}                               /* tuiUpdateLocatorDisplay */
 
 
 
 
/*
/*
   ** tuiShowFrameInfo().
   ** tuiShowFrameInfo().
   **        Function to print the frame inforrmation for the TUI.
   **        Function to print the frame inforrmation for the TUI.
 */
 */
void
void
#ifdef __STDC__
#ifdef __STDC__
tuiShowFrameInfo (
tuiShowFrameInfo (
                   struct frame_info *fi)
                   struct frame_info *fi)
#else
#else
tuiShowFrameInfo (fi)
tuiShowFrameInfo (fi)
     struct frame_info *fi;
     struct frame_info *fi;
#endif
#endif
{
{
  TuiWinInfoPtr winInfo;
  TuiWinInfoPtr winInfo;
  register int i;
  register int i;
 
 
  if (fi)
  if (fi)
    {
    {
      register int startLine, i;
      register int startLine, i;
      register struct symtab *s;
      register struct symtab *s;
      CORE_ADDR low;
      CORE_ADDR low;
      TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
      TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
      int sourceAlreadyDisplayed;
      int sourceAlreadyDisplayed;
 
 
 
 
      s = find_pc_symtab (fi->pc);
      s = find_pc_symtab (fi->pc);
      sourceAlreadyDisplayed = tuiSourceIsDisplayed (s->filename);
      sourceAlreadyDisplayed = tuiSourceIsDisplayed (s->filename);
      tuiUpdateLocatorDisplay (fi);
      tuiUpdateLocatorDisplay (fi);
      for (i = 0; i < (sourceWindows ())->count; i++)
      for (i = 0; i < (sourceWindows ())->count; i++)
        {
        {
          winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[i];
          winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[i];
          if (winInfo == srcWin)
          if (winInfo == srcWin)
            {
            {
              startLine =
              startLine =
                (((TuiWinElementPtr) locator->content[0])->whichElement.locator.lineNo -
                (((TuiWinElementPtr) locator->content[0])->whichElement.locator.lineNo -
                 (winInfo->generic.viewportHeight / 2)) + 1;
                 (winInfo->generic.viewportHeight / 2)) + 1;
              if (startLine <= 0)
              if (startLine <= 0)
                startLine = 1;
                startLine = 1;
            }
            }
          else
          else
            {
            {
              if (find_pc_partial_function (fi->pc, (char **) NULL, &low, (CORE_ADDR) NULL) == 0)
              if (find_pc_partial_function (fi->pc, (char **) NULL, &low, (CORE_ADDR) NULL) == 0)
                error ("No function contains program counter for selected frame.\n");
                error ("No function contains program counter for selected frame.\n");
              else
              else
                low = (CORE_ADDR) tuiGetLowDisassemblyAddress ((Opaque) low, (Opaque) fi->pc);
                low = (CORE_ADDR) tuiGetLowDisassemblyAddress ((Opaque) low, (Opaque) fi->pc);
            }
            }
 
 
          if (winInfo == srcWin)
          if (winInfo == srcWin)
            {
            {
              if (!(sourceAlreadyDisplayed && m_tuiLineDisplayedWithinThreshold (
              if (!(sourceAlreadyDisplayed && m_tuiLineDisplayedWithinThreshold (
                                                                    winInfo,
                                                                    winInfo,
                                                                                  ((TuiWinElementPtr) locator->content[0])->whichElement.locator.lineNo)))
                                                                                  ((TuiWinElementPtr) locator->content[0])->whichElement.locator.lineNo)))
                tuiUpdateSourceWindow (winInfo, s, (Opaque) startLine, TRUE);
                tuiUpdateSourceWindow (winInfo, s, (Opaque) startLine, TRUE);
              else
              else
                tuiSetIsExecPointAt ((Opaque)
                tuiSetIsExecPointAt ((Opaque)
                                     ((TuiWinElementPtr) locator->content[0])->whichElement.locator.lineNo,
                                     ((TuiWinElementPtr) locator->content[0])->whichElement.locator.lineNo,
                                     winInfo);
                                     winInfo);
            }
            }
          else
          else
            {
            {
              if (winInfo == disassemWin)
              if (winInfo == disassemWin)
                {
                {
                  if (!m_tuiLineDisplayedWithinThreshold (winInfo,
                  if (!m_tuiLineDisplayedWithinThreshold (winInfo,
                                                          ((TuiWinElementPtr) locator->content[0])->whichElement.locator.addr))
                                                          ((TuiWinElementPtr) locator->content[0])->whichElement.locator.addr))
                    tuiUpdateSourceWindow (winInfo, s, (Opaque) low, TRUE);
                    tuiUpdateSourceWindow (winInfo, s, (Opaque) low, TRUE);
                  else
                  else
                    tuiSetIsExecPointAt ((Opaque)
                    tuiSetIsExecPointAt ((Opaque)
                                         ((TuiWinElementPtr) locator->content[0])->whichElement.locator.addr,
                                         ((TuiWinElementPtr) locator->content[0])->whichElement.locator.addr,
                                         winInfo);
                                         winInfo);
                }
                }
            }
            }
          tuiUpdateExecInfo (winInfo);
          tuiUpdateExecInfo (winInfo);
        }
        }
    }
    }
  else
  else
    {
    {
      tuiUpdateLocatorDisplay (fi);
      tuiUpdateLocatorDisplay (fi);
      for (i = 0; i < (sourceWindows ())->count; i++)
      for (i = 0; i < (sourceWindows ())->count; i++)
        {
        {
          winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[i];
          winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[i];
          tuiClearSourceContent (winInfo, EMPTY_SOURCE_PROMPT);
          tuiClearSourceContent (winInfo, EMPTY_SOURCE_PROMPT);
          tuiUpdateExecInfo (winInfo);
          tuiUpdateExecInfo (winInfo);
        }
        }
    }
    }
 
 
  return;
  return;
}                               /* tuiShowFrameInfo */
}                               /* tuiShowFrameInfo */
 
 
 
 
/*
/*
   ** tui_vShowFrameInfo().
   ** tui_vShowFrameInfo().
   **        Function to print the frame inforrmation for the TUI with args in a va_list.
   **        Function to print the frame inforrmation for the TUI with args in a va_list.
 */
 */
void
void
#ifdef __STDC__
#ifdef __STDC__
tui_vShowFrameInfo (
tui_vShowFrameInfo (
                     va_list args)
                     va_list args)
#else
#else
tui_vShowFrameInfo (args)
tui_vShowFrameInfo (args)
     va_list args;
     va_list args;
#endif
#endif
{
{
  struct frame_info *fi;
  struct frame_info *fi;
 
 
  fi = va_arg (args, struct frame_info *);
  fi = va_arg (args, struct frame_info *);
  tuiShowFrameInfo (fi);
  tuiShowFrameInfo (fi);
 
 
  return;
  return;
}                               /* tui_vShowFrameInfo */
}                               /* tui_vShowFrameInfo */
 
 
 
 
/*
/*
   ** _initialize_tuiStack().
   ** _initialize_tuiStack().
   **      Function to initialize gdb commands, for tui window stack manipulation.
   **      Function to initialize gdb commands, for tui window stack manipulation.
 */
 */
void
void
_initialize_tuiStack ()
_initialize_tuiStack ()
{
{
  if (tui_version)
  if (tui_version)
    {
    {
      add_com ("update", class_tui, _tuiUpdateLocation_command,
      add_com ("update", class_tui, _tuiUpdateLocation_command,
               "Update the source window and locator to display the current execution point.\n");
               "Update the source window and locator to display the current execution point.\n");
    }
    }
 
 
  return;
  return;
}                               /* _initialize_tuiStack */
}                               /* _initialize_tuiStack */
 
 
 
 
/*****************************************
/*****************************************
** STATIC LOCAL FUNCTIONS                 **
** STATIC LOCAL FUNCTIONS                 **
******************************************/
******************************************/
 
 
/*
/*
   **    _getFuncNameFromFrame().
   **    _getFuncNameFromFrame().
 */
 */
static char *
static char *
#ifdef __STDC__
#ifdef __STDC__
_getFuncNameFromFrame (
_getFuncNameFromFrame (
                        struct frame_info *frameInfo)
                        struct frame_info *frameInfo)
#else
#else
_getFuncNameFromFrame (frameInfo)
_getFuncNameFromFrame (frameInfo)
     struct frame_info *frameInfo;
     struct frame_info *frameInfo;
#endif
#endif
{
{
  char *funcName = (char *) NULL;
  char *funcName = (char *) NULL;
 
 
  find_pc_partial_function (frameInfo->pc,
  find_pc_partial_function (frameInfo->pc,
                            &funcName,
                            &funcName,
                            (CORE_ADDR *) NULL,
                            (CORE_ADDR *) NULL,
                            (CORE_ADDR *) NULL);
                            (CORE_ADDR *) NULL);
  return funcName;
  return funcName;
}                               /* _getFuncNameFromFrame */
}                               /* _getFuncNameFromFrame */
 
 
 
 
/*
/*
   ** _tuiUpdateLocation_command().
   ** _tuiUpdateLocation_command().
   **        Command to update the display with the current execution point
   **        Command to update the display with the current execution point
 */
 */
static void
static void
#ifdef __STDC__
#ifdef __STDC__
_tuiUpdateLocation_command (
_tuiUpdateLocation_command (
                             char *arg,
                             char *arg,
                             int fromTTY)
                             int fromTTY)
#else
#else
_tuiUpdateLocation_command (arg, fromTTY)
_tuiUpdateLocation_command (arg, fromTTY)
     char *arg;
     char *arg;
     int fromTTY;
     int fromTTY;
#endif
#endif
{
{
#ifndef TRY
#ifndef TRY
  extern void frame_command PARAMS ((char *, int));
  extern void frame_command PARAMS ((char *, int));
  frame_command ("0", FALSE);
  frame_command ("0", FALSE);
#else
#else
  struct frame_info *curFrame;
  struct frame_info *curFrame;
 
 
  /* Obtain the current execution point */
  /* Obtain the current execution point */
  if ((curFrame = get_current_frame ()) != (struct frame_info *) NULL)
  if ((curFrame = get_current_frame ()) != (struct frame_info *) NULL)
    {
    {
      struct frame_info *frame;
      struct frame_info *frame;
      int curLevel = 0;
      int curLevel = 0;
 
 
      for (frame = get_prev_frame (curLevel);
      for (frame = get_prev_frame (curLevel);
           (frame != (struct frame_info *) NULL && (frame != curFrame));
           (frame != (struct frame_info *) NULL && (frame != curFrame));
           frame = get_prev_frame (frame))
           frame = get_prev_frame (frame))
        curLevel++;
        curLevel++;
 
 
      if (curFrame != (struct frame_info *) NULL)
      if (curFrame != (struct frame_info *) NULL)
        print_frame_info (frame, curLevel, 0, 1);
        print_frame_info (frame, curLevel, 0, 1);
    }
    }
#endif
#endif
 
 
  return;
  return;
}                               /* _tuiUpdateLocation_command */
}                               /* _tuiUpdateLocation_command */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.