Changeset 90f067d9 in mainline
- Timestamp:
- 2012-04-13T07:41:22Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a7a7f8c
- Parents:
- 9b0a6b4
- Location:
- uspace/app/msim
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/msim/helenos.c
r9b0a6b4 r90f067d9 34 34 #include "io/input.h" 35 35 #include "io/output.h" 36 #include "device/dprinter.h" 36 37 #include "debug/gdb.h" 37 38 #include "cmd.h" … … 40 41 #include <str.h> 41 42 #include <malloc.h> 43 #include <ctype.h> 44 #include <stdio.h> 45 46 /* Define when the dprinter device shall try to filter 47 * out ANSI escape sequences. 48 */ 49 #define IGNORE_ANSI_ESCAPE_SEQUENCES 42 50 43 51 extern char *input_helenos_get_next_command(void); … … 87 95 88 96 97 char *input_helenos_get_next_command(void); 98 99 static void (*original_printer_write)(cpu_t *, device_s *, ptr_t, uint32_t); 100 static void helenos_printer_write(cpu_t *cpu, device_s *dev, ptr_t addr, uint32_t val) 101 { 102 #ifdef IGNORE_ANSI_ESCAPE_SEQUENCES 103 static bool inside_ansi_escape = false; 104 static bool just_ended_ansi_escape = false; 105 106 if (inside_ansi_escape) { 107 fprintf(stderr, "%02" PRIx32 "'%c' ", val, val >= 32 ? val : '?'); 108 if (isalpha((int) val)) { 109 just_ended_ansi_escape = true; 110 inside_ansi_escape = false; 111 fprintf(stderr, " [END]\n"); 112 } 113 114 return; 115 } 116 117 if (val == 0x1B) { 118 inside_ansi_escape = true; 119 120 if (!just_ended_ansi_escape) { 121 fprintf(stderr, "\n"); 122 } 123 fprintf(stderr, "ESC sequence: "); 124 125 return; 126 } 127 128 just_ended_ansi_escape = false; 129 #endif 130 131 (*original_printer_write)(cpu, dev, addr, val); 132 } 133 134 void helenos_dprinter_init(void) 135 { 136 original_printer_write = dprinter.write; 137 dprinter.write = helenos_printer_write; 138 } 139 140 -
uspace/app/msim/helenos_input.c
r9b0a6b4 r90f067d9 41 41 42 42 char *input_helenos_get_next_command(void); 43 void helenos_dprinter_init(void); 43 44 44 45 /** Terminal and readline initialization … … 51 52 die(1, "Failed to intialize input."); 52 53 } 54 helenos_dprinter_init(); 53 55 } 54 56
Note:
See TracChangeset
for help on using the changeset viewer.