This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Remote serial debuggers


Russell Shaw wrote:
Hi,
What gdb file handles the remote stub interaction? Is it remote.c?


remote.c if you use gdbserver or any stub which follows GDB's remote serial protocol.


I noticed there's other monitors such as remote-e7000.c, remote-hms.c, etc.
Do these monitors talk to a debugger using their own protocol instead of the
default gdb stub way?

I assume so . e7000 seems to have its own protocol to communicate to the stub.




Some remotes use: static struct monitor_ops and others use: struct target_ops

What's the difference between a monitor and a target?

The manual says and I quote:


<begin quote>

A "target" is the execution environment occupied by your program. Often, GDB runs in the same host environment as your program; in
that case, the debugging target is specified as a side effect when you
use the `file' or `core' commands. When you need more flexibility--for
example, running GDB on a physically separate host, or controlling a
standalone system over a serial port or a realtime system over a TCP/IP
connection--you can use the `target' command to specify one of the
target types configured for GDB


<end quote>


So a target is slightly more generic than a monitor. GDB allows you to use upto 3 targets at the same time. You can be looking at an executable , a core file and processes. Different commands would automatically choose the right target in the target "stratum" / stack according to GDB terminology. For more info refer to info gdb and search for Active Targets. (Targets could be a remote target, jtag, rom monitor, a native executable, a remote proxy ) .




A monitor AFAIK refers to just ROM Monitors and an abstraction to use them . So a monitor would be a target and not vice versa ! :-) ...

HTH

cheers
Ramana


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]