File: patch.marklog

package info (click to toggle)
bochs 2.3-2etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 14,116 kB
  • ctags: 16,927
  • sloc: cpp: 130,524; ansic: 18,822; sh: 7,922; makefile: 3,836; yacc: 1,056; asm: 463; perl: 381; lex: 280; csh: 3
file content (161 lines) | stat: -rw-r--r-- 6,212 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
----------------------------------------------------------------------
Patch name: patch.marklog
Author: Carl Sopchak
Date: May, 1st 2002

Detailed description:
 While working on getting SCO OSR5 installed into bochs,
 I added this mod to the gui programs. It adds a button
 (labelled XX LOG; my bitmap artsmanship leaves MUCH to
 be desired!) to the gui bar that writes a BX_ERROR
 entry into the log file. The format of the entry is:

 tttttttttt-x-@eeeeeeee[XGUI ]
 ================================
 Log Marker # nnnn
 ================================

 where nnnn is a sequential number from the beginning of
 the bochs session. A message is also written to stdout
 stating that the entry was logged, which also shows the
 number.

 This is useful to log demarcation points in the log
 file (e.g., "skip everything before marker #1"; "stuff
 between markers 3 & 4 is where the hard disk gets
 initialized", etc.)

 Please make this a part of the standard bochs package.

 Thanks,

 Carl

Patch was created with:
  cvs diff -u
Apply patch to what version:
  cvs checked out on May, 1st 2002
Instructions:
  To patch, go to main bochs directory.
  Type "cd gui"
  Type "patch -p0 < THIS_PATCH_FILE".
----------------------------------------------------------------------
Index: gui.h
===================================================================
RCS file: /cvsroot/bochs/bochs/gui/gui.h,v
retrieving revision 1.27
diff -u -r1.27 gui.h
--- gui.h	20 Apr 2002 07:19:35 -0000	1.27
+++ gui.h	1 May 2002 18:13:03 -0000
@@ -78,6 +78,7 @@
   static void cdromD_handler(void);
   static void reset_handler(void);
   static void power_handler(void);
+  static void marklog_handler(void);
   static void copy_handler(void);
   static void paste_handler(void);
   static void snapshot_handler(void);
@@ -91,6 +92,7 @@
   unsigned floppyA_bmap_id, floppyA_eject_bmap_id, floppyA_hbar_id;
   unsigned floppyB_bmap_id, floppyB_eject_bmap_id, floppyB_hbar_id;
   unsigned cdromD_bmap_id, cdromD_eject_bmap_id, cdromD_hbar_id;
+  unsigned marklog_bmap_id,    marklog_hbar_id;
   unsigned power_bmap_id,    power_hbar_id;
   unsigned reset_bmap_id,    reset_hbar_id;
   unsigned copy_bmap_id, copy_hbar_id;
@@ -98,11 +100,13 @@
   unsigned snapshot_bmap_id, snapshot_hbar_id;
   unsigned config_bmap_id, config_hbar_id;
   unsigned mouse_bmap_id, nomouse_bmap_id, mouse_hbar_id;
+
+  unsigned markercount;
   };
 
 
 #define BX_MAX_PIXMAPS 16
-#define BX_MAX_HEADERBAR_ENTRIES 10
+#define BX_MAX_HEADERBAR_ENTRIES 11
 #define BX_HEADER_BAR_Y 32
 
 // align pixmaps towards left or right side of header bar
Index: gui.cc
===================================================================
RCS file: /cvsroot/bochs/bochs/gui/gui.cc,v
retrieving revision 1.41
diff -u -r1.41 gui.cc
--- gui.cc	18 Apr 2002 00:22:19 -0000	1.41
+++ gui.cc	1 May 2002 18:13:03 -0000
@@ -37,6 +37,7 @@
 #include "gui/bitmaps/paste.h"
 #include "gui/bitmaps/configbutton.h"
 #include "gui/bitmaps/cdromd.h"
+#include "gui/bitmaps/marklog.h"
 #if BX_WITH_MACOS
 #  include <Disks.h>
 #endif
@@ -75,13 +76,15 @@
   BX_GUI_THIS nomouse_bmap_id = create_bitmap(bx_nomouse_bmap,
                           BX_MOUSE_BMAP_X, BX_MOUSE_BMAP_Y);
 
