Rev 3454 | Rev 3485 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3454 | Rev 3455 | ||
---|---|---|---|
Line 134... | Line 134... | ||
134 | printf("\ntotal of %u threads\n", tb_needed / sizeof(uintptr_t)); |
134 | printf("\ntotal of %u threads\n", tb_needed / sizeof(uintptr_t)); |
135 | 135 | ||
136 | return 0; |
136 | return 0; |
137 | } |
137 | } |
138 | 138 | ||
139 | void val_print(int val, val_type_t v_type) |
139 | void val_print(sysarg_t val, val_type_t v_type) |
140 | { |
140 | { |
141 | switch (v_type) { |
141 | switch (v_type) { |
142 | case V_VOID: |
142 | case V_VOID: |
143 | printf("<void>"); |
143 | printf("<void>"); |
144 | break; |
144 | break; |
145 | 145 | ||
146 | case V_INTEGER: |
146 | case V_INTEGER: |
147 | printf("%d", val); |
147 | printf("%ld", val); |
148 | break; |
148 | break; |
149 | 149 | ||
150 | case V_HASH: |
150 | case V_HASH: |
151 | printf("0x%08x", val); |
151 | printf("0x%08lx", val); |
152 | break; |
152 | break; |
153 | 153 | ||
154 | case V_ERRNO: |
154 | case V_ERRNO: |
155 | if (val >= -15 && val <= 0) { |
155 | if (val >= -15 && val <= 0) { |
156 | printf("%d %s (%s)", val, |
156 | printf("%ld %s (%s)", val, |
157 | err_desc[-val].name, |
157 | err_desc[-val].name, |
158 | err_desc[-val].desc); |
158 | err_desc[-val].desc); |
159 | } else { |
159 | } else { |
160 | printf("%d", val); |
160 | printf("%ld", val); |
161 | } |
161 | } |
162 | break; |
162 | break; |
163 | case V_INT_ERRNO: |
163 | case V_INT_ERRNO: |
164 | if (val >= -15 && val < 0) { |
164 | if (val >= -15 && val < 0) { |
165 | printf("%d %s (%s)", val, |
165 | printf("%ld %s (%s)", val, |
166 | err_desc[-val].name, |
166 | err_desc[-val].name, |
167 | err_desc[-val].desc); |
167 | err_desc[-val].desc); |
168 | } else { |
168 | } else { |
169 | printf("%d", val); |
169 | printf("%ld", val); |
170 | } |
170 | } |
171 | break; |
171 | break; |
172 | 172 | ||
173 | case V_CHAR: |
173 | case V_CHAR: |
174 | if (val >= 0x20 && val < 0x7f) { |
174 | if (val >= 0x20 && val < 0x7f) { |
Line 179... | Line 179... | ||
179 | case '\b': printf("'\\b'"); break; |
179 | case '\b': printf("'\\b'"); break; |
180 | case '\n': printf("'\\n'"); break; |
180 | case '\n': printf("'\\n'"); break; |
181 | case '\r': printf("'\\r'"); break; |
181 | case '\r': printf("'\\r'"); break; |
182 | case '\t': printf("'\\t'"); break; |
182 | case '\t': printf("'\\t'"); break; |
183 | case '\\': printf("'\\\\'"); break; |
183 | case '\\': printf("'\\\\'"); break; |
184 | default: printf("'\\x%X'"); break; |
184 | default: printf("'\\x%02lX'", val); break; |
185 | } |
185 | } |
186 | } |
186 | } |
187 | break; |
187 | break; |
188 | } |
188 | } |
189 | } |
189 | } |
190 | 190 | ||
191 | 191 | ||
192 | static void print_sc_retval(int retval, val_type_t val_type) |
192 | static void print_sc_retval(sysarg_t retval, val_type_t val_type) |
193 | { |
193 | { |
194 | printf(" -> "); |
194 | printf(" -> "); |
195 | val_print(retval, val_type); |
195 | val_print(retval, val_type); |
196 | putchar('\n'); |
196 | putchar('\n'); |
197 | } |
197 | } |