Changes between Version 4 and Version 5 of CoreFiles
- Timestamp:
- 2014-06-17T14:27:12Z (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CoreFiles
v4 v5 1 1 = Working with core files = 2 2 3 HelenOS can nowproduce an ELF core file when a task crashes. While you cannot really use it yet in HelenOS directly, you can extract this core file and use it with GDB to debug the application.3 HelenOS can produce an ELF core file when a task crashes. While you cannot really use it yet in HelenOS directly, you can extract this core file and use it with GDB to debug the application. 4 4 5 5 Note that all architectures do not support saving register state in the core file, see [wiki:ArchFeature], check the line labeled ''Write GP-register state to core file''. If the architecture does not support it, you will not be able to view register state nor a stack trace in GDB! 6 6 7 Here we assume you are using Linux as your host system and that you run HelenOS in Q emu.7 Here we assume you are using Linux as your host system and that you run HelenOS in QEMU. 8 8 9 9 First configure and build HelenOS as follows: 10 10 11 11 * Load preconfigured defaults: ia32 (or amd64) 12 * Enable options: Load disk drivers on startup, Mount /data on startup,Write core files12 * Enable the configuration option: Write core files 13 13 14 Now we need a disk image with a FAT file system. Make sure it has at least 20 MB (we are using 4 kB clusters and we must have at least 4 k clusters for FAT16).14 Now we need a disk image with a FAT file system. Make sure it has at least 20 MB (we are using 4 KB clusters and we must have at least 4 k clusters for FAT16). 15 15 16 16 {{{ … … 21 21 }}} 22 22 23 Run HelenOS in Q emu now and it will mount the new filesystem on {{{/data}}} automatically.23 Run HelenOS in QEMU. 24 24 25 25 {{{ 26 $ qemu -hda img -cdrom image.iso -boot d 26 $ qemu-system-i386 -hda img -cdrom image.iso -boot d 27 $ qemu-system-x86_64 -hda img -cdrom image.iso -boot d 27 28 }}} 29 30 The ATA driver should detect the disk device. Use the following commands to find the ATA device name and mount it. 31 32 {{{ 33 # loc 34 bd: 35 devices/\hw\pci0\00:01.0\ata-c1\d0 : devman 36 devices/\hw\pci0\00:01.0\ata-c2\d0 : devman 37 ... 38 # fat 39 # mount fat /data devices/\hw\pci0\00:01.0\ata-c1\d0 40 }}} 41 42 The first ATA device is usually the hard disk, the second ATA device is usually the CD-ROM drive. You have to manually start the FAT file system driver (if it is not yet stated) and mount the file system under /data. 28 43 29 44 Good. Now we can take the crashdump. If you run {{{tester fault1}}} it will save a core dump under /data. Another way is to dump a running task. Let's start Tetris, determine it's task ID using the kernel console and finally run {{{taskdump}}} on it.