Skip to content

Commit

Permalink
testing: Add simple debug test program
Browse files Browse the repository at this point in the history
It is a simple test case of the NuttX debugging facilities (breakpoint and watchpoint).

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
  • Loading branch information
no1wudi committed Jun 22, 2024
1 parent cda5140 commit d47b68a
Show file tree
Hide file tree
Showing 5 changed files with 396 additions and 0 deletions.
31 changes: 31 additions & 0 deletions testing/debug/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ##############################################################################
# apps/testing/debug/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################

if(CONFIG_TESTING_DEBUG)
nuttx_add_application(
NAME
${CONFIG_TESTING_DEBUG_PROGNAME}
SRCS
debug.c
STACKSIZE
${CONFIG_TESTING_DEBUG_STACKSIZE}
PRIORITY
${CONFIG_TESTING_DEBUG_PRIORITY})
endif()
31 changes: 31 additions & 0 deletions testing/debug/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#

config TESTING_DEBUG
tristate "Debug test"
default n
depends on ARCH_HAVE_DEBUG
---help---
Enable the DEBUG test program. It is a simple
test case of the NuttX debugging facilities.

if TESTING_DEBUG

config TESTING_DEBUG_PROGNAME
string "Program name"
default "debug"
---help---
This is the name of the program that will be used when the NSH ELF
program is installed.

config TESTING_DEBUG_PRIORITY
int "Task priority"
default 100

config TESTING_DEBUG_STACKSIZE
int "Stack size"
default DEFAULT_TASK_STACKSIZE

endif
23 changes: 23 additions & 0 deletions testing/debug/Make.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
############################################################################
# apps/testing/debug/Make.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################

ifneq ($(CONFIG_TESTING_DEBUG),)
CONFIGURED_APPS += $(APPDIR)/testing/debug
endif
34 changes: 34 additions & 0 deletions testing/debug/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
############################################################################
# apps/testing/debug/Makefile
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################

include $(APPDIR)/Make.defs

# debug built-in application info

PROGNAME = $(CONFIG_TESTING_DEBUG_PROGNAME)
PRIORITY = $(CONFIG_TESTING_DEBUG_PRIORITY)
STACKSIZE = $(CONFIG_TESTING_DEBUG_STACKSIZE)
MODULE = $(CONFIG_TESTING_DEBUG)

# debug Example

MAINSRC = debug.c

include $(APPDIR)/Application.mk
Loading

0 comments on commit d47b68a

Please sign in to comment.