Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:14

0001 /*
0002  * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>.  All rights reserved.
0003  *
0004  * Redistribution and use in source and binary forms, with or without
0005  * modification, are permitted provided that the following conditions
0006  * are met:
0007  * 1. Redistributions of source code must retain the above copyright
0008  *    notice, this list of conditions and the following disclaimer.
0009  * 2. Redistributions in binary form must reproduce the above copyright
0010  *    notice, this list of conditions and the following disclaimer in the
0011  *    documentation and/or other materials provided with the distribution.
0012  *
0013  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
0014  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0015  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0016  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
0017  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0018  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
0019  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
0020  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
0021  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
0022  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
0023  * SUCH DAMAGE.
0024  */
0025 
0026 /*
0027  * Debugger for RTEMS.
0028  */
0029 
0030 #ifndef _RTEMS_DEBUGGER_h
0031 #define _RTEMS_DEBUGGER_h
0032 
0033 #include <stdbool.h>
0034 
0035 #include <rtems.h>
0036 #include <rtems/printer.h>
0037 
0038 #ifdef __cplusplus
0039 extern "C" {
0040 #endif /* __cplusplus */
0041 
0042 /**
0043  * Timeout period for an ack
0044  */
0045 #define RTEMS_DEBUGGER_TIMEOUT (3)
0046 
0047 /**
0048  * Start the Debugger.
0049  */
0050 extern int rtems_debugger_start(const char*          remote,
0051                                 const char*          device,
0052                                 int                  timeout,
0053                                 rtems_task_priority  priority,
0054                                 const rtems_printer* printer);
0055 
0056 /**
0057  * Suspend all running threads including the caller if not
0058  * excluded. Returns when the debugger has connected and continued.
0059  *
0060  * If wait is true and there is no remote connected wait then break.
0061  */
0062 extern int rtems_debugger_break(bool wait);
0063 
0064 /**
0065  * Stop the Debugger.
0066  */
0067 extern int rtems_debugger_stop(void);
0068 
0069 /**
0070  * Is the Debugger running?.
0071  */
0072 extern bool rtems_debugger_running(void);
0073 
0074 /**
0075  * Verbose control.
0076  */
0077 extern void rtems_debugger_set_verbose(bool on);
0078 
0079 /**
0080  * Control remote debug printing.
0081  */
0082 extern int rtems_debugger_remote_debug(bool state);
0083 
0084 #ifdef __cplusplus
0085 }
0086 #endif /* __cplusplus */
0087 
0088 
0089 #endif