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