diff options
author | Chris Johns <chrisj@rtems.org> | 2016-11-25 15:13:36 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2016-11-29 08:50:40 +1100 |
commit | a0d4e9933c57693f99203da358bb8aaa8a5d50d9 (patch) | |
tree | d17a98faf93185d2baa18fba6ee97b0e2916b2e4 /testsuites/libtests/debugger01/init.c | |
parent | arm/zynq: Wait for the UART TX FIFO to empty on reset. (diff) | |
download | rtems-a0d4e9933c57693f99203da358bb8aaa8a5d50d9.tar.bz2 |
cpukit: Add libdebugger, a remote debugger agent for GDB.
Diffstat (limited to 'testsuites/libtests/debugger01/init.c')
-rw-r--r-- | testsuites/libtests/debugger01/init.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/testsuites/libtests/debugger01/init.c b/testsuites/libtests/debugger01/init.c new file mode 100644 index 0000000000..e243d424a5 --- /dev/null +++ b/testsuites/libtests/debugger01/init.c @@ -0,0 +1,53 @@ +/* + * Debugger test. + * + * Copyright (c) 2016 Chris Johns (chrisj@rtems.org) + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define CONFIGURE_INIT +#include "system.h" + +#include "tmacros.h" + +#include <rtems/rtems-debugger.h> + +#include "system.h" + +static void test(void) +{ + rtems_printer printer; + + rtems_print_printer_fprintf(&printer, stdout); + rtems_test_assert(rtems_debugger_start("test", "something", + 3, 10, &printer) < 0); + rtems_test_assert(rtems_debugger_register_test_remote() == 0); + rtems_test_assert(rtems_debugger_start("test", "something", + 3, 10, &printer) == 0); + rtems_debugger_set_verbose(true); + rtems_test_assert(rtems_debugger_remote_debug(true) == 0); + + /* + * This thread is suspended when the debugger is active until the debugger + * disconnects. + */ + sleep(1); +} + +const char rtems_test_name[] = "DEBUGGER01"; + +rtems_task Init(rtems_task_argument argument) +{ + TEST_BEGIN(); + + test(); + + TEST_END(); +} |