xref: /netbsd-src/external/gpl3/gdb/dist/sim/erc32/README.gdb (revision 4e98e3e176b5b8ca424663e164635936964c902b)
1*4e98e3e1SchristosHow to use SIS with GDB
2*4e98e3e1Schristos-----------------------
3*4e98e3e1Schristos
4*4e98e3e1Schristos1. Building GDB with SIS
5*4e98e3e1Schristos
6*4e98e3e1SchristosTo build GDB with the SIS/ERC32 simulator, configure with option
7*4e98e3e1Schristos'--target sparc-erc32-aout' and build as usual.
8*4e98e3e1Schristos
9*4e98e3e1Schristos2. Attaching the simulator
10*4e98e3e1Schristos
11*4e98e3e1SchristosTo attach GDB to the simulator, use:
12*4e98e3e1Schristos
13*4e98e3e1Schristostarget sim [options] [files]
14*4e98e3e1Schristos
15*4e98e3e1SchristosThe following options are supported:
16*4e98e3e1Schristos
17*4e98e3e1Schristos -nfp		Disable FPU. FPops will cause an FPU disabled trap.
18*4e98e3e1Schristos
19*4e98e3e1Schristos -freq <f>	Set the simulated "system clock" to <f> MHz.
20*4e98e3e1Schristos
21*4e98e3e1Schristos -v		Verbose mode.
22*4e98e3e1Schristos
23*4e98e3e1Schristos -nogdb		Disable GDB breakpoint handling (see below)
24*4e98e3e1Schristos
25*4e98e3e1SchristosThe listed [files] are expected to be in aout format and will be
26*4e98e3e1Schristosloaded in the simulator memory prior. This could be used to load
27*4e98e3e1Schristosa boot block at address 0x0 if the application is linked to run
28*4e98e3e1Schristosfrom RAM (0x2000000).
29*4e98e3e1Schristos
30*4e98e3e1SchristosTo start debugging a program type 'load <program>' and debug as
31*4e98e3e1Schristosusual.
32*4e98e3e1Schristos
33*4e98e3e1SchristosThe native simulator commands can be reached using the GDB 'sim'
34*4e98e3e1Schristoscommand:
35*4e98e3e1Schristos
36*4e98e3e1Schristossim <sis_command>
37*4e98e3e1Schristos
38*4e98e3e1SchristosDirect simulator commands during a GDB session must be issued
39*4e98e3e1Schristoswith care not to disturb GDB's operation ...
40*4e98e3e1Schristos
41*4e98e3e1SchristosFor info on supported ERC32 functionality, see README.sis.
42*4e98e3e1Schristos
43*4e98e3e1Schristos
44*4e98e3e1Schristos3. Loading aout files
45*4e98e3e1Schristos
46*4e98e3e1SchristosThe GDB load command loads an aout file into the simulator
47*4e98e3e1Schristosmemory with the data section starting directly after the text
48*4e98e3e1Schristossection regardless of wich start address was specified for the data
49*4e98e3e1Schristosat link time! This means that your applications either has to include
50*4e98e3e1Schristosa routine that initialise the data segment at the proper address or
51*4e98e3e1Schristoslink with the data placed directly after the text section.
52*4e98e3e1Schristos
53*4e98e3e1SchristosA copying routine is fairly simple, just copy all data between
54*4e98e3e1Schristos_etext and _data to a memory loaction starting at _environ. This
55*4e98e3e1Schristosshould be done at the same time as the bss is cleared (in srt0.s).
56*4e98e3e1Schristos
57*4e98e3e1Schristos
58*4e98e3e1Schristos4. GDB breakpoint handling
59*4e98e3e1Schristos
60*4e98e3e1SchristosGDB inserts breakpoint in the form of the 'ta 1' instruction. The
61*4e98e3e1SchristosGDB-integrated simulator will therefore recognize the breakpoint
62*4e98e3e1Schristosinstruction and return control to GDB. If the application uses
63*4e98e3e1Schristos'ta 1', the breakpoint detection can be disabled with the -nogdb
64*4e98e3e1Schristosswitch. In this case however, GDB breakpoints will not work.
65*4e98e3e1Schristos
66*4e98e3e1Schristos
67*4e98e3e1SchristosReport problems to Jiri Gaisler ESA/ESTEC (jgais@wd.estec.esa.nl)
68