Changeset 5bda2f96 in mainline
- Timestamp:
- 2010-02-09T21:03:02Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 83b4cf53
- Parents:
- 696979ce (diff), a60b2d7 (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. - Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
r696979ce r5bda2f96 505 505 ! [CONFIG_START_BD=y] CONFIG_MOUNT_DATA (n/y) 506 506 507 % Verbose task dumps508 ! CONFIG_ VERBOSE_DUMPS (n/y)507 % Write core files 508 ! CONFIG_WRITE_CORE_FILES (n/y) -
uspace/app/taskdump/Makefile
r696979ce r5bda2f96 34 34 35 35 SOURCES = \ 36 elf_core.c \ 36 37 taskdump.c \ 37 38 symtab.c -
uspace/app/taskdump/include/elf.h
r696979ce r5bda2f96 148 148 #define SHF_MASKPROC 0xf0000000 149 149 150 /** Macros for decomposing elf_symbol.st_info into binging and type */ 151 #define ELF_ST_BIND(i) ((i) >> 4) 152 #define ELF_ST_TYPE(i) ((i) & 0x0f) 153 #define ELF_ST_INFO(b, t) (((b) << 4) + ((t) & 0x0f)) 154 150 155 /** 151 156 * Symbol binding -
uspace/app/taskdump/symtab.c
r696979ce r5bda2f96 206 206 size_t i; 207 207 char *sname; 208 unsigned stype; 208 209 209 210 for (i = 0; i < st->sym_size / sizeof(elf_symbol_t); ++i) { 210 211 if (st->sym[i].st_name == 0) 212 continue; 213 214 stype = ELF_ST_TYPE(st->sym[i].st_info); 215 if (stype != STT_OBJECT && stype != STT_FUNC) 211 216 continue; 212 217 … … 240 245 uintptr_t saddr, best_addr; 241 246 char *sname, *best_name; 247 unsigned stype; 242 248 243 249 best_name = NULL; … … 248 254 continue; 249 255 256 stype = ELF_ST_TYPE(st->sym[i].st_info); 257 if (stype != STT_OBJECT && stype != STT_FUNC && 258 stype != STT_NOTYPE) { 259 continue; 260 } 261 250 262 saddr = st->sym[i].st_value; 251 263 sname = st->strtab + st->sym[i].st_name; 264 265 /* An ugly hack to filter out some special ARM symbols. */ 266 if (sname[0] == '$') 267 continue; 252 268 253 269 if (best_name == NULL || (saddr <= addr && saddr > best_addr)) { -
uspace/app/taskdump/taskdump.c
r696979ce r5bda2f96 40 40 #include <udebug.h> 41 41 #include <task.h> 42 #include < kernel/mm/as.h>42 #include <as.h> 43 43 #include <sys/types.h> 44 44 #include <sys/typefmt.h> … … 49 49 50 50 #include <symtab.h> 51 #include <elf_core.h> 51 52 #include <stacktrace.h> 52 53 … … 58 59 static int phoneid; 59 60 static task_id_t task_id; 60 static bool dump_memory; 61 static bool write_core_file; 62 static char *core_file_name; 61 63 static char *app_name; 62 64 static symtab_t *app_symtab; … … 80 82 int rc; 81 83 82 /*83 * FIXME: The stdio module cannot currently detect whether we are84 * writing to a console or file. This workaround make file output85 * faster.86 */87 setvbuf(stdout, NULL, _IOFBF, 32768);88 89 84 printf("Task Dump Utility\n"); 90 dump_memory= false;85 write_core_file = false; 91 86 92 87 if (parse_args(argc, argv) < 0) … … 172 167 return -1; 173 168 } 174 } else if (arg[1] == 'm' && arg[2] == '\0') { 175 dump_memory = true; 169 } else if (arg[1] == 'c' && arg[2] == '\0') { 170 write_core_file = true; 171 172 --argc; ++argv; 173 core_file_name = *argv; 176 174 } else { 177 175 printf("Uknown option '%s'\n", arg[0]); … … 203 201 static void print_syntax(void) 204 202 { 205 printf("Syntax: taskdump [- m] -t <task_id>\n");206 printf("\t- m\tDump memory area contents.\n");203 printf("Syntax: taskdump [-c <core_file>] -t <task_id>\n"); 204 printf("\t-c <core_file_id>\tName of core file to write.\n"); 207 205 printf("\t-t <task_id>\tWhich task to dump.\n"); 208 206 } … … 297 295 (ainfo_buf[i].flags & AS_AREA_CACHEABLE) ? 'C' : '-', 298 296 ainfo_buf[i].start_addr, ainfo_buf[i].size); 299 300 if (dump_memory) { 301 putchar('\n'); 302 area_dump(&ainfo_buf[i]); 303 putchar('\n'); 297 } 298 299 putchar('\n'); 300 301 if (write_core_file) { 302 printf("Writing core file '%s'\n", core_file_name); 303 rc = elf_core_save(core_file_name, ainfo_buf, n_areas, phoneid); 304 if (rc != EOK) { 305 printf("Failed writing core file.\n"); 306 return EIO; 304 307 } 305 308 } 306 307 putchar('\n');308 309 309 310 free(ainfo_buf); -
uspace/srv/bd/file_bd/file_bd.c
r696979ce r5bda2f96 48 48 #include <devmap.h> 49 49 #include <sys/types.h> 50 #include <sys/typefmt.h> 50 51 #include <errno.h> 51 52 #include <bool.h> … … 207 208 int rc; 208 209 210 /* Check whether access is within device address bounds. */ 211 if (ba + cnt > num_blocks) { 212 printf(NAME ": Accessed blocks %" PRIuBN "-%" PRIuBN ", while " 213 "max block number is %" PRIuBN ".\n", ba, ba + cnt - 1, 214 num_blocks - 1); 215 return ELIMIT; 216 } 217 209 218 fibril_mutex_lock(&dev_lock); 210 219 … … 237 246 int rc; 238 247 248 /* Check whether access is within device address bounds. */ 249 if (ba + cnt > num_blocks) { 250 printf(NAME ": Accessed blocks %" PRIuBN "-%" PRIuBN ", while " 251 "max block numeber is %" PRIuBN ".\n", ba, ba + cnt - 1, 252 num_blocks - 1); 253 return ELIMIT; 254 } 255 239 256 fibril_mutex_lock(&dev_lock); 240 257 -
uspace/srv/taskmon/taskmon.c
r696979ce r5bda2f96 49 49 static void fault_event(ipc_callid_t callid, ipc_call_t *call) 50 50 { 51 char *argv[ 11];51 char *argv[6]; 52 52 char *fname; 53 53 char *dump_fname; … … 66 66 } 67 67 68 if (asprintf(&dump_fname, "/ scratch/d" PRIuTASKID ".txt", taskid) < 0) {68 if (asprintf(&dump_fname, "/data/core%" PRIuTASKID, taskid) < 0) { 69 69 printf("Memory allocation failed.\n"); 70 70 return; … … 73 73 printf(NAME ": Task %" PRIuTASKID " fault in thread %p.\n", taskid, thread); 74 74 75 #ifdef CONFIG_VERBOSE_DUMPS 76 argv[0] = "/app/redir"; 77 argv[1] = "-i"; 78 argv[2] = "/readme"; 79 argv[3] = "-o"; 80 argv[4] = dump_fname; 81 argv[5] = "--"; 82 argv[6] = "/app/taskdump"; 83 argv[7] = "-m"; 84 argv[8] = "-t"; 85 argv[9] = s_taskid; 86 argv[10] = NULL; 75 #ifdef CONFIG_WRITE_CORE_FILES 76 argv[0] = "/app/taskdump"; 77 argv[1] = "-c"; 78 argv[2] = dump_fname; 79 argv[3] = "-t"; 80 argv[4] = s_taskid; 81 argv[5] = NULL; 87 82 #else 88 83 argv[0] = "/app/taskdump";
Note:
See TracChangeset
for help on using the changeset viewer.