Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH V2] package: gdb: Add helping kernel gdb functions compilation
@ 2023-12-09 21:49 Michael Trimarchi
  2023-12-13 20:08 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Trimarchi @ 2023-12-09 21:49 UTC (permalink / raw)
  To: buildroot; +Cc: Michael Trimarchi, Yann E . MORIN

In order to use all the features of KGDB it's nice to have
the possibility to source the vmlinux-gdb.py file. The
generation of this file depend on CONFIG_GDB_SCRIPTS config
option. Add it in order to use gdb of vmlinux in output directory
including tx-* linux script

gdb-multiarch --tui output/build/<linux dir>/vmlinux
add-auto-load-safe-path output/build/<linux dir>
source output/build/<linux dir>/vmlinux-gdb.py

Linux needs to be compiled with DEBUG_INFO (without restrict
DEBUG_INFO) and kernel cmdline should be modified to wait
of kgdb if needed. As example

kgdboc_earlycon=ns16550a kgdboc=/dev/ttyS2 kgdbwait nokaslr

The test was done on am62x board over serial line. In order
to have it running properly we need to compile the agent-proxy

./output/host/bin/agent-proxy 4440 4441 0 /dev/ttyUSB0 115200

gdb can now having the debugging uart available using:

target remote localhost:4441

the 4440 is used by the console and 4441 is used to debug

[Yann E. MORIN: suggest to change the gdb.mk file instead,
 changing the kernel.mk file. ]

Suggested-by: Yann E. MORIN <yann.morin.1998@free.fr> 
Tested-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
---
V1->V2:
	- Yann really help to make it simple and move from
	  a kernel task to an enable configuration to gdb
---
 package/gdb/gdb.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index 070598b385..0ebeb08dad 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -304,5 +304,9 @@ HOST_GDB_POST_INSTALL_HOOKS += HOST_GDB_ADD_SYMLINK
 
 HOST_GDB_POST_INSTALL_HOOKS += gen_gdbinit_file
 
+define HOST_GDB_LINUX_CONFIG_FIXUPS
+	$(call KCONFIG_ENABLE_OPT,CONFIG_GDB_SCRIPTS)
+endef
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
-- 
2.40.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2023-12-13 20:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-09 21:49 [Buildroot] [PATCH V2] package: gdb: Add helping kernel gdb functions compilation Michael Trimarchi
2023-12-13 20:08 ` Thomas Petazzoni via buildroot
2023-12-13 20:17   ` Michael Nazzareno Trimarchi
2023-12-13 20:24     ` Thomas Petazzoni via buildroot
2023-12-13 20:32       ` Michael Nazzareno Trimarchi
2023-12-13 20:41         ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox