public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: sergey.belyashov@gmail.com, gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb] Add Z80 CPU basic support
Date: Thu, 24 Sep 2020 10:08:22 -0400	[thread overview]
Message-ID: <34795027-0954-e286-dc1a-1f810a8ff6e1@simark.ca> (raw)
In-Reply-To: <20200924082621.19370-1-sergey.belyashov@gmail.com>

Thanks, I was able to apply it successfully.  It doesn't build, however,
please make sure it builds against the current master.

Some questions:

- What's the history behind this code?  Is is currently maintained
  somewhere else?  Do you own it all?  In order to push that code (and
  transfer the copyright to the FSF), everybody who currently owns it
  must have an assignment on file, normally.
- How do you test this?  How can I test this?  Add this to the commit
  message.
- Did you manage to run parts of the GDB testsuite against this?
- If I want more information about the Z80 architecture, such as the ISA
  details, ABI, etc, where do I look?  It would also be a good idea to
  add this to the commit message.
- I see mention of "eZ80".  Can you provide information about what CPUs
  are supported, what CPUs are not supported?  Include any relevant
  detail like that in the commit message.

We want to avoid people dropping code and then leaving a maintenance
burden to others.  Ideally, each architecture should have a maintainer
(listed in the MAINTAINERS file) responsible for reviewing patches about
that architecture, and to whom we can reach out for questions about that
architecture.  Would you be ready to accept such a role?

Please include the ChangeLog entries in the commit message. Take this
patch as an example:

  https://sourceware.org/pipermail/gdb-patches/2020-September/171620.html

You can add the NEWS entry directly in the commit.

> diff --git a/gdb/features/z80-cpu.xml b/gdb/features/z80-cpu.xml
> new file mode 100644
> index 0000000000..d8093d68b9
> --- /dev/null
> +++ b/gdb/features/z80-cpu.xml
> @@ -0,0 +1,34 @@
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2020 Free Software Foundation, Inc.
> +
> +     Copying and distribution of this file, with or without modification,
> +     are permitted in any medium without royalty provided the copyright
> +     notice and this notice are preserved.  -->
> +
> +<!DOCTYPE feature SYSTEM "gdb-target.dtd">
> +<feature name="org.gnu.gdb.z80.cpu">
> +  <flags id="af_flags" size="2">
> +    <field name="C" start="0" end="0"/>
> +    <field name="N" start="1" end="1"/>
> +    <field name="P/V" start="2" end="2"/>
> +    <field name="F3" start="3" end="3"/>
> +    <field name="H" start="4" end="4"/>
> +    <field name="F5" start="5" end="5"/>
> +    <field name="Z" start="6" end="6"/>
> +    <field name="S" start="7" end="7"/>
> +  </flags>
> +  <reg name="af" bitsize="16" type="af_flags"/>
> +  <reg name="bc" bitsize="16" type="uint16"/>
> +  <reg name="de" bitsize="16" type="data_ptr"/>
> +  <reg name="hl" bitsize="16" type="data_ptr"/>
> +  <reg name="sp" bitsize="16" type="data_ptr" />
> +  <reg name="pc" bitsize="32" type="code_ptr" />
> +  <reg name="ix" bitsize="16" type="data_ptr"/>
> +  <reg name="iy" bitsize="16" type="data_ptr"/>
> +  <reg name="af'" bitsize="16" type="af_flags"/>
> +  <reg name="bc'" bitsize="16" type="uint16"/>
> +  <reg name="de'" bitsize="16" type="data_ptr"/>
> +  <reg name="hl'" bitsize="16" type="data_ptr"/>
> +  <reg name="ir" bitsize="16" type="uint16"/>
> +<!--  <reg name="sps" bitsize="16" type="uint16"/> -->
> +</feature>

Shouldn't there be two different target descriptions for Z80 and eZ80?

> diff --git a/gdb/regformats/z80.dat b/gdb/regformats/z80.dat
> new file mode 100644
> index 0000000000..05580c8588
> --- /dev/null
> +++ b/gdb/regformats/z80.dat

I don't think you need a .dat file, today it's only used by some
remaining GDBserver ports.

> @@ -0,0 +1,18 @@
> +# THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi :set ro:
> +# Generated from: z80.xml
> +name:z80
> +xmltarget:z80.xml
> +expedite:sp,pc
> +16:af
> +16:bc
> +16:de
> +16:hl
> +16:sp
> +32:pc
> +16:ix
> +16:iy
> +16:af'
> +16:bc'
> +16:de'
> +16:hl'
> +16:ir
> diff --git a/gdb/stubs/z80-stub.c b/gdb/stubs/z80-stub.c
> new file mode 100644
> index 0000000000..36316b95ba
> --- /dev/null
> +++ b/gdb/stubs/z80-stub.c

What is this file for?  How do I use it?

Simon

  reply	other threads:[~2020-09-24 14:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23  9:21 [PATCH] Add Zilog Z80 CPU (and derivatives) support Sergey Belyashov
2020-09-24  2:55 ` Simon Marchi
2020-09-24  2:57   ` Simon Marchi
2020-09-24  8:26     ` [PATCH] [gdb] Add Z80 CPU basic support sergey.belyashov
2020-09-24 14:08       ` Simon Marchi [this message]
2020-09-24 15:21         ` Sergey Belyashov
2020-09-24 15:42           ` Simon Marchi
2020-09-24 15:22         ` [PATCH v3] " Sergey Belyashov
2020-09-24 15:44           ` Simon Marchi
2020-09-25 11:40             ` [PATCH v4] [gdb] Add basic Z80 CPU support Sergey Belyashov
2020-10-06 10:17               ` Sergey Belyashov
2020-10-07  3:07                 ` Simon Marchi
2021-05-24 19:13               ` Joel Brobecker
2021-07-12 21:37               ` Simon Marchi
2021-07-13  5:42                 ` Sergey Belyashov
2021-07-13 13:01                   ` Simon Marchi
2021-07-13 13:28                     ` Sergey Belyashov
2021-07-15  2:23                       ` Simon Marchi
2021-07-15  2:29                         ` [PATCH v5] " Simon Marchi
2021-07-15  7:19                           ` Sergey Belyashov
2020-09-25 12:40             ` [PATCH v3] [gdb] Add Z80 CPU basic support Sergey Belyashov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34795027-0954-e286-dc1a-1f810a8ff6e1@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=sergey.belyashov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).