Changeset d5c1051 in mainline for uspace/app/taskdump/taskdump.c
- Timestamp:
- 2017-12-20T22:25:34Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 39b54fe
- Parents:
- 8610c2c
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-20 22:22:29)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-20 22:25:34)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskdump/taskdump.c
r8610c2c rd5c1051 92 92 93 93 rc = connect_task(task_id); 94 if (rc < 0) {94 if (rc != EOK) { 95 95 printf("Failed connecting to task %" PRIu64 ".\n", task_id); 96 96 return 1; … … 105 105 106 106 rc = threads_dump(); 107 if (rc < 0)107 if (rc != EOK) 108 108 printf("Failed dumping threads.\n"); 109 109 110 110 rc = areas_dump(); 111 if (rc < 0)111 if (rc != EOK) 112 112 printf("Failed dumping address space areas.\n"); 113 113 114 114 rc = fibrils_dump(app_symtab, sess); 115 if (rc < 0)115 if (rc != EOK) 116 116 printf("Failed dumping fibrils.\n"); 117 117 … … 141 141 142 142 int rc = udebug_begin(ksess); 143 if (rc < 0) {143 if (rc != EOK) { 144 144 printf("udebug_begin() -> %s\n", str_error_name(rc)); 145 145 return rc; … … 223 223 /* TODO: See why NULL does not work. */ 224 224 rc = udebug_thread_read(sess, &dummy_buf, 0, &copied, &needed); 225 if (rc < 0) {225 if (rc != EOK) { 226 226 printf("udebug_thread_read() -> %s\n", str_error_name(rc)); 227 227 return rc; … … 237 237 238 238 rc = udebug_thread_read(sess, thash_buf, buf_size, &copied, &needed); 239 if (rc < 0) {239 if (rc != EOK) { 240 240 printf("udebug_thread_read() -> %s\n", str_error_name(rc)); 241 241 return rc; … … 272 272 273 273 rc = udebug_areas_read(sess, &dummy_buf, 0, &copied, &needed); 274 if (rc < 0) {274 if (rc != EOK) { 275 275 printf("udebug_areas_read() -> %s\n", str_error_name(rc)); 276 276 return rc; … … 281 281 282 282 rc = udebug_areas_read(sess, ainfo_buf, buf_size, &copied, &needed); 283 if (rc < 0) {283 if (rc != EOK) { 284 284 printf("udebug_areas_read() -> %s\n", str_error_name(rc)); 285 285 return rc; … … 357 357 358 358 rc = udebug_regs_read(sess, thash, &istate); 359 if (rc < 0) {359 if (rc != EOK) { 360 360 printf("Failed reading registers: %s.\n", str_error_name(rc)); 361 361 return EIO; … … 386 386 387 387 rc = udebug_mem_read(sess, &data, addr, sizeof(data)); 388 if (rc < 0) {388 if (rc != EOK) { 389 389 printf("Warning: udebug_mem_read() failed.\n"); 390 390 return rc; … … 400 400 char *file_name; 401 401 int rc; 402 int ret; 402 403 403 404 assert(app_name != NULL); 404 405 assert(app_symtab == NULL); 405 406 406 r c= asprintf(&file_name, "/app/%s", app_name);407 if (r c< 0) {407 ret = asprintf(&file_name, "/app/%s", app_name); 408 if (ret < 0) { 408 409 printf("Memory allocation failure.\n"); 409 410 exit(1); … … 419 420 free(file_name); 420 421 421 r c= asprintf(&file_name, "/srv/%s", app_name);422 if (r c< 0) {422 ret = asprintf(&file_name, "/srv/%s", app_name); 423 if (ret < 0) { 423 424 printf("Memory allocation failure.\n"); 424 425 exit(1); … … 432 433 } 433 434 434 r c= asprintf(&file_name, "/drv/%s/%s", app_name, app_name);435 if (r c< 0) {435 ret = asprintf(&file_name, "/drv/%s/%s", app_name, app_name); 436 if (ret < 0) { 436 437 printf("Memory allocation failure.\n"); 437 438 exit(1); … … 457 458 458 459 rc = udebug_name_read(sess, &dummy_buf, 0, &copied, &needed); 459 if (rc < 0)460 if (rc != EOK) 460 461 return NULL; 461 462 … … 463 464 name = malloc(name_size + 1); 464 465 rc = udebug_name_read(sess, name, name_size, &copied, &needed); 465 if (rc < 0) {466 if (rc != EOK) { 466 467 free(name); 467 468 return NULL; … … 488 489 size_t offs; 489 490 int rc; 491 int ret; 490 492 char *str; 491 493 … … 497 499 498 500 if (rc == EOK) { 499 r c= asprintf(&str, "%p (%s+%zu)", (void *) addr, name, offs);501 ret = asprintf(&str, "%p (%s+%zu)", (void *) addr, name, offs); 500 502 } else { 501 r c= asprintf(&str, "%p", (void *) addr);502 } 503 504 if (r c< 0) {503 ret = asprintf(&str, "%p", (void *) addr); 504 } 505 506 if (ret < 0) { 505 507 printf("Memory allocation error.\n"); 506 508 exit(1);
Note:
See TracChangeset
for help on using the changeset viewer.