2 * File display.c - display handling for Wine internal debugger.
4 * Copyright (C) 1997, Eric Youngdale.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <sys/types.h>
30 #define MAX_DISPLAY 25
39 static struct display displaypoints[MAX_DISPLAY];
42 DEBUG_AddDisplay(struct expr * exp, int count, char format)
47 * First find a slot where we can store this display.
49 for(i=0; i < MAX_DISPLAY; i++ )
51 if( displaypoints[i].exp == NULL )
53 displaypoints[i].exp = DEBUG_CloneExpr(exp);
54 displaypoints[i].count = count;
55 displaypoints[i].format = format;
64 DEBUG_InfoDisplay(void)
69 * First find a slot where we can store this display.
71 for(i=0; i < MAX_DISPLAY; i++ )
73 if( displaypoints[i].exp != NULL )
75 DEBUG_Printf(DBG_CHN_MESG, "%d : ", i+1);
76 DEBUG_DisplayExpr(displaypoints[i].exp);
77 DEBUG_Printf(DBG_CHN_MESG, "\n");
91 * First find a slot where we can store this display.
93 for(i=0; i < MAX_DISPLAY; i++ )
95 if( displaypoints[i].exp != NULL )
97 value = DEBUG_EvalExpr(displaypoints[i].exp);
98 if( value.type == NULL )
100 DEBUG_Printf(DBG_CHN_MESG, "Unable to evaluate expression ");
101 DEBUG_DisplayExpr(displaypoints[i].exp);
102 DEBUG_Printf(DBG_CHN_MESG, "\nDisabling...\n");
107 DEBUG_Printf(DBG_CHN_MESG, "%d : ", i + 1);
108 DEBUG_DisplayExpr(displaypoints[i].exp);
109 DEBUG_Printf(DBG_CHN_MESG, " = ");
110 if( displaypoints[i].format == 'i' )
112 DEBUG_ExamineMemory( &value,
113 displaypoints[i].count,
114 displaypoints[i].format);
119 displaypoints[i].count,
120 displaypoints[i].format, 0);
130 DEBUG_DelDisplay(int displaynum)
134 if( displaynum >= MAX_DISPLAY || displaynum == 0 || displaynum < -1 )
136 DEBUG_Printf(DBG_CHN_MESG, "Invalid display number\n");
139 if( displaynum == -1 )
141 for(i=0; i < MAX_DISPLAY; i++ )
143 if( displaypoints[i].exp != NULL )
145 DEBUG_FreeExpr(displaypoints[i].exp);
146 displaypoints[i].exp = NULL;
150 else if( displaypoints[displaynum - 1].exp != NULL )
152 DEBUG_FreeExpr(displaypoints[displaynum - 1].exp);
153 displaypoints[displaynum - 1].exp = NULL;