Changeset 41811af in mainline for uspace/app/taskdump/elf_core.c


Ignore:
Timestamp:
2011-06-10T10:14:26Z (14 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
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.
Message:

Merge mainline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/taskdump/elf_core.c

    r9536e6e r41811af  
    6262#include "include/elf_core.h"
    6363
    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);
     64static off64_t align_foff_up(off64_t, uintptr_t, size_t);
     65static int write_all(int, void *, size_t);
     66static int write_mem_area(int, as_area_info_t *, async_sess_t *);
    6767
    6868#define BUFFER_SIZE 0x1000
     
    7171/** Save ELF core file.
    7272 *
    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 */
     84int elf_core_save(const char *file_name, as_area_info_t *ainfo, unsigned int n,
     85    async_sess_t *sess)
    8286{
    8387        elf_header_t elf_hdr;
     
    189193                        return EIO;
    190194                }
    191                 if (write_mem_area(fd, &ainfo[i], phoneid) != EOK) {
     195                if (write_mem_area(fd, &ainfo[i], sess) != EOK) {
    192196                        printf("Failed writing memory data.\n");
    193197                        free(p_hdr);
     
    215219/** Write memory area from application to core file.
    216220 *
    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 */
     228static int write_mem_area(int fd, as_area_info_t *area, async_sess_t *sess)
    224229{
    225230        size_t to_copy;
     
    233238        while (total < area->size) {
    234239                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);
    236241                if (rc < 0) {
    237242                        printf("Failed reading task memory.\n");
Note: See TracChangeset for help on using the changeset viewer.