VirtualC64 v5.0 beta
Commodore 64 Emulator
Loading...
Searching...
No Matches
Debugger.h
1// -----------------------------------------------------------------------------
2// This file is part of VirtualC64
3//
4// Copyright (C) Dirk W. Hoffmann. www.dirkwhoffmann.de
5// This FILE is dual-licensed. You are free to choose between:
6//
7// - The GNU General Public License v3 (or any later version)
8// - The Mozilla Public License v2
9//
10// SPDX-License-Identifier: GPL-3.0-or-later OR MPL-2.0
11// -----------------------------------------------------------------------------
12
13#pragma once
14
15#include "DebuggerTypes.h"
16#include "SubComponent.h"
17
18namespace vc64 {
19
20class Debugger : public SubComponent {
21
22 Descriptions descriptions = {{
23
24 .name = "Debugger",
25 .description = "Debugger"
26 }};
27
28public:
29
30 // Last used address (current object location)
31 u16 current = 0;
32
33
34 //
35 // Methods
36 //
37
38public:
39
40 using SubComponent::SubComponent;
41
42
43 //
44 // Methods from Serializable
45 //
46
47public:
48
49 template <class T> void serialize(T& worker) { } SERIALIZERS(serialize);
50
51
52 //
53 // Methods from CoreComponent
54 //
55
56public:
57
58 const Descriptions &getDescriptions() const override { return descriptions; }
59
60
61 //
62 // Managing memory
63 //
64
65public:
66
67 // Returns a memory dump in ASCII, hex, or both
68 isize dump(char *dst, u16 addr, const char *fmt) const;
69 isize dump(std::ostream& os, u16 addr, const char *fmt) const;
70
71 // Writes a memory dump into a stream
72 isize ascDump(std::ostream& os, u16 addr, isize lines);
73 isize hexDump(std::ostream& os, u16 addr, isize lines);
74 isize memDump(std::ostream& os, u16 addr, isize lines);
75
76 // Searches a number sequence in memory
77 isize memSearch(const string &pattern, u16 addr);
78
79 // Reads a value from memory
80 u32 read(u32 addr, isize sz);
81
82 // Writes a value into memory (multiple times)
83 void write(u16 addr, u8 val, isize repeats = 1);
84
85 // Copies a chunk of memory
86 void copy(u16 src, u16 dst, isize cnt = 1);
87
88
89 //
90 // Displaying expressions
91 //
92
93 // Displays a value in different number formats (hex, dec, bin, alpha)
94 void convertNumeric(std::ostream& os, u8 value) const;
95 void convertNumeric(std::ostream& os, u16 value) const;
96 void convertNumeric(std::ostream& os, u32 value) const;
97 void convertNumeric(std::ostream& os, string value) const;
98};
99
100
101}
VirtualC64 project namespace.
Definition CmdQueue.cpp:16