Skip to content

Commit

Permalink
tools: add gdbplugin for JLinkGDBServer nuttx thread aware
Browse files Browse the repository at this point in the history
Use `JLinkGDBServer -rtos libnuttxplugin` to add this plugin.
Then in gdb can use command:
  - `info threads` to show all threads infos
  - `thread (id) ` to switch thread.
  - `bt` to show thread backtrace.

Signed-off-by: zhuyanlin <[email protected]>
  • Loading branch information
zhuyanlinzyl committed Nov 10, 2021
1 parent a49b3cc commit 2bf4e5b
Show file tree
Hide file tree
Showing 3 changed files with 663 additions and 3 deletions.
3 changes: 3 additions & 0 deletions tools/Config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ endif

ifeq ($(CONFIG_HOST_WINDOWS),y)
HOSTEXEEXT ?= .exe
HOSTDYNEXT ?= .dll
else ifeq ($(CONFIG_HOST_LINUX),y)
HOSTDYNEXT ?= .so
endif

# This define is passed as EXTRAFLAGS for kernel-mode builds. It is also passed
Expand Down
20 changes: 17 additions & 3 deletions tools/Makefile.host
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,20 @@ all: b16$(HOSTEXEEXT) bdf-converter$(HOSTEXEEXT) cmpconfig$(HOSTEXEEXT) \
mksymtab$(HOSTEXEEXT) mksyscall$(HOSTEXEEXT) mkversion$(HOSTEXEEXT) \
cnvwindeps$(HOSTEXEEXT) nxstyle$(HOSTEXEEXT) initialconfig$(HOSTEXEEXT) \
gencromfs$(HOSTEXEEXT) convert-comments$(HOSTEXEEXT) lowhex$(HOSTEXEEXT) \
detab$(HOSTEXEEXT) rmcr$(HOSTEXEEXT) incdir$(HOSTEXEEXT)
detab$(HOSTEXEEXT) rmcr$(HOSTEXEEXT) incdir$(HOSTEXEEXT) \
jlink-nuttx$(HOSTDYNEXT)
default: mkconfig$(HOSTEXEEXT) mksyscall$(HOSTEXEEXT) mkdeps$(HOSTEXEEXT) \
cnvwindeps$(HOSTEXEEXT) incdir$(HOSTEXEEXT)

ifdef HOSTEXEEXT
.PHONY: b16 bdf-converter cmpconfig clean configure kconfig2html mkconfig \
mkdeps mksymtab mksyscall mkversion cnvwindeps nxstyle initialconfig \
gencromfs convert-comments lowhex detab rmcr incdir
else
.PHONY: clean
endif
ifdef HOSTDYNEXT
.PHONY: jlink-nuttx
endif
.PHONY: clean

# b16 - Fixed precision math conversion tool

Expand Down Expand Up @@ -222,6 +225,15 @@ ifdef HOSTEXEEXT
mkdeps: mkdeps$(HOSTEXEEXT)
endif

# jlink-nuttx - Create jlink GDBServer nuttx plugin

jlink-nuttx$(HOSTDYNEXT): jlink-nuttx.c
$(Q) $(HOSTCC) $(HOSTCFLAGS) -shared jlink-nuttx.c -o jlink-nuttx$(HOSTDYNEXT)

ifdef HOSTDYNEXT
jlink-nuttx: jlink-nuttx$(HOSTDYNEXT)
endif

clean:
$(call DELFILE, b16)
$(call DELFILE, b16.exe)
Expand Down Expand Up @@ -258,6 +270,8 @@ clean:
$(call DELFILE, nxstyle.exe)
$(call DELFILE, rmcr)
$(call DELFILE, rmcr.exe)
$(call DELFILE, jlink-nuttx.so)
$(call DELFILE, jlink-nuttx.dll)
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
$(Q) rm -rf *.dSYM
endif
Expand Down
Loading

0 comments on commit 2bf4e5b

Please sign in to comment.