2 * File display.c - display handling for Wine internal debugger.
4 * Copyright (C) 1997, Eric Youngdale.
12 #include <sys/types.h>
16 #include "selectors.h"
21 #define MAX_DISPLAY 25
30 static struct display displaypoints[MAX_DISPLAY];
33 DEBUG_AddDisplay(struct expr * exp, int count, char format)
38 * First find a slot where we can store this display.
40 for(i=0; i < MAX_DISPLAY; i++ )
42 if( displaypoints[i].exp == NULL )
44 displaypoints[i].exp = DEBUG_CloneExpr(exp);
45 displaypoints[i].count = count;
46 displaypoints[i].format = format;
60 * First find a slot where we can store this display.
62 for(i=0; i < MAX_DISPLAY; i++ )
64 if( displaypoints[i].exp != NULL )
66 fprintf(stderr, "%d : ", i+1);
67 DEBUG_DisplayExpr(displaypoints[i].exp);
68 fprintf(stderr, "\n");
82 * First find a slot where we can store this display.
84 for(i=0; i < MAX_DISPLAY; i++ )
86 if( displaypoints[i].exp != NULL )
88 addr = DEBUG_EvalExpr(displaypoints[i].exp);
89 if( addr.type == NULL )
91 fprintf(stderr, "Unable to evaluate expression ");
92 DEBUG_DisplayExpr(displaypoints[i].exp);
93 fprintf(stderr, "\nDisabling...\n");
98 fprintf(stderr, "%d : ", i + 1);
99 DEBUG_DisplayExpr(displaypoints[i].exp);
100 fprintf(stderr, " = ");
101 if( displaypoints[i].format == 'i' )
103 DEBUG_ExamineMemory( &addr,
104 displaypoints[i].count,
105 displaypoints[i].format);
110 displaypoints[i].count,
111 displaypoints[i].format, 0);
121 DEBUG_DelDisplay(int displaynum)
125 if( displaynum >= MAX_DISPLAY || displaynum == 0 || displaynum < -1 )
127 fprintf(stderr, "Invalid display number\n");
130 if( displaynum == -1 )
132 for(i=0; i < MAX_DISPLAY; i++ )
134 if( displaypoints[i].exp != NULL )
136 DEBUG_FreeExpr(displaypoints[i].exp);
137 displaypoints[i].exp = NULL;
141 else if( displaypoints[displaynum - 1].exp != NULL )
143 DEBUG_FreeExpr(displaypoints[displaynum - 1].exp);
144 displaypoints[displaynum - 1].exp = NULL;