12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- /* Copyright Yann Weber <asmsh@yannweb.net>
- This file is part of asmsh.
-
- asmsh is free software: you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation, either version 3 of the License, or any later version.
-
- asmsh is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- details.
-
- You should have received a copy of the GNU General Public License along
- with asmsh. If not, see <https://www.gnu.org/licenses/>.
- */
- #ifndef ASMSH_BREAKPOINTS_H
- #define ASMSH_BREAKPOINTS_H
- #include "config.h"
-
- #include <errno.h>
- #include <stdlib.h>
-
- #include "logger.h"
-
- typedef struct asmsh_brk_s asmsh_brk_t;
-
-
- /** Stores breakpoints informations */
- struct asmsh_brk_s
- {
- /** Breakpoint addresses sorted ascending */
- unsigned long *addrs;
- /** Number of breakpoints */
- size_t sz;
- };
-
- /** Initialize the breakpoint list
- * @param brks Pointer on the list to initialize
- * @return 0 if no error else -1
- */
- int asmsh_brk_init(asmsh_brk_t *brks);
-
- /** Cleanup a breakpoint list struct
- * @param brks Pointer on the list to clean
- */
- void asmsh_brk_free(asmsh_brk_t *brks);
-
- /** Add a breakpoint
- * @param brks Pointer on the list
- * @param addr The breakpoint's address
- * @return 0 if no error 1 if allready present else -1 and set errno
- */
- int asmsh_brk_add(asmsh_brk_t *brks, unsigned long addr);
-
- /** Del a breakpoint
- * @param brks Pointer on the list
- * @param addr The breakpoint's address
- * @return 0 if no error 1 if not present else -1 and set errno
- */
- int asmsh_brk_del(asmsh_brk_t *brks, unsigned long addr);
-
- /** Check if a breakpoint exists
- * @param brks Pointer on the list
- * @param addr The address to check
- * @return 0 if no breakpoint at given address
- */
- int asmsh_brk_isset(asmsh_brk_t *brks, unsigned long addr);
-
- #endif
|