Changeset e07fe0c in mainline


Ignore:
Timestamp:
2005-12-12T17:23:09Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fbe058f
Parents:
ebbdb8f
Message:

added support for breakpoints to mips32

Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • arch/mips32/src/exception.c

    rebbdb8f re07fe0c  
    3838#include <print.h>
    3939#include <interrupt.h>
     40#include <func.h>
     41#include <console/kconsole.h>
    4042
    4143static char * exctable[] = {
     
    8688{
    8789        struct exception_regdump *pstate = (struct exception_regdump *)data;
     90        char *symbol = get_symtab_entry(pstate->epc);
     91
     92#ifdef CONFIG_DEBUG     
     93        printf("***Breakpoint %p in %s.\n", pstate->epc, symbol);
     94        printf("***Type 'exit' to exit kconsole.\n");
     95        /* Umm..we should rather set some 'debugstate' here */
     96        haltstate = 1;
     97        kconsole("debug");
     98        haltstate = 0;
     99#endif
     100
    88101        /* it is necessary to not re-execute BREAK instruction after
    89102           returning from Exception handler
  • generic/include/console/kconsole.h

    rebbdb8f re07fe0c  
    6969
    7070extern void kconsole_init(void);
    71 extern void kconsole(void *arg);
     71extern void kconsole(void *prompt);
    7272
    7373extern int cmd_register(cmd_info_t *cmd);
  • generic/src/console/cmd.c

    rebbdb8f re07fe0c  
    5959};
    6060
     61static cmd_info_t exit_info = {
     62        .name = "exit",
     63        .description ="Exit kconsole",
     64        .argc = 0
     65};
     66
    6167/** Data and methods for 'description' command. */
    6268static int cmd_desc(cmd_arg_t *argv);
     
    257263        if (!cmd_register(&desc_info))
    258264                panic("could not register command %s\n", desc_info.name);
     265
     266        cmd_initialize(&exit_info);
     267        if (!cmd_register(&exit_info))
     268                panic("could not register command %s\n", exit_info.name);
    259269       
    260270        cmd_initialize(&symaddr_info);
  • generic/src/console/kconsole.c

    rebbdb8f re07fe0c  
    4141#include <func.h>
    4242#include <symtab.h>
     43#include <macros.h>
    4344
    4445/** Simple kernel console.
     
    396397 * @param arg Not used.
    397398 */
    398 void kconsole(void *arg)
     399void kconsole(void *prompt)
    399400{
    400401        cmd_info_t *cmd_info;
     
    408409       
    409410        while (true) {
    410                 cmdline = clever_readline(__FUNCTION__, stdin);
     411                cmdline = clever_readline(prompt, stdin);
    411412                len = strlen(cmdline);
    412413                if (!len)
     
    415416                if (!cmd_info)
    416417                        continue;
     418                if (strncmp(cmd_info->name,"exit", \
     419                            min(strlen(cmd_info->name),5)) == 0)
     420                        break;
    417421                (void) cmd_info->func(cmd_info->argv);
    418422        }
  • generic/src/lib/func.c

    rebbdb8f re07fe0c  
    4949#ifdef CONFIG_DEBUG
    5050        printf("\n");
    51         kconsole(NULL); /* Run kconsole as a last resort to user */
     51        kconsole("panic"); /* Run kconsole as a last resort to user */
    5252#endif     
    5353
  • generic/src/main/kinit.c

    rebbdb8f re07fe0c  
    134134         * Create kernel console.
    135135         */
    136         if (t = thread_create(kconsole, NULL, TASK, 0))
     136        if (t = thread_create(kconsole, "kconsole", TASK, 0))
    137137                thread_ready(t);
    138138        else panic("thread_create/kconsole\n");
  • kernel.config

    rebbdb8f re07fe0c  
    8282@ "thread/thread1" Thread test 1
    8383@ "mm/mapping1" Mapping test 1
     84@ [ARCH=mips32] "debug/mips1" Mips breakpoint-debug test
    8485! CONFIG_TEST (choice)
Note: See TracChangeset for help on using the changeset viewer.