2 * File display.c - display handling for Wine internal debugger.
4 * Copyright (C) 1997, Eric Youngdale.
11 #include <sys/types.h>
17 #define MAX_DISPLAY 25
26 static struct display displaypoints
[MAX_DISPLAY
];
29 DEBUG_AddDisplay(struct expr
* exp
, int count
, char format
)
34 * First find a slot where we can store this display.
36 for(i
=0; i
< MAX_DISPLAY
; i
++ )
38 if( displaypoints
[i
].exp
== NULL
)
40 displaypoints
[i
].exp
= DEBUG_CloneExpr(exp
);
41 displaypoints
[i
].count
= count
;
42 displaypoints
[i
].format
= format
;
51 DEBUG_InfoDisplay(void)
56 * First find a slot where we can store this display.
58 for(i
=0; i
< MAX_DISPLAY
; i
++ )
60 if( displaypoints
[i
].exp
!= NULL
)
62 DEBUG_Printf(DBG_CHN_MESG
, "%d : ", i
+1);
63 DEBUG_DisplayExpr(displaypoints
[i
].exp
);
64 DEBUG_Printf(DBG_CHN_MESG
, "\n");
78 * First find a slot where we can store this display.
80 for(i
=0; i
< MAX_DISPLAY
; i
++ )
82 if( displaypoints
[i
].exp
!= NULL
)
84 value
= DEBUG_EvalExpr(displaypoints
[i
].exp
);
85 if( value
.type
== NULL
)
87 DEBUG_Printf(DBG_CHN_MESG
, "Unable to evaluate expression ");
88 DEBUG_DisplayExpr(displaypoints
[i
].exp
);
89 DEBUG_Printf(DBG_CHN_MESG
, "\nDisabling...\n");
94 DEBUG_Printf(DBG_CHN_MESG
, "%d : ", i
+ 1);
95 DEBUG_DisplayExpr(displaypoints
[i
].exp
);
96 DEBUG_Printf(DBG_CHN_MESG
, " = ");
97 if( displaypoints
[i
].format
== 'i' )
99 DEBUG_ExamineMemory( &value
,
100 displaypoints
[i
].count
,
101 displaypoints
[i
].format
);
106 displaypoints
[i
].count
,
107 displaypoints
[i
].format
, 0);
117 DEBUG_DelDisplay(int displaynum
)
121 if( displaynum
>= MAX_DISPLAY
|| displaynum
== 0 || displaynum
< -1 )
123 DEBUG_Printf(DBG_CHN_MESG
, "Invalid display number\n");
126 if( displaynum
== -1 )
128 for(i
=0; i
< MAX_DISPLAY
; i
++ )
130 if( displaypoints
[i
].exp
!= NULL
)
132 DEBUG_FreeExpr(displaypoints
[i
].exp
);
133 displaypoints
[i
].exp
= NULL
;
137 else if( displaypoints
[displaynum
- 1].exp
!= NULL
)
139 DEBUG_FreeExpr(displaypoints
[displaynum
- 1].exp
);
140 displaypoints
[displaynum
- 1].exp
= NULL
;