Changes in uspace/app/taskdump/taskdump.c [7354b5e:d5c1051] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskdump/taskdump.c
r7354b5e rd5c1051 40 40 #include <stddef.h> 41 41 #include <stdbool.h> 42 #include <str_error.h> 42 43 #include <errno.h> 43 44 #include <udebug.h> … … 91 92 92 93 rc = connect_task(task_id); 93 if (rc < 0) {94 if (rc != EOK) { 94 95 printf("Failed connecting to task %" PRIu64 ".\n", task_id); 95 96 return 1; … … 104 105 105 106 rc = threads_dump(); 106 if (rc < 0)107 if (rc != EOK) 107 108 printf("Failed dumping threads.\n"); 108 109 109 110 rc = areas_dump(); 110 if (rc < 0)111 if (rc != EOK) 111 112 printf("Failed dumping address space areas.\n"); 112 113 113 114 rc = fibrils_dump(app_symtab, sess); 114 if (rc < 0)115 if (rc != EOK) 115 116 printf("Failed dumping fibrils.\n"); 116 117 … … 135 136 136 137 printf("Error connecting\n"); 137 printf("async_connect_kbox(%" PRIu64 ") -> % d ", task_id, errno);138 printf("async_connect_kbox(%" PRIu64 ") -> %s", task_id, str_error_name(errno)); 138 139 return errno; 139 140 } 140 141 141 142 int rc = udebug_begin(ksess); 142 if (rc < 0) {143 printf("udebug_begin() -> % d\n", rc);143 if (rc != EOK) { 144 printf("udebug_begin() -> %s\n", str_error_name(rc)); 144 145 return rc; 145 146 } … … 222 223 /* TODO: See why NULL does not work. */ 223 224 rc = udebug_thread_read(sess, &dummy_buf, 0, &copied, &needed); 224 if (rc < 0) {225 printf("udebug_thread_read() -> % d\n", rc);225 if (rc != EOK) { 226 printf("udebug_thread_read() -> %s\n", str_error_name(rc)); 226 227 return rc; 227 228 } … … 236 237 237 238 rc = udebug_thread_read(sess, thash_buf, buf_size, &copied, &needed); 238 if (rc < 0) {239 printf("udebug_thread_read() -> % d\n", rc);239 if (rc != EOK) { 240 printf("udebug_thread_read() -> %s\n", str_error_name(rc)); 240 241 return rc; 241 242 } … … 271 272 272 273 rc = udebug_areas_read(sess, &dummy_buf, 0, &copied, &needed); 273 if (rc < 0) {274 printf("udebug_areas_read() -> % d\n", rc);274 if (rc != EOK) { 275 printf("udebug_areas_read() -> %s\n", str_error_name(rc)); 275 276 return rc; 276 277 } … … 280 281 281 282 rc = udebug_areas_read(sess, ainfo_buf, buf_size, &copied, &needed); 282 if (rc < 0) {283 printf("udebug_areas_read() -> % d\n", rc);283 if (rc != EOK) { 284 printf("udebug_areas_read() -> %s\n", str_error_name(rc)); 284 285 return rc; 285 286 } … … 356 357 357 358 rc = udebug_regs_read(sess, thash, &istate); 358 if (rc < 0) {359 printf("Failed reading registers (%d).\n", rc);359 if (rc != EOK) { 360 printf("Failed reading registers: %s.\n", str_error_name(rc)); 360 361 return EIO; 361 362 } … … 385 386 386 387 rc = udebug_mem_read(sess, &data, addr, sizeof(data)); 387 if (rc < 0) {388 if (rc != EOK) { 388 389 printf("Warning: udebug_mem_read() failed.\n"); 389 390 return rc; … … 399 400 char *file_name; 400 401 int rc; 402 int ret; 401 403 402 404 assert(app_name != NULL); 403 405 assert(app_symtab == NULL); 404 406 405 r c= asprintf(&file_name, "/app/%s", app_name);406 if (r c< 0) {407 ret = asprintf(&file_name, "/app/%s", app_name); 408 if (ret < 0) { 407 409 printf("Memory allocation failure.\n"); 408 410 exit(1); … … 418 420 free(file_name); 419 421 420 r c= asprintf(&file_name, "/srv/%s", app_name);421 if (r c< 0) {422 ret = asprintf(&file_name, "/srv/%s", app_name); 423 if (ret < 0) { 422 424 printf("Memory allocation failure.\n"); 423 425 exit(1); … … 431 433 } 432 434 433 r c= asprintf(&file_name, "/drv/%s/%s", app_name, app_name);434 if (r c< 0) {435 ret = asprintf(&file_name, "/drv/%s/%s", app_name, app_name); 436 if (ret < 0) { 435 437 printf("Memory allocation failure.\n"); 436 438 exit(1); … … 456 458 457 459 rc = udebug_name_read(sess, &dummy_buf, 0, &copied, &needed); 458 if (rc < 0)460 if (rc != EOK) 459 461 return NULL; 460 462 … … 462 464 name = malloc(name_size + 1); 463 465 rc = udebug_name_read(sess, name, name_size, &copied, &needed); 464 if (rc < 0) {466 if (rc != EOK) { 465 467 free(name); 466 468 return NULL; … … 487 489 size_t offs; 488 490 int rc; 491 int ret; 489 492 char *str; 490 493 … … 496 499 497 500 if (rc == EOK) { 498 r c= asprintf(&str, "%p (%s+%zu)", (void *) addr, name, offs);501 ret = asprintf(&str, "%p (%s+%zu)", (void *) addr, name, offs); 499 502 } else { 500 r c= asprintf(&str, "%p", (void *) addr);501 } 502 503 if (r c< 0) {503 ret = asprintf(&str, "%p", (void *) addr); 504 } 505 506 if (ret < 0) { 504 507 printf("Memory allocation error.\n"); 505 508 exit(1);
Note:
See TracChangeset
for help on using the changeset viewer.