Changeset 79ae36dd in mainline for uspace/app/taskdump/elf_core.c


Ignore:
Timestamp:
2011-06-08T19:01:55Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0eff68e
Parents:
764d71e
Message:

new async framework with integrated exchange tracking

  • strict isolation between low-level IPC and high-level async framework with integrated exchange tracking
    • each IPC connection is represented by an async_sess_t structure
    • each IPC exchange is represented by an async_exch_t structure
    • exchange management is either based on atomic messages (EXCHANGE_ATOMIC), locking (EXCHANGE_SERIALIZE) or connection cloning (EXCHANGE_CLONE)
  • async_obsolete: temporary compatibility layer to keep old async clients working (several pieces of code are currently broken, but only non-essential functionality)
  • IPC_M_PHONE_HANGUP is now method no. 0 (for elegant boolean evaluation)
  • IPC_M_DEBUG_ALL has been renamed to IPC_M_DEBUG
  • IPC_M_PING has been removed (VFS protocol now has VFS_IN_PING)
  • console routines in libc have been rewritten for better abstraction
  • additional use for libc-private header files (FILE structure opaque to the client)
  • various cstyle changes (typos, indentation, missing externs in header files, improved comments, etc.)
File:
1 edited

Legend:

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

    r764d71e r79ae36dd  
    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.