--- /dev/null
+ GNU LESSER GENERAL PUBLIC LICENSE\r
+ Version 3, 29 June 2007\r
+\r
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\r
+ Everyone is permitted to copy and distribute verbatim copies\r
+ of this license document, but changing it is not allowed.\r
+\r
+\r
+ This version of the GNU Lesser General Public License incorporates\r
+the terms and conditions of version 3 of the GNU General Public\r
+License, supplemented by the additional permissions listed below.\r
+\r
+ 0. Additional Definitions.\r
+\r
+ As used herein, "this License" refers to version 3 of the GNU Lesser\r
+General Public License, and the "GNU GPL" refers to version 3 of the GNU\r
+General Public License.\r
+\r
+ "The Library" refers to a covered work governed by this License,\r
+other than an Application or a Combined Work as defined below.\r
+\r
+ An "Application" is any work that makes use of an interface provided\r
+by the Library, but which is not otherwise based on the Library.\r
+Defining a subclass of a class defined by the Library is deemed a mode\r
+of using an interface provided by the Library.\r
+\r
+ A "Combined Work" is a work produced by combining or linking an\r
+Application with the Library. The particular version of the Library\r
+with which the Combined Work was made is also called the "Linked\r
+Version".\r
+\r
+ The "Minimal Corresponding Source" for a Combined Work means the\r
+Corresponding Source for the Combined Work, excluding any source code\r
+for portions of the Combined Work that, considered in isolation, are\r
+based on the Application, and not on the Linked Version.\r
+\r
+ The "Corresponding Application Code" for a Combined Work means the\r
+object code and/or source code for the Application, including any data\r
+and utility programs needed for reproducing the Combined Work from the\r
+Application, but excluding the System Libraries of the Combined Work.\r
+\r
+ 1. Exception to Section 3 of the GNU GPL.\r
+\r
+ You may convey a covered work under sections 3 and 4 of this License\r
+without being bound by section 3 of the GNU GPL.\r
+\r
+ 2. Conveying Modified Versions.\r
+\r
+ If you modify a copy of the Library, and, in your modifications, a\r
+facility refers to a function or data to be supplied by an Application\r
+that uses the facility (other than as an argument passed when the\r
+facility is invoked), then you may convey a copy of the modified\r
+version:\r
+\r
+ a) under this License, provided that you make a good faith effort to\r
+ ensure that, in the event an Application does not supply the\r
+ function or data, the facility still operates, and performs\r
+ whatever part of its purpose remains meaningful, or\r
+\r
+ b) under the GNU GPL, with none of the additional permissions of\r
+ this License applicable to that copy.\r
+\r
+ 3. Object Code Incorporating Material from Library Header Files.\r
+\r
+ The object code form of an Application may incorporate material from\r
+a header file that is part of the Library. You may convey such object\r
+code under terms of your choice, provided that, if the incorporated\r
+material is not limited to numerical parameters, data structure\r
+layouts and accessors, or small macros, inline functions and templates\r
+(ten or fewer lines in length), you do both of the following:\r
+\r
+ a) Give prominent notice with each copy of the object code that the\r
+ Library is used in it and that the Library and its use are\r
+ covered by this License.\r
+\r
+ b) Accompany the object code with a copy of the GNU GPL and this license\r
+ document.\r
+\r
+ 4. Combined Works.\r
+\r
+ You may convey a Combined Work under terms of your choice that,\r
+taken together, effectively do not restrict modification of the\r
+portions of the Library contained in the Combined Work and reverse\r
+engineering for debugging such modifications, if you also do each of\r
+the following:\r
+\r
+ a) Give prominent notice with each copy of the Combined Work that\r
+ the Library is used in it and that the Library and its use are\r
+ covered by this License.\r
+\r
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license\r
+ document.\r
+\r
+ c) For a Combined Work that displays copyright notices during\r
+ execution, include the copyright notice for the Library among\r
+ these notices, as well as a reference directing the user to the\r
+ copies of the GNU GPL and this license document.\r
+\r
+ d) Do one of the following:\r
+\r
+ 0) Convey the Minimal Corresponding Source under the terms of this\r
+ License, and the Corresponding Application Code in a form\r
+ suitable for, and under terms that permit, the user to\r
+ recombine or relink the Application with a modified version of\r
+ the Linked Version to produce a modified Combined Work, in the\r
+ manner specified by section 6 of the GNU GPL for conveying\r
+ Corresponding Source.\r
+\r
+ 1) Use a suitable shared library mechanism for linking with the\r
+ Library. A suitable mechanism is one that (a) uses at run time\r
+ a copy of the Library already present on the user's computer\r
+ system, and (b) will operate properly with a modified version\r
+ of the Library that is interface-compatible with the Linked\r
+ Version.\r
+\r
+ e) Provide Installation Information, but only if you would otherwise\r
+ be required to provide such information under section 6 of the\r
+ GNU GPL, and only to the extent that such information is\r
+ necessary to install and execute a modified version of the\r
+ Combined Work produced by recombining or relinking the\r
+ Application with a modified version of the Linked Version. (If\r
+ you use option 4d0, the Installation Information must accompany\r
+ the Minimal Corresponding Source and Corresponding Application\r
+ Code. If you use option 4d1, you must provide the Installation\r
+ Information in the manner specified by section 6 of the GNU GPL\r
+ for conveying Corresponding Source.)\r
+\r
+ 5. Combined Libraries.\r
+\r
+ You may place library facilities that are a work based on the\r
+Library side by side in a single library together with other library\r
+facilities that are not Applications and are not covered by this\r
+License, and convey such a combined library under terms of your\r
+choice, if you do both of the following:\r
+\r
+ a) Accompany the combined library with a copy of the same work based\r
+ on the Library, uncombined with any other library facilities,\r
+ conveyed under the terms of this License.\r
+\r
+ b) Give prominent notice with the combined library that part of it\r
+ is a work based on the Library, and explaining where to find the\r
+ accompanying uncombined form of the same work.\r
+\r
+ 6. Revised Versions of the GNU Lesser General Public License.\r
+\r
+ The Free Software Foundation may publish revised and/or new versions\r
+of the GNU Lesser General Public License from time to time. Such new\r
+versions will be similar in spirit to the present version, but may\r
+differ in detail to address new problems or concerns.\r
+\r
+ Each version is given a distinguishing version number. If the\r
+Library as you received it specifies that a certain numbered version\r
+of the GNU Lesser General Public License "or any later version"\r
+applies to it, you have the option of following the terms and\r
+conditions either of that published version or of any later version\r
+published by the Free Software Foundation. If the Library as you\r
+received it does not specify a version number of the GNU Lesser\r
+General Public License, you may choose any version of the GNU Lesser\r
+General Public License ever published by the Free Software Foundation.\r
+\r
+ If the Library as you received it specifies that a proxy can decide\r
+whether future versions of the GNU Lesser General Public License shall\r
+apply, that proxy's public statement of acceptance of any version is\r
+permanent authorization for you to choose that version for the\r
+Library.
\ No newline at end of file
/* Copyright 2012 Adam Green (http://mbed.org/users/AdamGreen/)\r
\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
+ This program is free software: you can redistribute it and/or modify\r
+ it under the terms of the GNU Lesser General Public License as published\r
+ by the Free Software Foundation, either version 3 of the License, or\r
+ (at your option) any later version.\r
\r
- http://www.apache.org/licenses/LICENSE-2.0\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU Lesser General Public License for more details.\r
\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
+ You should have received a copy of the GNU Lesser General Public License\r
+ along with this program. If not, see <http://www.gnu.org/licenses/>. \r
*/\r
-/* Monitor for Remote Inspection header file. */\r
+/* Monitor for Remote Inspection. */\r
#ifndef _MRI_H_\r
#define _MRI_H_\r
\r
/* Used to insert hardcoded breakpoint into user's code. */\r
#define __debugbreak() { __asm volatile ("bkpt #0"); }\r
\r
+/* Error strings that can be returned to GDB. */\r
+#define MRI_ERROR_INVALID_ARGUMENT "E01" /* Encountered error when parsing command arguments. */\r
+#define MRI_ERROR_MEMORY_ACCESS_FAILURE "E03" /* Couldn't access requested memory. */\r
+#define MRI_ERROR_BUFFER_OVERRUN "E04" /* Overflowed internal input/output buffer. */\r
+#define MRI_ERROR_NO_FREE_BREAKPOINT "E05" /* No free FPB breakpoint comparator slots. */\r
+\r
+\r
#ifdef __cplusplus\r
extern "C"\r
{\r
including the following option will tell the monitor to assume that the user's firmware will configure and use the\r
serial port until the first exception occurs:\r
MRI_UART_SHARE\r
- \r
*/\r
void __mriInit(const char* pDebuggerParameters);\r
\r
\r
+/* Simple assembly language stubs that can be called from user's newlib _write and _read routines which will cause the \r
+ reads and writes to be redirected to the gdb host via mri. */\r
+int __mriNewlib_SemihostWrite(int file, char *ptr, int len);\r
+int __mriNewlib_SemihostRead(int file, char *ptr, int len);\r
+\r
+\r
#ifdef __cplusplus\r
}\r
#endif\r
\r
#endif /* _MRI_H_ */\r
+\r
+\r
+#ifndef MRI_VERSION_STRING\r
+\r
+#define MRI_BRANCH "https://github.com/adamgreen/mri/tree/version_0.1"\r
+\r
+#define MRI_VERSION_MAJOR 0\r
+#define MRI_VERSION_MINOR 1\r
+#define MRI_VERSION_BUILD 20120510\r
+#define MRI_VERSION_SUBBUILD 1\r
+\r
+#define MRI_STR(X) MRI_STR2(X)\r
+#define MRI_STR2(X) #X\r
+\r
+#define MRI_VERSION_STRING MRI_STR(MRI_VERSION_MAJOR) "." MRI_STR(MRI_VERSION_MINOR) "-" MRI_STR(MRI_VERSION_BUILD) "." MRI_STR(MRI_VERSION_SUBBUILD)\r
+\r
+#endif\r