[OSy] msim & gdb
martinec
martinec at d3s.mff.cuni.cz
Mon Nov 7 20:03:33 CET 2011
Dobry den,
>> Podarilo se mi pripojit cross-gdb a nyni nevim, jak pustit samotny
>> simulator?
>
> Staci standardne v GDB pouzit prikaz "continue" (pripadne prikazy pro
> krokovani po instrukcich, zdrojovych radcich apod.).
Je tam jeste drobny hacek, ze se musi nastavit endianita ladene
platformy na little-endian. Pro jistotu vkladam okomentovane prikazy,
kterymi spoustim ladeni msimu ja. Prikazy je mozne umistit do
inicializacniho souboru gdb, aby se nemusely porad vypisovat.
tomas at tomas-laptop:~/workspaceGDB/gdb-7.2/gdb$ ./gdb
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show
copying"and "show warranty" for details.
// zde je z polozky target videt, jestli pouzivate spravne gdb
This GDB was configured as "--host=i686-pc-linux-gnu --target=mips".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
// nacteni ladicich informaci z elf binarky
(gdb) symbol-file ./../../../workspaceCDT/msim/trunk/bin/kernel/kernel.raw
Reading symbols from
/home/tomas/runtime-EclipseApplication/kalisto/kernel/kernel.raw...done.
// nastaveni spravne endianity
(gdb) set endian little
The target is assumed to be little endian
// pripojeni se k msimu
(gdb) target remote :10001
Remote debugging using :10001
0xbfc00000 in ?? ()
// nastaveni breakpointu do hlavni funkce Kalista
(gdb) break bsp_start
Breakpoint 1 at 0x80002540: file main.c, line 66.
// spusteni msimu
(gdb) continue
Continuing.
[New Thread 1]
[Switching to Thread 1]
Breakpoint 1, bsp_start () at main.c:66
66 /* Say hello :-) We write a small message after each
(gdb)
>> A dale me zajima, zda jsem schopen nejak dodat debugovaci symboly pro
>> debugger?
>
> Pokud mate jako mezivysledek prekladu Vaseho kernelu soubor ve formatu
> ELF, je mozne z nej nacist symboly do GDB pomoci prikazu "symbol-file".
> Pochopitelne zalezi na tom, jaky pouzivate linker skript a jake
> informace se do toho ELF obrazu prilinkuji.
Pro doplneni - po prekladu Kalista se ty ladici informace nachazeji v
souboru kernel.raw.
S pozdravem,
Tomas Martinec
More information about the NSWI004
mailing list