Changes between Version 27 and Version 28 of Tools/Gdb Server


Ignore:
Timestamp:
Dec 4, 2013, 11:41:42 AM (10 years ago)
Author:
porquet
Comment:

add doc on "monitor dump" and new "monitor issdebug" commands

Legend:

Unmodified
Added
Removed
Modified
  • Tools/Gdb Server

    v27 v28  
    22= GDB Server for SoCLib =
    33
    4 The !GdbServer tool is a software debugger for !SoCLib.
     4The !GdbServer tool is a software debugger for SoCLib.
    55
    66== Overview ==
    77
    8 The !GdbServer is able to manage all processors in a !SoCLib platform. It listens for TCP connection from [http://www.gnu.org/software/gdb/ Gnu GDB] clients. Once connected, clients can be used to freeze, run, step every processor in the platform, add breakpoints, catch exceptions and dump registers and memory content.
     8The !GdbServer is able to manage all processors in a SoCLib platform. It listens for TCP connection from [http://www.gnu.org/software/gdb/ Gnu GDB] clients. Once connected, clients can be used to freeze, run, step every processor in the platform, add breakpoints, catch exceptions and dump registers and memory content.
    99
    1010The !GdbServer is not the only software debugger tool available for SoCLib. The [wiki:Tools/MemoryChecker Memory checker tool] can be of some help to track bugs too.
     
    1212== Implementation ==
    1313
    14 The !GdbServer contains no processor specific code and can be used to manage any !SoCLib processor model using the generic Iss interface. It is implemented as an Iss wrapper class. When the !GdbServer is in use, it intercepts all events between the processor Iss model and the !SoCLib platform. This enables the !GdbServer to access platform resources as viewed from the processor without modifying platform components or processor model source code. The !GdbServer is able to freeze the wrapped processor model while the platform is still running.
     14The !GdbServer contains no processor specific code and can be used to manage any SoCLib processor model using the generic Iss interface. It is implemented as an Iss wrapper class. When the !GdbServer is in use, it intercepts all events between the processor Iss model and the SoCLib platform. This enables the !GdbServer to access platform resources as viewed from the processor without modifying any platform components or processor model source code. The !GdbServer is able to freeze the wrapped processor model while the platform is still running.
    1515
    1616In order to simplify the debug in a multi-processor context, all processors wrapped in a !GdbServer will be frozen when a breakpoint is detected in one single processor.
     
    186186 It can be view as the counterpart of the command {{{add-symbol-file}}} except it is done on server side (and the "load address" can not be specified, the file is loaded according to its internal information, e.g. LMA/VMA)
    187187
     188 * The gdb server is able to force the ISS to dump its internal state (in the simulation window) by executing the following command:
     189{{{
     190(gdb) monitor dump
     191}}}
     192
     193 * The ISS2 abstraction defines a ([[wiki:/Component/Iss2Api#voidset_debug_maskandthem_debug_maskvariable|debug mask]]), that enables displaying debugging information during the simulation. This mask can be set via the gdb server with the following command ({{{val}}} is the new value of the mask):
     194{{{
     195(gdb) monitor issdebug val
     196}}}
     197 At the moment, only the MIPS32 model supports the debug mask and defines the following values:
     198  * 0x1 (MIPS32_DEBUG_ISS - print ISS signal state)
     199  * 0x2 (MIPS32_DEBUG_CPU - print CPU instructions & registers)
     200  * 0x4 (MIPS32_DEBUG_INTERNAL - CPU internal state)
     201  * 0x8 (MIPS32_DEBUG_IRQ - print CPU irq state)
     202  * 0x10 (MIPS32_DEBUG_DATA - print CPU load/store)
     203
    188204 * Cycle breakpoints can be used to instruct the `GdbServer` to stop the simulation at a given cycle number. This enables taking advantage of the fact that SoCLib simulations always yield the same result when executed multiple times. This allows starting a simulation again with a cycle break point to examine the simulator state just before a chosen point is reached or particular event happens. Cycle counts are reported when using the call trace feature for instance. The `SOCLIB_GDB_CYCLEBP` environment variable must be set to the breaking cycle number to define a cycle break point.
    189205