-
   BX_GUI_THIS power_bmap_id = create_bitmap(bx_power_bmap, BX_POWER_BMAP_X, BX_POWER_BMAP_Y);
   BX_GUI_THIS reset_bmap_id = create_bitmap(bx_reset_bmap, BX_RESET_BMAP_X, BX_RESET_BMAP_Y);
   BX_GUI_THIS snapshot_bmap_id = create_bitmap(bx_snapshot_bmap, BX_SNAPSHOT_BMAP_X, BX_SNAPSHOT_BMAP_Y);
   BX_GUI_THIS copy_bmap_id = create_bitmap(bx_copy_bmap, BX_COPY_BMAP_X, BX_COPY_BMAP_Y);
   BX_GUI_THIS paste_bmap_id = create_bitmap(bx_paste_bmap, BX_PASTE_BMAP_X, BX_PASTE_BMAP_Y);
   BX_GUI_THIS config_bmap_id = create_bitmap(bx_config_bmap, BX_CONFIG_BMAP_X, BX_CONFIG_BMAP_Y);
+  BX_GUI_THIS marklog_bmap_id = create_bitmap(bx_marklog_bmap, BX_MARKLOG_BMAP_X, BX_MARKLOG_BMAP_Y);
+
+  BX_GUI_THIS markercount = 0;
 
 
   // Add the initial bitmaps to the headerbar, and enable callback routine, for use
@@ -145,6 +148,9 @@
   // Copy button
   BX_GUI_THIS copy_hbar_id = headerbar_bitmap(BX_GUI_THIS copy_bmap_id,
                           BX_GRAVITY_RIGHT, copy_handler);
+  // Mark Log button
+  BX_GUI_THIS marklog_hbar_id = headerbar_bitmap(BX_GUI_THIS marklog_bmap_id,
+                          BX_GRAVITY_RIGHT, marklog_handler);
 
   show_headerbar();
 }
@@ -262,6 +268,15 @@
   bx_pc_system.ResetSignal( PCS_SET ); /* XXX is this right? */
   for (int i=0; i<BX_SMP_PROCESSORS; i++)
       BX_CPU(i)->reset(BX_RESET_HARDWARE);
+}
+
+  void
+bx_gui_c::marklog_handler(void)
+{
+  // the user pressed Mark Log button, so write error marker to log file
+  BX_GUI_THIS markercount += 1;
+  BX_ERROR (("\n================================\nLog Marker # %d\n================================", BX_GUI_THIS markercount));
+  fprintf (stderr, "Marker # %d written to log.\n", BX_GUI_THIS markercount);
 }
 
   void
--- /dev/null	Thu Aug 30 16:30:55 2001
+++ bitmaps/marklog.h	Wed May  1 09:58:00 2002
@@ -0,0 +1,20 @@
+/////////////////////////////////////////////////////////////////////////
+// $Id: patch.marklog,v 1.1 2002/05/01 21:07:13 cbothamy Exp $
+/////////////////////////////////////////////////////////////////////////
+//
+#define BX_MARKLOG_BMAP_X 32
+#define BX_MARKLOG_BMAP_Y 32
+
+static const unsigned char bx_marklog_bmap[(BX_MARKLOG_BMAP_X * BX_MARKLOG_BMAP_Y)/8] = {
+  0x60, 0x18, 0x86, 0x01, 0xc0, 0x0c, 0xcc, 0x00, 0x80, 0x07, 0x78, 0x00,
+  0x00, 0x03, 0x30, 0x00, 0x80, 0x07, 0x78, 0x00, 0xc0, 0x0c, 0xcc, 0x00,
+  0x60, 0x18, 0x86, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
+  0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 
+  0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x30, 0x18, 0x00, 
+  0x00, 0x30, 0x18, 0x00, 0x00, 0x30, 0x18, 0x00, 0x00, 0x30, 0x18, 0x00, 
+  0x00, 0x30, 0x18, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0xf0, 0x1f, 0x00, 0x00, 0x30, 0x10, 0x00, 0x00, 0x30, 0x00, 0x00, 
+  0x00, 0x30, 0x1e, 0x00, 0x00, 0x30, 0x18, 0x00, 0x00, 0x30, 0x18, 0x00, 
+  0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00 
+  };