2 * File display.c - display handling for Wine internal debugger.
4 * Copyright (C) 1997, Eric Youngdale.
12 #include <sys/types.h>
18 #define MAX_DISPLAY 25
27 static struct display displaypoints
[MAX_DISPLAY
];
30 DEBUG_AddDisplay(struct expr
* exp
, int count
, char format
)
35 * First find a slot where we can store this display.
37 for(i
=0; i
< MAX_DISPLAY
; i
++ )
39 if( displaypoints
[i
].exp
== NULL
)
41 displaypoints
[i
].exp
= DEBUG_CloneExpr(exp
);
42 displaypoints
[i
].count
= count
;
43 displaypoints
[i
].format
= format
;
52 DEBUG_InfoDisplay(void)
57 * First find a slot where we can store this display.
59 for(i
=0; i
< MAX_DISPLAY
; i
++ )
61 if( displaypoints
[i
].exp
!= NULL
)
63 DEBUG_Printf(DBG_CHN_MESG
, "%d : ", i
+1);
64 DEBUG_DisplayExpr(displaypoints
[i
].exp
);
65 DEBUG_Printf(DBG_CHN_MESG
, "\n");
79 * First find a slot where we can store this display.
81 for(i
=0; i
< MAX_DISPLAY
; i
++ )
83 if( displaypoints
[i
].exp
!= NULL
)
85 value
= DEBUG_EvalExpr(displaypoints
[i
].exp
);
86 if( value
.type
== NULL
)
88 DEBUG_Printf(DBG_CHN_MESG
, "Unable to evaluate expression ");
89 DEBUG_DisplayExpr(displaypoints
[i
].exp
);
90 DEBUG_Printf(DBG_CHN_MESG
, "\nDisabling...\n");
95 DEBUG_Printf(DBG_CHN_MESG
, "%d : ", i
+ 1);
96 DEBUG_DisplayExpr(displaypoints
[i
].exp
);
97 DEBUG_Printf(DBG_CHN_MESG
, " = ");
98 if( displaypoints
[i
].format
== 'i' )
100 DEBUG_ExamineMemory( &value
,
101 displaypoints
[i
].count
,
102 displaypoints
[i
].format
);
107 displaypoints
[i
].count
,
108 displaypoints
[i
].format
, 0);
118 DEBUG_DelDisplay(int displaynum
)
122 if( displaynum
>= MAX_DISPLAY
|| displaynum
== 0 || displaynum
< -1 )
124 DEBUG_Printf(DBG_CHN_MESG
, "Invalid display number\n");
127 if( displaynum
== -1 )
129 for(i
=0; i
< MAX_DISPLAY
; i
++ )
131 if( displaypoints
[i
].exp
!= NULL
)
133 DEBUG_FreeExpr(displaypoints
[i
].exp
);
134 displaypoints
[i
].exp
= NULL
;
138 else if( displaypoints
[displaynum
- 1].exp
!= NULL
)
140 DEBUG_FreeExpr(displaypoints
[displaynum
- 1].exp
);
141 displaypoints
[displaynum
- 1].exp
= NULL
;