unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#58971] [PATCH] gnu: Add avr-gdb.
@ 2022-11-02 19:49 Kristian Lein-Mathisen
  2022-11-03 17:31 ` Christopher Baines
  0 siblings, 1 reply; 5+ messages in thread
From: Kristian Lein-Mathisen @ 2022-11-02 19:49 UTC (permalink / raw)
  To: 58971


[-- Attachment #1.1: Type: text/plain, Size: 244 bytes --]

I'd like to have avr-gdb available in GNU Guix.
I've used the Arch Linux PKGFILE as basis:

https://github.com/archlinux/svntogit-community/blob/fa92f7b2008ec/trunk/PKGBUILD

I'm hoping this'll be considered for inclusion upstream.

Thanks,
K.

[-- Attachment #1.2: Type: text/html, Size: 500 bytes --]

[-- Attachment #2: 0001-gnu-Add-avr-gdb.patch --]
[-- Type: text/x-patch, Size: 1088 bytes --]

From daa7559c6c1fb23ab11bdbeb2d81f751a5cc2400 Mon Sep 17 00:00:00 2001
From: Kristian Lein-Mathisen <kristianlein@gmail.com>
Date: Wed, 2 Nov 2022 20:36:51 +0100
Subject: [PATCH] gnu: Add avr-gdb.

* gnu/packages/gdb.scm (avr-gdb): New variable.
---
 gnu/packages/gdb.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gnu/packages/gdb.scm b/gnu/packages/gdb.scm
index 7d8416c7c5..e09f7cf41a 100644
--- a/gnu/packages/gdb.scm
+++ b/gnu/packages/gdb.scm
@@ -171,3 +171,15 @@ (define-public gdb-minimal
     (name "gdb-minimal")
     (inputs (fold alist-delete (package-inputs gdb)
                   '("libxml2" "ncurses" "python-wrapper" "source-highlight")))))
+
+(define-public avr-gdb
+  (package/inherit gdb-12
+    (name "avr-gdb")
+    (arguments
+     `(#:configure-flags
+       (list "--target=avr"
+             "--disable-nls"
+             "--enable-languages=c,c++"
+             "--with-system-readline"
+             "--enable-source-highlight")
+       ,@(package-arguments gdb-12)))))

base-commit: 807bfe55dc382b88ab0fdade6886dfa2b15487ee
-- 
2.38.0


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

