Changes in uspace/app/taskdump/taskdump.c [79ae36dd:6a343bdf] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskdump/taskdump.c
r79ae36dd r6a343bdf 54 54 #define LINE_BYTES 16 55 55 56 static async_sess_t *sess;56 static int phoneid; 57 57 static task_id_t task_id; 58 58 static bool write_core_file; … … 104 104 printf("Failed dumping address space areas.\n"); 105 105 106 udebug_end( sess);107 async_hangup( sess);106 udebug_end(phoneid); 107 async_hangup(phoneid); 108 108 109 109 return 0; … … 112 112 static int connect_task(task_id_t task_id) 113 113 { 114 async_sess_t *ksess = async_connect_kbox(task_id); 115 116 if (!ksess) { 117 if (errno == ENOTSUP) { 118 printf("You do not have userspace debugging support " 119 "compiled in the kernel.\n"); 120 printf("Compile kernel with 'Support for userspace debuggers' " 121 "(CONFIG_UDEBUG) enabled.\n"); 122 return errno; 123 } 124 114 int rc; 115 116 rc = async_connect_kbox(task_id); 117 118 if (rc == ENOTSUP) { 119 printf("You do not have userspace debugging support " 120 "compiled in the kernel.\n"); 121 printf("Compile kernel with 'Support for userspace debuggers' " 122 "(CONFIG_UDEBUG) enabled.\n"); 123 return rc; 124 } 125 126 if (rc < 0) { 125 127 printf("Error connecting\n"); 126 printf("async_connect_kbox(%" PRIu64 ") -> %d ", task_id, errno); 127 return errno; 128 } 129 130 int rc = udebug_begin(ksess); 128 printf("async_connect_kbox(%" PRIu64 ") -> %d ", task_id, rc); 129 return rc; 130 } 131 132 phoneid = rc; 133 134 rc = udebug_begin(phoneid); 131 135 if (rc < 0) { 132 136 printf("udebug_begin() -> %d\n", rc); 133 137 return rc; 134 138 } 135 136 sess = ksess; 139 137 140 return 0; 138 141 } … … 210 213 211 214 /* TODO: See why NULL does not work. */ 212 rc = udebug_thread_read( sess, &dummy_buf, 0, &copied, &needed);215 rc = udebug_thread_read(phoneid, &dummy_buf, 0, &copied, &needed); 213 216 if (rc < 0) { 214 217 printf("udebug_thread_read() -> %d\n", rc); … … 224 227 thash_buf = malloc(buf_size); 225 228 226 rc = udebug_thread_read( sess, thash_buf, buf_size, &copied, &needed);229 rc = udebug_thread_read(phoneid, thash_buf, buf_size, &copied, &needed); 227 230 if (rc < 0) { 228 231 printf("udebug_thread_read() -> %d\n", rc); … … 259 262 int rc; 260 263 261 rc = udebug_areas_read( sess, &dummy_buf, 0, &copied, &needed);264 rc = udebug_areas_read(phoneid, &dummy_buf, 0, &copied, &needed); 262 265 if (rc < 0) { 263 266 printf("udebug_areas_read() -> %d\n", rc); … … 268 271 ainfo_buf = malloc(buf_size); 269 272 270 rc = udebug_areas_read( sess, ainfo_buf, buf_size, &copied, &needed);273 rc = udebug_areas_read(phoneid, ainfo_buf, buf_size, &copied, &needed); 271 274 if (rc < 0) { 272 275 printf("udebug_areas_read() -> %d\n", rc); … … 293 296 if (write_core_file) { 294 297 printf("Writing core file '%s'\n", core_file_name); 295 rc = elf_core_save(core_file_name, ainfo_buf, n_areas, sess);298 rc = elf_core_save(core_file_name, ainfo_buf, n_areas, phoneid); 296 299 if (rc != EOK) { 297 300 printf("Failed writing core file.\n"); … … 313 316 int rc; 314 317 315 rc = udebug_regs_read( sess, thash, &istate);318 rc = udebug_regs_read(phoneid, thash, &istate); 316 319 if (rc < 0) { 317 320 printf("Failed reading registers (%d).\n", rc); … … 356 359 (void) arg; 357 360 358 rc = udebug_mem_read( sess, &data, addr, sizeof(data));361 rc = udebug_mem_read(phoneid, &data, addr, sizeof(data)); 359 362 if (rc < 0) { 360 363 printf("Warning: udebug_mem_read() failed.\n"); … … 427 430 int rc; 428 431 429 rc = udebug_name_read( sess, &dummy_buf, 0, &copied, &needed);432 rc = udebug_name_read(phoneid, &dummy_buf, 0, &copied, &needed); 430 433 if (rc < 0) 431 434 return NULL; … … 433 436 name_size = needed; 434 437 name = malloc(name_size + 1); 435 rc = udebug_name_read( sess, name, name_size, &copied, &needed);438 rc = udebug_name_read(phoneid, name, name_size, &copied, &needed); 436 439 if (rc < 0) { 437 440 free(name);
Note:
See TracChangeset
for help on using the changeset viewer.