public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* porting gdbserver
@ 2020-10-15 16:34 William Tambe
  2020-10-15 18:23 ` Luis Machado
  0 siblings, 1 reply; 3+ messages in thread
From: William Tambe @ 2020-10-15 16:34 UTC (permalink / raw)
  To: gdb

Is there an easy to follow documentation or commit that shows how to port
gdbserver for baremetal ?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: porting gdbserver
  2020-10-15 16:34 porting gdbserver William Tambe
@ 2020-10-15 18:23 ` Luis Machado
  2020-10-16  6:25   ` Christo Crause
  0 siblings, 1 reply; 3+ messages in thread
From: Luis Machado @ 2020-10-15 18:23 UTC (permalink / raw)
  To: William Tambe, gdb

Hi,

On 10/15/20 1:34 PM, William Tambe via Gdb wrote:
> Is there an easy to follow documentation or commit that shows how to port
> gdbserver for baremetal ?
> 

I'm afraid there isn't. I suppose you are talking about actually coming 
up with a debugging stub that implements the most minimal set of remote 
protocol packets, right? Not "gdbserver" itself, which is always OS-hosted.

 From the documentation here...

https://sourceware.org/gdb/onlinedocs/gdb/Overview.html#Overview

... it says:

"At a minimum, a stub is required to support the ‘?’ command to tell GDB 
the reason for halting, ‘g’ and ‘G’ commands for register access, and 
the ‘m’ and ‘M’ commands for memory access. Stubs that only control 
single-threaded targets can implement run control with the ‘c’ 
(continue) command, and if the target architecture supports 
hardware-assisted single-stepping, the ‘s’ (step) command. Stubs that 
support multi-threading targets should support the ‘vCont’ command. All 
other commands are optional."

But the above may be stale at this point.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: porting gdbserver
  2020-10-15 18:23 ` Luis Machado
@ 2020-10-16  6:25   ` Christo Crause
  0 siblings, 0 replies; 3+ messages in thread
From: Christo Crause @ 2020-10-16  6:25 UTC (permalink / raw)
  To: Luis Machado; +Cc: William Tambe, gdb

On Thu, 15 Oct 2020, 20:24 Luis Machado via Gdb, <gdb@sourceware.org> wrote:

> Hi,
>
> On 10/15/20 1:34 PM, William Tambe via Gdb wrote:
> > Is there an easy to follow documentation or commit that shows how to port
> > gdbserver for baremetal ?
> >
>
> I'm afraid there isn't. I suppose you are talking about actually coming
> up with a debugging stub that implements the most minimal set of remote
> protocol packets, right? Not "gdbserver" itself, which is always OS-hosted.


An example of a bare metal stub on an 8 bit AVR:
https://github.com/jdolinay/avr_debug

The remote protocol handling is implemented here
https://github.com/jdolinay/avr_debug/blob/master/avr8-stub/avr8-stub.c

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-16  6:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-15 16:34 porting gdbserver William Tambe
2020-10-15 18:23 ` Luis Machado
2020-10-16  6:25   ` Christo Crause

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).