2 * File display.c - display handling for Wine internal debugger.
4 * Copyright (C) 1997, Eric Youngdale.
12 #include <sys/types.h>
15 #include "selectors.h"
20 #define MAX_DISPLAY 25
29 static struct display displaypoints
[MAX_DISPLAY
];
32 DEBUG_AddDisplay(struct expr
* exp
, int count
, char format
)
37 * First find a slot where we can store this display.
39 for(i
=0; i
< MAX_DISPLAY
; i
++ )
41 if( displaypoints
[i
].exp
== NULL
)
43 displaypoints
[i
].exp
= DEBUG_CloneExpr(exp
);
44 displaypoints
[i
].count
= count
;
45 displaypoints
[i
].format
= format
;
59 * First find a slot where we can store this display.
61 for(i
=0; i
< MAX_DISPLAY
; i
++ )
63 if( displaypoints
[i
].exp
!= NULL
)
65 fprintf(stderr
, "%d : ", i
+1);
66 DEBUG_DisplayExpr(displaypoints
[i
].exp
);
67 fprintf(stderr
, "\n");
81 * First find a slot where we can store this display.
83 for(i
=0; i
< MAX_DISPLAY
; i
++ )
85 if( displaypoints
[i
].exp
!= NULL
)
87 addr
= DEBUG_EvalExpr(displaypoints
[i
].exp
);
88 if( addr
.type
== NULL
)
90 fprintf(stderr
, "Unable to evaluate expression ");
91 DEBUG_DisplayExpr(displaypoints
[i
].exp
);
92 fprintf(stderr
, "\nDisabling...\n");
97 fprintf(stderr
, "%d : ", i
+ 1);
98 DEBUG_DisplayExpr(displaypoints
[i
].exp
);
99 fprintf(stderr
, " = ");
100 if( displaypoints
[i
].format
== 'i' )
102 DEBUG_ExamineMemory( &addr
,
103 displaypoints
[i
].count
,
104 displaypoints
[i
].format
);
109 displaypoints
[i
].count
,
110 displaypoints
[i
].format
, 0);
120 DEBUG_DelDisplay(int displaynum
)
124 if( displaynum
>= MAX_DISPLAY
|| displaynum
== 0 || displaynum
< -1 )
126 fprintf(stderr
, "Invalid display number\n");
129 if( displaynum
== -1 )
131 for(i
=0; i
< MAX_DISPLAY
; i
++ )
133 if( displaypoints
[i
].exp
!= NULL
)
135 DEBUG_FreeExpr(displaypoints
[i
].exp
);
136 displaypoints
[i
].exp
= NULL
;
140 else if( displaypoints
[displaynum
- 1].exp
!= NULL
)
142 DEBUG_FreeExpr(displaypoints
[displaynum
- 1].exp
);
143 displaypoints
[displaynum
- 1].exp
= NULL
;