Changes in uspace/app/trace/trace.c [1569a9b:706b4de] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/trace/trace.c
r1569a9b r706b4de 38 38 #include <stdint.h> 39 39 #include <stddef.h> 40 #include <str_error.h>41 40 #include <inttypes.h> 42 41 #include <fibril.h> … … 63 62 #include "syscalls.h" 64 63 #include "ipcp.h" 64 #include "errors.h" 65 65 #include "trace.h" 66 66 … … 157 157 158 158 printf("Error connecting\n"); 159 printf("ipc_connect_task(%" PRIu64 ") -> % s ", task_id, str_error_name(errno));159 printf("ipc_connect_task(%" PRIu64 ") -> %d ", task_id, errno); 160 160 return errno; 161 161 } 162 162 163 163 int rc = udebug_begin(ksess); 164 if (rc != EOK) {165 printf("udebug_begin() -> % s\n", str_error_name(rc));164 if (rc < 0) { 165 printf("udebug_begin() -> %d\n", rc); 166 166 return rc; 167 167 } 168 168 169 169 rc = udebug_set_evmask(ksess, UDEBUG_EM_ALL); 170 if (rc != EOK) {171 printf("udebug_set_evmask(0x%x) -> % s\n ", UDEBUG_EM_ALL, str_error_name(rc));170 if (rc < 0) { 171 printf("udebug_set_evmask(0x%x) -> %d\n ", UDEBUG_EM_ALL, rc); 172 172 return rc; 173 173 } … … 186 186 rc = udebug_thread_read(sess, thread_hash_buf, 187 187 THBUF_SIZE*sizeof(unsigned), &tb_copied, &tb_needed); 188 if (rc != EOK) {189 printf("udebug_thread_read() -> % s\n", str_error_name(rc));188 if (rc < 0) { 189 printf("udebug_thread_read() -> %d\n", rc); 190 190 return rc; 191 191 } … … 225 225 if (sval >= -15 && sval <= 0) { 226 226 printf("%ld %s (%s)", sval, 227 str_error_name((int) sval),228 str_error((int) sval));227 err_desc[-sval].name, 228 err_desc[-sval].desc); 229 229 } else { 230 230 printf("%ld", sval); … … 234 234 if (sval >= -15 && sval < 0) { 235 235 printf("%ld %s (%s)", sval, 236 str_error_name((int) sval),237 str_error((int) sval));236 err_desc[-sval].name, 237 err_desc[-sval].desc); 238 238 } else { 239 239 printf("%ld", sval); … … 279 279 } 280 280 281 static void sc_ipc_call_async_fast(sysarg_t *sc_args, int sc_rc)281 static void sc_ipc_call_async_fast(sysarg_t *sc_args, sysarg_t sc_rc) 282 282 { 283 283 ipc_call_t call; 284 284 sysarg_t phoneid; 285 285 286 if (sc_rc != EOK)286 if (sc_rc == (sysarg_t) IPC_CALLRET_FATAL) 287 287 return; 288 288 … … 296 296 IPC_SET_ARG5(call, 0); 297 297 298 ipcp_call_out(phoneid, &call, 0);299 } 300 301 static void sc_ipc_call_async_slow(sysarg_t *sc_args, int sc_rc)298 ipcp_call_out(phoneid, &call, sc_rc); 299 } 300 301 static void sc_ipc_call_async_slow(sysarg_t *sc_args, sysarg_t sc_rc) 302 302 { 303 303 ipc_call_t call; 304 304 int rc; 305 305 306 if (sc_rc != EOK)306 if (sc_rc == (sysarg_t) IPC_CALLRET_FATAL) 307 307 return; 308 308 … … 310 310 rc = udebug_mem_read(sess, &call.args, sc_args[1], sizeof(call.args)); 311 311 312 if (rc == EOK) {313 ipcp_call_out(sc_args[0], &call, 0);312 if (rc >= 0) { 313 ipcp_call_out(sc_args[0], &call, sc_rc); 314 314 } 315 315 } … … 325 325 rc = udebug_mem_read(sess, &call, sc_args[0], sizeof(call)); 326 326 327 if (rc == EOK)327 if (rc >= 0) 328 328 ipcp_call_in(&call, sc_rc); 329 329 } … … 338 338 rc = udebug_args_read(sess, thread_hash, sc_args); 339 339 340 if (rc != EOK) {340 if (rc < 0) { 341 341 printf("error\n"); 342 342 return; … … 368 368 // printf("[%d] ", thread_id); 369 369 370 if (rc != EOK) {370 if (rc < 0) { 371 371 printf("error\n"); 372 372 return; … … 445 445 } 446 446 447 if (rc == EOK) {447 if (rc >= 0) { 448 448 switch (ev_type) { 449 449 case UDEBUG_EVENT_SYSCALL_B: … … 581 581 582 582 if (!console_get_event(console, &event)) 583 return EINVAL;583 return -1; 584 584 585 585 if (event.type == CEV_KEY) { … … 603 603 604 604 rc = get_thread_list(); 605 if (rc != EOK) {606 printf("Failed to get thread list ( %s)\n", str_error(rc));605 if (rc < 0) { 606 printf("Failed to get thread list (error %d)\n", rc); 607 607 return; 608 608 } … … 643 643 rc = udebug_stop(sess, thash); 644 644 if (rc != EOK) 645 printf("Error: stop -> % s\n", str_error_name(rc));645 printf("Error: stop -> %d\n", rc); 646 646 break; 647 647 case KC_R: … … 859 859 860 860 rc = connect_task(task_id); 861 if (rc != EOK) {861 if (rc < 0) { 862 862 printf("Failed connecting to task %" PRIu64 ".\n", task_id); 863 863 return 1;
Note:
See TracChangeset
for help on using the changeset viewer.