Changes in uspace/app/trace/trace.c [1ccafee:a000878c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/trace/trace.c
r1ccafee ra000878c 585 585 } 586 586 587 static loader_t *preload_task(const char *path, char * const argv[],587 static loader_t *preload_task(const char *path, char **argv, 588 588 task_id_t *task_id) 589 589 { … … 591 591 int rc; 592 592 593 /* Spawn a program loader */ 593 /* Spawn a program loader */ 594 594 ldr = loader_connect(); 595 595 if (ldr == NULL) … … 607 607 608 608 /* Send arguments */ 609 rc = loader_set_args(ldr, argv);609 rc = loader_set_args(ldr, (const char **) argv); 610 610 if (rc != EOK) 611 611 goto error; … … 870 870 } 871 871 872 static display_mask_t parse_display_mask(c har *text)872 static display_mask_t parse_display_mask(const char *text) 873 873 { 874 874 display_mask_t dm; 875 char *c; 876 877 c = text; 878 875 const char *c = text; 876 879 877 while (*c) { 880 878 switch (*c) { 881 case 't': dm = dm | DM_THREAD; break; 882 case 's': dm = dm | DM_SYSCALL; break; 883 case 'i': dm = dm | DM_IPC; break; 884 case 'p': dm = dm | DM_SYSTEM | DM_USER; break; 879 case 't': 880 dm = dm | DM_THREAD; 881 break; 882 case 's': 883 dm = dm | DM_SYSCALL; 884 break; 885 case 'i': 886 dm = dm | DM_IPC; 887 break; 888 case 'p': 889 dm = dm | DM_SYSTEM | DM_USER; 890 break; 885 891 default: 886 892 printf("Unexpected event type '%c'.\n", *c); 887 893 exit(1); 888 894 } 889 895 890 896 ++c; 891 897 } 892 898 893 899 return dm; 894 900 } … … 896 902 static int parse_args(int argc, char *argv[]) 897 903 { 898 char *arg;899 904 char *err_p; 900 905 901 906 task_id = 0; 902 907 903 --argc; ++argv; 908 --argc; 909 ++argv; 904 910 905 911 while (argc > 0) { 906 arg = *argv;912 char *arg = *argv; 907 913 if (arg[0] == '+') { 908 914 display_mask = parse_display_mask(&arg[1]); … … 910 916 if (arg[1] == 't') { 911 917 /* Trace an already running task */ 912 --argc; ++argv; 918 --argc; 919 ++argv; 913 920 task_id = strtol(*argv, &err_p, 10); 914 921 task_ldr = NULL; … … 927 934 break; 928 935 } 929 930 --argc; ++argv; 936 937 --argc; 938 ++argv; 931 939 } 932 940 933 941 if (task_id != 0) { 934 if (argc == 0) return 0; 942 if (argc == 0) 943 return 0; 935 944 printf("Extra arguments\n"); 936 945 print_syntax(); … … 946 955 /* Preload the specified program file. */ 947 956 printf("Spawning '%s' with arguments:\n", *argv); 948 { 949 char **cp = argv; 950 while (*cp) printf("'%s'\n", *cp++); 951 } 957 958 char **cp = argv; 959 while (*cp) 960 printf("'%s'\n", *cp++); 961 952 962 task_ldr = preload_task(*argv, argv, &task_id); 953 963 task_wait_for = true;
Note:
See TracChangeset
for help on using the changeset viewer.