* [bug#58971] [PATCH] gnu: Add avr-gdb.
  2022-11-02 19:49 [bug#58971] [PATCH] gnu: Add avr-gdb Kristian Lein-Mathisen
@ 2022-11-03 17:31 ` Christopher Baines
  2022-11-03 18:24   ` Kristian Lein-Mathisen
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher Baines @ 2022-11-03 17:31 UTC (permalink / raw)
  To: Kristian Lein-Mathisen; +Cc: 58971

[-- Attachment #1: Type: text/plain, Size: 990 bytes --]


Kristian Lein-Mathisen <kristianlein@gmail.com> writes:

> I'd like to have avr-gdb available in GNU Guix.
> I've used the Arch Linux PKGFILE as basis:
>
> https://github.com/archlinux/svntogit-community/blob/fa92f7b2008ec/trunk/PKGBUILD

Hi Kristian,

This seems OK to me, although I don't know what this package is for?

Given this is inheriting from gdb, it'll have the same synopiss and
description:

  synopsis: The GNU debugger
  description: GDB is the GNU debugger.  With it, you can monitor what a program
  + is doing while it runs or what it was doing just before a crash.  It allows
  + you to specify the runtime conditions, to define breakpoints, and to change
  + how the program is running to try to fix bugs.  It can be used to debug
  + programs written in C, C++, Ada, Objective-C, Pascal and more.

So, I think if there is something different about this avr-gdb, it would
be good to specify a appropriate synopsis and description. Does that
make sense?

Thanks,

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

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

* [bug#58971] [PATCH] gnu: Add avr-gdb.
  2022-11-03 17:31 ` Christopher Baines
@ 2022-11-03 18:24   ` Kristian Lein-Mathisen
  2022-11-05  2:21     ` Thiago Jung Bauermann via Guix-patches via
  2022-11-07 19:59     ` Christopher Baines
  0 siblings, 2 replies; 5+ messages in thread
From: Kristian Lein-Mathisen @ 2022-11-03 18:24 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 58971


[-- Attachment #1.1: Type: text/plain, Size: 2339 bytes --]

Hi Chris and thanks for looking into this,

Your proposal is very reasonable. I wasn't sure what to write but I've
given it a try in this replacement commit.

To be honest, I don't know why the AVR target isn't supported in the
standard GDB
build and I haven't been able to figure out how to list all supported
targets. I'm new to GDB in general so
I don't know if I'm the right person to do this writeup.

However, I'm looking at https://github.com/dwtk/dwtk (which I also intend
to package for Guix if it's of interest),
and the standard gdb gives me a bunch of error messages when I connect to
dwtk's remote gdbserver. I'm guessing this
incompatibility applies to all gdbservers implemented for AVR chips. I
haven't found much clarity of this in the GDB docs.
I presume this is the reason most distros package avr-gdb separately from
gdb like we're doing here.

I've taken the "synopsis" from Arch Linux
<https://github.com/archlinux/svntogit-community/blob/fa92f7b2008ec22307b2268497e15ed802bd3b03/trunk/PKGBUILD#L12>,
removed unsupported languages from the description, and just
mentioned that this is for the specific AVR microcontroller architecture.
Please let me know if that's good enough.

Thanks,
K.

On Thu, Nov 3, 2022 at 6:35 PM Christopher Baines <mail@cbaines.net> wrote:

>
> Kristian Lein-Mathisen <kristianlein@gmail.com> writes:
>
> > I'd like to have avr-gdb available in GNU Guix.
> > I've used the Arch Linux PKGFILE as basis:
> >
> >
> https://github.com/archlinux/svntogit-community/blob/fa92f7b2008ec/trunk/PKGBUILD
>
> Hi Kristian,
>
> This seems OK to me, although I don't know what this package is for?
>
> Given this is inheriting from gdb, it'll have the same synopiss and
> description:
>
>   synopsis: The GNU debugger
>   description: GDB is the GNU debugger.  With it, you can monitor what a
> program
>   + is doing while it runs or what it was doing just before a crash.  It
> allows
>   + you to specify the runtime conditions, to define breakpoints, and to
> change
>   + how the program is running to try to fix bugs.  It can be used to debug
>   + programs written in C, C++, Ada, Objective-C, Pascal and more.
>
> So, I think if there is something different about this avr-gdb, it would
> be good to specify a appropriate synopsis and description. Does that
> make sense?
>
> Thanks,
>
> Chris
>

[-- Attachment #1.2: Type: text/html, Size: 3284 bytes --]

[-- Attachment #2: 0001-gnu-Add-avr-gdb.patch --]
[-- Type: text/x-patch, Size: 1539 bytes --]

From 5a78944fbb6f5768286ccbeaa1168397096a7063 Mon Sep 17 00:00:00 2001
From: Kristian Lein-Mathisen <kristianlein@gmail.com>
Date: Wed, 2 Nov 2022 20:36:51 +0100
Subject: [PATCH] gnu: Add avr-gdb.

* gnu/packages/gdb.scm (avr-gdb): New variable.
---
 gnu/packages/gdb.scm | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/gdb.scm b/gnu/packages/gdb.scm
index 7d8416c7c5..fd0bc80e44 100644
--- a/gnu/packages/gdb.scm
+++ b/gnu/packages/gdb.scm
@@ -171,3 +171,24 @@ (define-public gdb-minimal
     (name "gdb-minimal")
     (inputs (fold alist-delete (package-inputs gdb)
                   '("libxml2" "ncurses" "python-wrapper" "source-highlight")))))
+
+(define-public avr-gdb
+  (package/inherit gdb-12
+    (name "avr-gdb")
+    (arguments
+     `(#:configure-flags
+       (list "--target=avr"
+             "--disable-nls"
+             "--enable-languages=c,c++"
+             "--with-system-readline"
+             "--enable-source-highlight")
+       ,@(package-arguments gdb-12)))
+    (synopsis "The GNU Debugger for AVR")
+    (description
+     "GDB is the GNU debugger.  With it, you can monitor what a program is
+doing while it runs or what it was doing just before a crash.  It allows you
+to specify the runtime conditions, to define breakpoints, and to change how
+the program is running to try to fix bugs.
+
+This variant of GDB can be used to debug programs written for the AVR
+microcontroller architecture.")))

base-commit: 807bfe55dc382b88ab0fdade6886dfa2b15487ee
-- 
2.38.0


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

* [bug#58971] [PATCH] gnu: Add avr-gdb.
  2022-11-03 18:24   ` Kristian Lein-Mathisen
@ 2022-11-05  2:21     ` Thiago Jung Bauermann via Guix-patches via
  2022-11-07 19:59     ` Christopher Baines
  1 sibling, 0 replies; 5+ messages in thread
From: Thiago Jung Bauermann via Guix-patches via @ 2022-11-05  2:21 UTC (permalink / raw)
  To: Kristian Lein-Mathisen; +Cc: mail, 58971


Hello Kristian,

Kristian Lein-Mathisen <kristianlein@gmail.com> writes:

> To be honest, I don't know why the AVR target isn't supported in the standard GDB
> build and I haven't been able to figure out how to list all supported targets. I'm new to GDB in
> general so
> I don't know if I'm the right person to do this writeup.

Normally GDB is built to support only one target. It's possible to make
it support more targets by passing a list of targets (or the special
“all” value) to the ‘--enable-targets’ option of its configure script.

Actually, one alternative to your patch would be to add
“--enable-targets=all” to the configure list of the regular GDB package.
I don't know why distros don't do that. IMHO it's simpler than having
different GDB packages for different architectures. The GDB binary would
get bigger, but not nearly enough that it would be a problem for today's
disks…

> However, I'm looking at https://github.com/dwtk/dwtk (which I also intend to package for Guix if it's
> of interest), 
> and the standard gdb gives me a bunch of error messages when I connect to dwtk's remote
> gdbserver. I'm guessing this
> incompatibility applies to all gdbservers implemented for AVR chips. I haven't found much clarity of
> this in the GDB docs.
> I presume this is the reason most distros package avr-gdb separately from gdb like we're doing
> here.

I think you are right. Ubuntu has a gdb-multiarch package which supports
more targets, but for some reason it doesn't support AVR and has a
separate gdb-avr package. Strange.

> I've taken the "synopsis" from Arch Linux, removed unsupported languages from the description,
> and just 
> mentioned that this is for the specific AVR microcontroller architecture. Please let me know if that's
> good enough.

I think your synopsis and description are good, thank you.
I hope you don't mind if I have one more suggestion: add comments to the
list of configure flags explaining why they're necessary — except for
the “--target=avr” one, which is self-explanatory :-).

Also, out of curiosity: is there a reason why you restrict the enabled
languages to C and C++? A quick search suggests that it's possible to
use Rust as well, maybe more languages?

-- 
Thanks
Thiago




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

* [bug#58971] [PATCH] gnu: Add avr-gdb.
  2022-11-03 18:24   ` Kristian Lein-Mathisen
  2022-11-05  2:21     ` Thiago Jung Bauermann via Guix-patches via
@ 2022-11-07 19:59     ` Christopher Baines
  1 sibling, 0 replies; 5+ messages in thread
From: Christopher Baines @ 2022-11-07 19:59 UTC (permalink / raw)
  To: Kristian Lein-Mathisen; +Cc: 58971-done, 58971

[-- Attachment #1: Type: text/plain, Size: 363 bytes --]


Kristian Lein-Mathisen <kristianlein@gmail.com> writes:

> Hi Chris and thanks for looking into this,
>
> Your proposal is very reasonable. I wasn't sure what to write but I've
> given it a try in this replacement commit.

The patch you attached looks good to me, I've gone ahead and pushed to
master as d60c9fbf95409a72013d8368e6f50c1ac055df5a.

Thanks!

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

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

end of thread, other threads:[~2022-11-07 20:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02 19:49 [bug#58971] [PATCH] gnu: Add avr-gdb Kristian Lein-Mathisen
2022-11-03 17:31 ` Christopher Baines
2022-11-03 18:24   ` Kristian Lein-Mathisen
2022-11-05  2:21     ` Thiago Jung Bauermann via Guix-patches via
2022-11-07 19:59     ` Christopher Baines

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).