v6502
The MOS 6502 Virtual Machine and Toolchain Infrastructure
debugger.h
Go to the documentation of this file.
1 
4 /*
5  * Copyright (c) 2013 Daniel Loffgren
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to
9  * deal in the Software without restriction, including without limitation the
10  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11  * sell copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in
15  * all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23  * IN THE SOFTWARE.
24  */
25 
26 #ifndef v6502_debugger_h
27 #define v6502_debugger_h
28 
29 #include <v6502/cpu.h>
30 #include <v6502/breakpoint.h>
31 #include <histedit.h>
32 
37 
39 int v6502_loadFileAtAddress(v6502_memory *mem, const char *fname, uint16_t address);
41 void v6502_runDebuggerScript(v6502_cpu *cpu, FILE *file,
42  v6502_breakpoint_list *breakpoint_list,
43  as6502_symbol_table *table,
44  v6502_debuggerRunCallback runCallback,
45  int *verbose);
47 int v6502_compareDebuggerCommand(const char * command, size_t len, const char * literal);
49 int v6502_handleDebuggerCommand(v6502_cpu *cpu, char *command, size_t len,
50  v6502_breakpoint_list *breakpoint_list,
51  as6502_symbol_table *table,
52  v6502_debuggerRunCallback runCallback,
53  int *verbose);
55 unsigned char v6502_completeDebuggerCommand(EditLine *e, int ch);
58 #endif /* defined(v6502_debugger_h) */
unsigned char v6502_completeDebuggerCommand(EditLine *e, int ch)
An editline compatible function for tab-completion.
Definition: debugger.c:156
Virtual CPU Object.
Definition: cpu.h:35
Breakpoint Manangement.
void v6502_runDebuggerScript(v6502_cpu *cpu, FILE *file, v6502_breakpoint_list *breakpoint_list, as6502_symbol_table *table, v6502_debuggerRunCallback runCallback, int *verbose)
Runs all debugger commands contained in a FILE pointer.
Definition: debugger.c:118
int v6502_handleDebuggerCommand(v6502_cpu *cpu, char *command, size_t len, v6502_breakpoint_list *breakpoint_list, as6502_symbol_table *table, v6502_debuggerRunCallback runCallback, int *verbose)
Handle a command given by an external debugger line editor on a given v6502_cpu.
Definition: debugger.c:195
Virtual CPU.
The assembler&#39;s per-object symbol table structure, which holds all symbols.
Definition: symbols.h:71
void() v6502_debuggerRunCallback(v6502_cpu *cpu)
This callback is used when v6502_handleDebuggerCommand recieves a run command.
Definition: debugger.h:36
Breakpoint List Object.
Definition: breakpoint.h:34
int v6502_compareDebuggerCommand(const char *command, size_t len, const char *literal)
This is the exact function used by v6502_handleDebuggerCommand to do fuzzy string comparisons...
Definition: debugger.c:141
Virtual Memory Object.
Definition: mem.h:119
int v6502_loadFileAtAddress(v6502_memory *mem, const char *fname, uint16_t address)
Loads the binary data from file at fname into memory mem at given starting address.
Definition: debugger.c:96