Changeset 442 for trunk/user/ksh/ksh.c


Ignore:
Timestamp:
May 16, 2018, 4:13:12 PM (6 years ago)
Author:
alain
Message:

Introduce idbg application.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/user/ksh/ksh.c

    r441 r442  
    238238    if( strcmp( argv[1] , "vmm" ) == 0 )
    239239    {
    240         if( argc != 3 )
    241         {
    242                     printf("  usage: display vmm pid\n");
     240        if( argc != 4 )
     241        {
     242                    printf("  usage: display vmm cxy pid\n");
    243243                    return;
    244244            }
    245245
    246             pid = atoi(argv[2]);
    247 
    248         if( display_vmm( pid ) )
    249         {
    250             printf("  error: illegal arguments pid = %x\n", pid );
     246            cxy = atoi(argv[2]);
     247            pid = atoi(argv[3]);
     248
     249        if( display_vmm( cxy , pid ) )
     250        {
     251            printf("  error: no process %x in cluster %x\n", pid , cxy );
    251252        }
    252253    }
     
    338339    if( pid == 0 )
    339340    {
    340                 printf("  error: ilegal pid format\n" );
     341                printf("  error: PID cannot be 0\n" );
    341342        }
    342343
     
    582583{
    583584        cmd_rm(argc, argv);
     585}
     586
     587///////////////////////////////////////////////
     588static void cmd_trace( int argc , char **argv )
     589{
     590    unsigned int cxy;
     591    unsigned int lid;
     592
     593        if (argc != 3)
     594    {
     595                printf("  usage: trace cxy lid \n");
     596                return;
     597        }
     598
     599    cxy = atoi(argv[1]);
     600    lid = atoi(argv[2]);
     601
     602    if( trace( 1 , cxy , lid ) )
     603    {
     604        printf("  error: core[%x,%d] not found\n", cxy, lid );
     605    }
     606}
     607
     608///////////////////////////////////////////////
     609static void cmd_untrace( int argc , char **argv )
     610{
     611    unsigned int cxy;
     612    unsigned int lid;
     613
     614        if (argc != 3)
     615    {
     616                printf("  usage: untrace cxy lid \n");
     617                return;
     618        }
     619
     620    cxy = atoi(argv[1]);
     621    lid = atoi(argv[2]);
     622
     623    if( trace( 0 , cxy , lid ) )
     624    {
     625        printf("  error: core[%x,%d] not found\n", cxy, lid );
     626    }
    584627}
    585628
     
    605648        { "rm",      "remove a file from file system",                  cmd_rm      },
    606649        { "rmdir",   "remove a directory from file system",             cmd_rmdir   },
     650        { "trace",   "activate trace for a given core",                 cmd_trace   },
     651        { "untrace", "desactivate trace for a given core",              cmd_untrace },
    607652        { NULL,      NULL,                                                                              NULL        }
    608653};
     
    702747
    703748// @@@
    704 // parse("load /bin/user/sort.elf");
     749// parse("load /bin/user/hello.elf");
    705750// @@@
    706751
Note: See TracChangeset for help on using the changeset viewer.