Changeset 41811af in mainline for uspace/app/taskdump/elf_core.c
- Timestamp:
- 2011-06-10T10:14:26Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ab547063
- Parents:
- 9536e6e (diff), 390d80d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskdump/elf_core.c
r9536e6e r41811af 62 62 #include "include/elf_core.h" 63 63 64 static off64_t align_foff_up(off64_t foff, uintptr_t vaddr, size_t page_size);65 static int write_all(int fd, void *data, size_t len);66 static int write_mem_area(int fd, as_area_info_t *area, int phoneid);64 static off64_t align_foff_up(off64_t, uintptr_t, size_t); 65 static int write_all(int, void *, size_t); 66 static int write_mem_area(int, as_area_info_t *, async_sess_t *); 67 67 68 68 #define BUFFER_SIZE 0x1000 … … 71 71 /** Save ELF core file. 72 72 * 73 * @param file_name Name of file to save to. 74 * @param ainfo Array of @a n memory area info structures. 75 * @param n Number of memory areas. 76 * @param phoneid Debugging phone. 77 * 78 * @return EOK on sucess, ENOENT if file cannot be created, 79 * ENOMEM on out of memory, EIO on write error. 80 */ 81 int elf_core_save(const char *file_name, as_area_info_t *ainfo, unsigned int n, int phoneid) 73 * @param file_name Name of file to save to. 74 * @param ainfo Array of @a n memory area info structures. 75 * @param n Number of memory areas. 76 * @param sess Debugging session. 77 * 78 * @return EOK on sucess. 79 * @return ENOENT if file cannot be created. 80 * @return ENOMEM on out of memory. 81 * @return EIO on write error. 82 * 83 */ 84 int elf_core_save(const char *file_name, as_area_info_t *ainfo, unsigned int n, 85 async_sess_t *sess) 82 86 { 83 87 elf_header_t elf_hdr; … … 189 193 return EIO; 190 194 } 191 if (write_mem_area(fd, &ainfo[i], phoneid) != EOK) {195 if (write_mem_area(fd, &ainfo[i], sess) != EOK) { 192 196 printf("Failed writing memory data.\n"); 193 197 free(p_hdr); … … 215 219 /** Write memory area from application to core file. 216 220 * 217 * @param fd File to write to. 218 * @param area Memory area info structure. 219 * @param phoneid Debugging phone. 220 * 221 * @return EOK on success, EIO on failure. 222 */ 223 static int write_mem_area(int fd, as_area_info_t *area, int phoneid) 221 * @param fd File to write to. 222 * @param area Memory area info structure. 223 * @param sess Debugging session. 224 * 225 * @return EOK on success, EIO on failure. 226 * 227 */ 228 static int write_mem_area(int fd, as_area_info_t *area, async_sess_t *sess) 224 229 { 225 230 size_t to_copy; … … 233 238 while (total < area->size) { 234 239 to_copy = min(area->size - total, BUFFER_SIZE); 235 rc = udebug_mem_read( phoneid, buffer, addr, to_copy);240 rc = udebug_mem_read(sess, buffer, addr, to_copy); 236 241 if (rc < 0) { 237 242 printf("Failed reading task memory.\n");
Note:
See TracChangeset
for help on using the changeset viewer.