Changeset 86ffa27f in mainline for uspace/app


Ignore:
Timestamp:
2011-08-07T11:21:44Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cc574511
Parents:
15f3c3f (diff), e8067c0 (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 changes.

Location:
uspace/app
Files:
2 added
1 deleted
20 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/Makefile

    r15f3c3f r86ffa27f  
    5454        cmds/mod_cmds.c \
    5555        cmds/builtin_cmds.c \
     56        compl.c \
    5657        errors.c \
    5758        input.c \
  • uspace/app/bdsh/cmds/modules/cp/cp.c

    r15f3c3f r86ffa27f  
    7171        size_t blen, int vb)
    7272{
    73         int fd1, fd2, bytes = 0;
    74         off64_t total = 0;
     73        int fd1, fd2, bytes;
     74        off64_t total;
    7575        int64_t copied = 0;
    7676        char *buff = NULL;
     
    104104        }
    105105
    106         for (;;) {
    107                 ssize_t res;
    108                 size_t written = 0;
    109 
    110                 bytes = read(fd1, buff, blen);
    111                 if (bytes <= 0)
     106        while ((bytes = read_all(fd1, buff, blen)) > 0) {
     107                if ((bytes = write_all(fd2, buff, bytes)) < 0)
    112108                        break;
    113109                copied += bytes;
    114                 res = bytes;
    115                 do {
    116                         /*
    117                          * Theoretically, it may not be enough to call write()
    118                          * only once. Also the previous read() may have
    119                          * returned less data than requested.
    120                          */
    121                         bytes = write(fd2, buff + written, res);
    122                         if (bytes < 0)
    123                                 goto err;
    124                         written += bytes;
    125                         res -= bytes;
    126                 } while (res > 0);
    127 
    128                 /* TODO: re-insert assert() once this is stand alone,
    129                  * removed as abort() exits the entire shell
    130                  */
    131                 if (res != 0) {
    132                         printf("\n%zd more bytes than actually exist were copied\n", res);
    133                         goto err;
    134                 }
    135110        }
    136111
    137112        if (bytes < 0) {
    138 err:
    139113                printf("\nError copying %s, (%d)\n", src, bytes);
    140114                copied = bytes;
  • uspace/app/bdsh/cmds/modules/ls/ls.c

    r15f3c3f r86ffa27f  
    169169               
    170170                /* fill the name field */
    171                 tosort[nbdirs].name = (char *) malloc(str_length(dp->d_name) + 1);
     171                tosort[nbdirs].name = (char *) malloc(str_size(dp->d_name) + 1);
    172172                if (!tosort[nbdirs].name) {
    173173                        cli_error(CL_ENOMEM, "ls: failed to scan %s", d);
    174174                        goto out;
    175175                }
    176                
    177                 str_cpy(tosort[nbdirs].name, str_length(dp->d_name) + 1, dp->d_name);
     176
     177                str_cpy(tosort[nbdirs].name, str_size(dp->d_name) + 1, dp->d_name);
    178178                len = snprintf(buff, PATH_MAX - 1, "%s/%s", d, tosort[nbdirs].name);
    179179                buff[len] = '\0';
  • uspace/app/bdsh/config.h

    r15f3c3f r86ffa27f  
    4040#endif
    4141
    42 /* Work around for getenv() */
    43 #define PATH "/srv:/app"
    44 #define PATH_DELIM ":"
    45 
    4642/* Used in many places */
    4743#define SMALL_BUFLEN 256
  • uspace/app/bdsh/exec.c

    r15f3c3f r86ffa27f  
    5252static int try_access(const char *);
    5353
     54const char *search_dir[] = { "/app", "/srv", NULL };
     55
    5456/* work-around for access() */
    5557static int try_access(const char *f)
     
    6971static char *find_command(char *cmd)
    7072{
    71         char *path_tok;
    72         char *path[PATH_MAX];
    73         int n = 0, i = 0;
    74         size_t x = str_size(cmd) + 2;
     73        size_t i;
    7574
    7675        found = (char *)malloc(PATH_MAX);
     
    8180        }
    8281
    83         path_tok = str_dup(PATH);
    84 
    85         /* Extract the PATH env to a path[] array */
    86         path[n] = strtok(path_tok, PATH_DELIM);
    87         while (NULL != path[n]) {
    88                 if ((str_size(path[n]) + x ) > PATH_MAX) {
    89                         cli_error(CL_ENOTSUP,
    90                                 "Segment %d of path is too large, search ends at segment %d",
    91                                 n, n-1);
    92                         break;
    93                 }
    94                 path[++n] = strtok(NULL, PATH_DELIM);
    95         }
    96 
    9782        /* We now have n places to look for the command */
    98         for (i=0; path[i]; i++) {
     83        for (i = 0; search_dir[i] != NULL; i++) {
    9984                memset(found, 0, sizeof(found));
    100                 snprintf(found, PATH_MAX, "%s/%s", path[i], cmd);
     85                snprintf(found, PATH_MAX, "%s/%s", search_dir[i], cmd);
    10186                if (-1 != try_access(found)) {
    102                         free(path_tok);
    10387                        return (char *) found;
    10488                }
     
    10690
    10791        /* We didn't find it, just give it back as-is. */
    108         free(path_tok);
    10992        return (char *) cmd;
    11093}
  • uspace/app/bdsh/exec.h

    r15f3c3f r86ffa27f  
    3333#include "scli.h"
    3434
     35extern const char *search_dir[];
     36
    3537extern unsigned int try_exec(char *, char **, iostate_t *);
    3638
  • uspace/app/bdsh/input.c

    r15f3c3f r86ffa27f  
    11/*
    22 * Copyright (c) 2008 Tim Post
     3 * Copyright (c) 2011 Jiri Svoboda
    34 * All rights reserved.
    45 *
     
    4344
    4445#include "config.h"
     46#include "compl.h"
    4547#include "util.h"
    4648#include "scli.h"
     
    168170        }
    169171       
    170         rc = run_command(cmd, usr, &new_iostate);
     172        rc = run_command(actual_cmd, usr, &new_iostate);
    171173       
    172174finit_with_files:
     
    226228        int rc;
    227229       
    228         console_flush(tinput->console);
    229         console_set_style(tinput->console, STYLE_EMPHASIS);
    230         printf("%s", usr->prompt);
    231         console_flush(tinput->console);
    232         console_set_style(tinput->console, STYLE_NORMAL);
     230        tinput_set_prompt(tinput, usr->prompt);
    233231
    234232        rc = tinput_read(tinput, &str);
     
    263261        }
    264262
     263        tinput_set_compl_ops(tinput, &compl_ops);
     264
    265265        return 0;
    266266}
  • uspace/app/bdsh/scli.h

    r15f3c3f r86ffa27f  
    3232#include "config.h"
    3333#include <stdint.h>
     34#include <stdio.h>
    3435
    3536typedef struct {
  • uspace/app/ext2info/ext2info.c

    r15f3c3f r86ffa27f  
    590590        printf("  Directory contents:\n");
    591591       
    592         rc = ext2_directory_iterator_init(&it, fs, inode_ref);
     592        rc = ext2_directory_iterator_init(&it, fs, inode_ref, 0);
    593593        if (rc != EOK) {
    594594                printf("Failed initializing directory iterator\n");
  • uspace/app/init/init.c

    r15f3c3f r86ffa27f  
    270270        spawn("/srv/apic");
    271271        spawn("/srv/i8259");
    272         spawn("/srv/fhc");
    273272        spawn("/srv/obio");
    274273        srv_start("/srv/cuda_adb");
     
    295294       
    296295#ifdef CONFIG_MOUNT_DATA
     296        /* Make sure fat is running. */
     297        if (str_cmp(STRING(RDFMT), "fat") != 0) {
     298                srv_start("/srv/fat");
     299        }
    297300        mount_data();
    298301#else
  • uspace/app/sbi/src/input.c

    r15f3c3f r86ffa27f  
    176176int input_get_line(input_t *input, char **line)
    177177{
     178        const char *prompt;
    178179        const char *sp;
    179180        char *dp;
     
    212213                /* Interactive mode */
    213214                if (input->line_no == 0)
    214                         printf("sbi> ");
     215                        prompt = "sbi> ";
    215216                else
    216                         printf("...  ");
     217                        prompt = "...  ";
    217218
    218219                fflush(stdout);
    219                 if (os_input_line(&line_p) != EOK)
     220                if (os_input_line(prompt, &line_p) != EOK)
    220221                        return EIO;
    221222
  • uspace/app/sbi/src/os/helenos.c

    r15f3c3f r86ffa27f  
    210210 * @param ptr   Place to store pointer to new string.
    211211 */
    212 int os_input_line(char **ptr)
     212int os_input_line(const char *prompt, char **ptr)
    213213{
    214214        char *line;
     
    219219                if (tinput == NULL)
    220220                        return EIO;
     221
     222                tinput_set_prompt(tinput, prompt);
    221223        }
    222224
  • uspace/app/sbi/src/os/os.h

    r15f3c3f r86ffa27f  
    3838char *os_chr_to_astr(wchar_t chr);
    3939void os_input_disp_help(void);
    40 int os_input_line(char **ptr);
     40int os_input_line(const char *prompt, char **ptr);
    4141int os_exec(char * const cmd[]);
    4242
  • uspace/app/sbi/src/os/posix.c

    r15f3c3f r86ffa27f  
    193193 * @param ptr   Place to store pointer to new string.
    194194 */
    195 int os_input_line(char **ptr)
    196 {
     195int os_input_line(const char *prompt, char **ptr)
     196{
     197        printf("%s", prompt);
     198
    197199        if (fgets(os_input_buffer, OS_INPUT_BUFFER_SIZE, stdin) == NULL)
    198200                os_input_buffer[0] = '\0';
  • uspace/app/taskdump/elf_core.c

    r15f3c3f r86ffa27f  
    11/*
    2  * Copyright (c) 2010 Jiri Svoboda
     2 * Copyright (c) 2011 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3838 * Looking at core files produced by Linux, these don't have section headers,
    3939 * only program headers, although objdump shows them as having sections.
    40  * Basically at the beginning there should be a note segment (which we
    41  * do not write) and one loadable segment per memory area (which we do write).
    42  *
    43  * The note segment probably contains register state, etc. -- we don't
    44  * deal with these yet. Nevertheless you can use these core files with
    45  * objdump or gdb.
    46  */
    47 
     40 * Basically at the beginning there should be a note segment followed
     41 * by one loadable segment per memory area.
     42 *
     43 * The note segment contains a series of records with register state,
     44 * process info etc. We only write one record NT_PRSTATUS which contains
     45 * process/register state (anything which is not register state we fill
     46 * with zeroes).
     47 */
     48
     49#include <align.h>
     50#include <elf/elf.h>
     51#include <elf/elf_linux.h>
    4852#include <stdio.h>
    4953#include <stdlib.h>
     
    5862#include <udebug.h>
    5963#include <macros.h>
    60 
    61 #include <elf.h>
    62 #include "include/elf_core.h"
     64#include <libarch/istate.h>
     65
     66#include "elf_core.h"
    6367
    6468static off64_t align_foff_up(off64_t, uintptr_t, size_t);
    65 static int write_all(int, void *, size_t);
     69static int align_pos(int, size_t);
    6670static int write_mem_area(int, as_area_info_t *, async_sess_t *);
    6771
     
    8387 */
    8488int elf_core_save(const char *file_name, as_area_info_t *ainfo, unsigned int n,
    85     async_sess_t *sess)
     89    async_sess_t *sess, istate_t *istate)
    8690{
    8791        elf_header_t elf_hdr;
     
    9094        elf_word flags;
    9195        elf_segment_header_t *p_hdr;
     96        elf_prstatus_t pr_status;
     97        elf_note_t note;
     98        size_t word_size;
    9299
    93100        int fd;
    94         int rc;
     101        ssize_t rc;
    95102        unsigned int i;
    96103
    97         n_ph = n;
    98 
    99         p_hdr = malloc(sizeof(elf_segment_header_t) * n);
     104#ifdef __32_BITS__
     105        word_size = 4;
     106#endif
     107#ifdef __64_BITS__
     108        /*
     109         * This should be 8 per the 64-bit ELF spec, but the Linux kernel
     110         * screws up and uses 4 anyway (and screws up elf_note_t as well)
     111         * and we are trying to be compatible with Linux GDB target. Sigh.
     112         */
     113        word_size = 4;
     114#endif
     115        memset(&pr_status, 0, sizeof(pr_status));
     116        istate_to_elf_regs(istate, &pr_status.regs);
     117
     118        n_ph = n + 1;
     119
     120        p_hdr = malloc(sizeof(elf_segment_header_t) * n_ph);
    100121        if (p_hdr == NULL) {
    101122                printf("Failed allocating memory.\n");
     
    115136         *      ELF header
    116137         *      program headers
     138         *      note segment
    117139         * repeat:
    118140         *      (pad for alignment)
    119          *      segment data
     141         *      core segment
    120142         * end repeat
    121143         */
     
    147169        foff = elf_hdr.e_phoff + n_ph * sizeof(elf_segment_header_t);
    148170
    149         for (i = 1; i <= n; ++i) {
    150                 foff = align_foff_up(foff, ainfo[i - 1].start_addr, PAGE_SIZE);
     171        memset(&p_hdr[0], 0, sizeof(p_hdr[0]));
     172        p_hdr[0].p_type = PT_NOTE;
     173        p_hdr[0].p_offset = foff;
     174        p_hdr[0].p_vaddr = 0;
     175        p_hdr[0].p_paddr = 0;
     176        p_hdr[0].p_filesz = sizeof(elf_note_t)
     177            + ALIGN_UP((str_size("CORE") + 1), word_size)
     178            + ALIGN_UP(sizeof(elf_prstatus_t), word_size);
     179        p_hdr[0].p_memsz = 0;
     180        p_hdr[0].p_flags = 0;
     181        p_hdr[0].p_align = 1;
     182
     183        foff += p_hdr[0].p_filesz;
     184
     185        for (i = 0; i < n; ++i) {
     186                foff = align_foff_up(foff, ainfo[i].start_addr, PAGE_SIZE);
    151187
    152188                flags = 0;
    153                 if (ainfo[i - 1].flags & AS_AREA_READ)
     189                if (ainfo[i].flags & AS_AREA_READ)
    154190                        flags |= PF_R;
    155                 if (ainfo[i - 1].flags & AS_AREA_WRITE)
     191                if (ainfo[i].flags & AS_AREA_WRITE)
    156192                        flags |= PF_W;
    157                 if (ainfo[i - 1].flags & AS_AREA_EXEC)
     193                if (ainfo[i].flags & AS_AREA_EXEC)
    158194                        flags |= PF_X;
    159195
    160                 memset(&p_hdr[i - 1], 0, sizeof(p_hdr[i - 1]));
    161                 p_hdr[i - 1].p_type = PT_LOAD;
    162                 p_hdr[i - 1].p_offset = foff;
    163                 p_hdr[i - 1].p_vaddr = ainfo[i - 1].start_addr;
    164                 p_hdr[i - 1].p_paddr = 0;
    165                 p_hdr[i - 1].p_filesz = ainfo[i - 1].size;
    166                 p_hdr[i - 1].p_memsz = ainfo[i - 1].size;
    167                 p_hdr[i - 1].p_flags = flags;
    168                 p_hdr[i - 1].p_align = PAGE_SIZE;
    169 
    170                 foff += ainfo[i - 1].size;
     196                memset(&p_hdr[i + 1], 0, sizeof(p_hdr[i + 1]));
     197                p_hdr[i + 1].p_type = PT_LOAD;
     198                p_hdr[i + 1].p_offset = foff;
     199                p_hdr[i + 1].p_vaddr = ainfo[i].start_addr;
     200                p_hdr[i + 1].p_paddr = 0;
     201                p_hdr[i + 1].p_filesz = ainfo[i].size;
     202                p_hdr[i + 1].p_memsz = ainfo[i].size;
     203                p_hdr[i + 1].p_flags = flags;
     204                p_hdr[i + 1].p_align = PAGE_SIZE;
     205
     206                foff += ainfo[i].size;
    171207        }
    172208
    173209        rc = write_all(fd, &elf_hdr, sizeof(elf_hdr));
    174         if (rc != EOK) {
     210        if (rc != sizeof(elf_hdr)) {
    175211                printf("Failed writing ELF header.\n");
    176212                free(p_hdr);
     
    180216        for (i = 0; i < n_ph; ++i) {
    181217                rc = write_all(fd, &p_hdr[i], sizeof(p_hdr[i]));
    182                 if (rc != EOK) {
     218                if (rc != sizeof(p_hdr[i])) {
    183219                        printf("Failed writing program header.\n");
    184220                        free(p_hdr);
     
    187223        }
    188224
    189         for (i = 0; i < n_ph; ++i) {
     225        if (lseek(fd, p_hdr[0].p_offset, SEEK_SET) == (off64_t) -1) {
     226                printf("Failed writing memory data.\n");
     227                free(p_hdr);
     228                return EIO;
     229        }
     230
     231        /*
     232         * Write note header
     233         */
     234        note.namesz = str_size("CORE") + 1;
     235        note.descsz = sizeof(elf_prstatus_t);
     236        note.type = NT_PRSTATUS;
     237
     238        rc = write_all(fd, &note, sizeof(elf_note_t));
     239        if (rc != sizeof(elf_note_t)) {
     240                printf("Failed writing note header.\n");
     241                free(p_hdr);
     242                return EIO;
     243        }
     244
     245        rc = write_all(fd, "CORE", note.namesz);
     246        if (rc != (ssize_t) note.namesz) {
     247                printf("Failed writing note header.\n");
     248                free(p_hdr);
     249                return EIO;
     250        }
     251
     252        rc = align_pos(fd, word_size);
     253        if (rc != EOK) {
     254                printf("Failed writing note header.\n");
     255                free(p_hdr);
     256                return EIO;
     257        }
     258
     259        rc = write_all(fd, &pr_status, sizeof(elf_prstatus_t));
     260        if (rc != sizeof(elf_prstatus_t)) {
     261                printf("Failed writing register data.\n");
     262                free(p_hdr);
     263                return EIO;
     264        }
     265
     266        for (i = 1; i < n_ph; ++i) {
    190267                if (lseek(fd, p_hdr[i].p_offset, SEEK_SET) == (off64_t) -1) {
    191268                        printf("Failed writing memory data.\n");
     
    193270                        return EIO;
    194271                }
    195                 if (write_mem_area(fd, &ainfo[i], sess) != EOK) {
     272                if (write_mem_area(fd, &ainfo[i - 1], sess) != EOK) {
    196273                        printf("Failed writing memory data.\n");
    197274                        free(p_hdr);
     
    210287        off64_t rva = vaddr % page_size;
    211288        off64_t rfo = foff % page_size;
    212        
     289
    213290        if (rva >= rfo)
    214291                return (foff + (rva - rfo));
    215        
     292
    216293        return (foff + (page_size + (rva - rfo)));
    217294}
     
    231308        size_t total;
    232309        uintptr_t addr;
    233         int rc;
     310        ssize_t rc;
    234311
    235312        addr = area->start_addr;
     
    245322
    246323                rc = write_all(fd, buffer, to_copy);
    247                 if (rc != EOK) {
     324                if (rc != (ssize_t) to_copy) {
    248325                        printf("Failed writing memory contents.\n");
    249326                        return EIO;
     
    257334}
    258335
    259 /** Write until the buffer is written in its entirety.
    260  *
    261  * This function fails if it cannot write exactly @a len bytes to the file.
    262  *
    263  * @param fd            The file to write to.
    264  * @param buf           Data, @a len bytes long.
    265  * @param len           Number of bytes to write.
    266  *
    267  * @return              EOK on error, return value from write() if writing
    268  *                      failed.
    269  */
    270 static int write_all(int fd, void *data, size_t len)
     336static int align_pos(int fd, size_t align)
    271337{
    272         int cnt = 0;
    273 
    274         do {
    275                 data += cnt;
    276                 len -= cnt;
    277                 cnt = write(fd, data, len);
    278         } while (cnt > 0 && (len - cnt) > 0);
    279 
    280         if (cnt < 0)
    281                 return cnt;
    282 
    283         if (len - cnt > 0)
    284                 return EIO;
     338        off64_t cur_pos;
     339        size_t rem, adv;
     340
     341        cur_pos = lseek(fd, 0, SEEK_CUR);
     342        if (cur_pos < 0)
     343                return -1;
     344
     345        rem = cur_pos % align;
     346        adv = align - rem;
     347
     348        cur_pos = lseek(fd, adv, SEEK_CUR);
     349        if (cur_pos < 0)
     350                return -1;
    285351
    286352        return EOK;
    287353}
    288354
    289 
    290355/** @}
    291356 */
  • uspace/app/taskdump/include/elf_core.h

    r15f3c3f r86ffa27f  
    3737
    3838#include <async.h>
     39#include <elf/elf_linux.h>
     40#include <libarch/istate.h>
    3941
    4042extern int elf_core_save(const char *, as_area_info_t *, unsigned int,
    41     async_sess_t *);
     43    async_sess_t *, istate_t *);
    4244
    4345#endif
  • uspace/app/taskdump/include/symtab.h

    r15f3c3f r86ffa27f  
    3636#define SYMTAB_H_
    3737
     38#include <elf/elf.h>
    3839#include <sys/types.h>
    39 #include <elf.h>
    4040
    4141typedef struct {
  • uspace/app/taskdump/symtab.c

    r15f3c3f r86ffa27f  
    3636 */
    3737
     38#include <elf/elf.h>
    3839#include <stdio.h>
    3940#include <stdlib.h>
     
    4344#include <fcntl.h>
    4445
    45 #include <elf.h>
    4646#include "include/symtab.h"
    4747
     
    5050    elf_section_header_t *shdr);
    5151static int chunk_load(int fd, off64_t start, size_t size, void **ptr);
    52 static int read_all(int fd, void *buf, size_t len);
    5352
    5453/** Load symbol table from an ELF file.
     
    9089
    9190        rc = read_all(fd, &elf_hdr, sizeof(elf_header_t));
    92         if (rc != EOK) {
     91        if (rc != sizeof(elf_header_t)) {
    9392                printf("failed reading elf header\n");
    9493                free(stab);
     
    312311
    313312        rc = read_all(fd, sec_hdr, sizeof(elf_section_header_t));
    314         if (rc != EOK)
     313        if (rc != sizeof(elf_section_header_t))
    315314                return EIO;
    316315
     
    331330static int chunk_load(int fd, off64_t start, size_t size, void **ptr)
    332331{
    333         int rc;
    334 
    335         rc = lseek(fd, start, SEEK_SET);
    336         if (rc == (off64_t) -1) {
     332        ssize_t rc;
     333        off64_t offs;
     334
     335        offs = lseek(fd, start, SEEK_SET);
     336        if (offs == (off64_t) -1) {
    337337                printf("failed seeking chunk\n");
    338338                *ptr = NULL;
     
    347347
    348348        rc = read_all(fd, *ptr, size);
    349         if (rc != EOK) {
     349        if (rc != (ssize_t) size) {
    350350                printf("failed reading chunk\n");
    351351                free(*ptr);
     
    357357}
    358358
    359 /** Read until the buffer is read in its entirety.
    360  *
    361  * This function fails if it cannot read exactly @a len bytes from the file.
    362  *
    363  * @param fd            The file to read from.
    364  * @param buf           Buffer for storing data, @a len bytes long.
    365  * @param len           Number of bytes to read.
    366  *
    367  * @return              EOK on error, EIO if file is short or return value
    368  *                      from read() if reading failed.
    369  */
    370 static int read_all(int fd, void *buf, size_t len)
    371 {
    372         int cnt = 0;
    373 
    374         do {
    375                 buf += cnt;
    376                 len -= cnt;
    377                 cnt = read(fd, buf, len);
    378         } while (cnt > 0 && (len - cnt) > 0);
    379 
    380         if (cnt < 0)
    381                 return cnt;
    382 
    383         if (len - cnt > 0)
    384                 return EIO;
    385 
    386         return EOK;
    387 }
    388 
    389359/** @}
    390360 */
  • uspace/app/taskdump/taskdump.c

    r15f3c3f r86ffa27f  
    3434
    3535#include <async.h>
     36#include <elf/elf_linux.h>
    3637#include <stdio.h>
    3738#include <stdlib.h>
     
    7273static char *get_app_task_name(void);
    7374static char *fmt_sym_address(uintptr_t addr);
     75
     76static istate_t reg_state;
    7477
    7578int main(int argc, char *argv[])
     
    293296        if (write_core_file) {
    294297                printf("Writing core file '%s'\n", core_file_name);
    295                 rc = elf_core_save(core_file_name, ainfo_buf, n_areas, sess);
     298
     299                rc = elf_core_save(core_file_name, ainfo_buf, n_areas, sess,
     300                    &reg_state);
     301
    296302                if (rc != EOK) {
    297303                        printf("Failed writing core file.\n");
     
    321327        pc = istate_get_pc(&istate);
    322328        fp = istate_get_fp(&istate);
     329
     330        /* Save register state for dumping to core file later. */
     331        reg_state = istate;
    323332
    324333        sym_pc = fmt_sym_address(pc);
  • uspace/app/trace/syscalls.c

    r15f3c3f r86ffa27f  
    8080    [SYS_SYSINFO_GET_DATA] = { "sysinfo_get_data",              5,      V_ERRNO },
    8181
    82     [SYS_DEBUG_ENABLE_CONSOLE] = { "debug_enable_console", 0,   V_ERRNO },
     82    [SYS_DEBUG_ACTIVATE_CONSOLE] = { "debug_activate_console", 0,       V_ERRNO },
    8383    [SYS_IPC_CONNECT_KBOX] = { "ipc_connect_kbox",      1,      V_ERRNO }
    8484};
Note: See TracChangeset for help on using the changeset viewer.