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