mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Marian Cichy <m.cichy@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Marian Cichy <m.cichy@pengutronix.de>
Subject: [ptxdist] [PATCH] ptxdist: add cgdb command
Date: Mon, 26 Oct 2020 19:18:39 +0100	[thread overview]
Message-ID: <20201026181839.6785-1-m.cichy@pengutronix.de> (raw)

cgdb is a curses-frontend for gdb with some
visual conveniences for debugging. ptxdist already
has a 'ptxdist gdb' command to invoke gdb with
configured sysroot etc., and it would be nice
to have when we can also use cgdb.

Signed-off-by: Marian Cichy <m.cichy@pengutronix.de>
---
 bin/ptxdist | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/bin/ptxdist b/bin/ptxdist
index 0d5e4328e..91af19cc3 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -765,6 +765,8 @@ Misc:
 				use 'newpackage help' for a longer description
   nfsroot			run a userspace NFS server and export the nfsroot
   gdb				run cross gdb with configured sysroot etc.
+  cgdb				run cross gdb with configured sysroot etc.
+  				with cgdb as frontend
   bsp-info			print some basic information about the BSP
   package-info <package>	print some basic information about the package
   print <var>			print the contents of a variable, in the way
@@ -1706,6 +1708,19 @@ EOF
 			check_deps &&
 			ptxd_make_log bsp-info
 			;;
+		cgdb)
+			if ! command -v cgdb &>/dev/null
+			then
+				echo
+				echo "error: cgdb is required to be installed on your host-machine."
+				echo
+				exit 1
+			fi
+			check_premake_compiler &&
+			compiler_prefix="$(ptxd_get_ptxconf PTXCONF_COMPILER_PREFIX)" &&
+			ptxdist_trap_exit_handler &&
+			exec cgdb -d "${PTXDIST_PLATFORMDIR}/sysroot-host/lib/wrapper/${compiler_prefix}gdb" "${@}"
+			;;
 		clean)
 			check_config &&
 			check_deps &&
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

             reply	other threads:[~2020-10-26 18:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 18:18 Marian Cichy [this message]
2020-10-28  7:55 ` Michael Olbrich

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=20201026181839.6785-1-m.cichy@pengutronix.de \
    --to=m.cichy@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /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