[Lldb-commits] [PATCH] D74255: [LLDB] Add support for AVR breakpoints
Ayke via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Feb 7 14:07:25 PST 2020
aykevl created this revision.
aykevl added reviewers: labath, clayborg.
Herald added subscribers: lldb-commits, Jim, dylanmckay.
Herald added a project: LLDB.
I believe the actual opcode does not matter because the AVR architecture is a Harvard architecture that does not support writing to program memory. Therefore, debuggers and emulators provide hardware breakpoints. But for some reason, this opcode must be defined or else LLDB will crash with an assertion error.
---
I would like to add a test case for this, but I'm not quite sure how to do that. It appears that to trigger the crash (fixed by this patch), there needs to be a `gdb-remote`.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D74255
Files:
lldb/source/Target/Platform.cpp
Index: lldb/source/Target/Platform.cpp
===================================================================
--- lldb/source/Target/Platform.cpp
+++ lldb/source/Target/Platform.cpp
@@ -1855,6 +1855,12 @@
}
} break;
+ case llvm::Triple::avr: {
+ static const uint8_t g_hex_opcode[] = {0x98, 0x95};
+ trap_opcode = g_hex_opcode;
+ trap_opcode_size = sizeof(g_hex_opcode);
+ } break;
+
case llvm::Triple::mips:
case llvm::Triple::mips64: {
static const uint8_t g_hex_opcode[] = {0x00, 0x00, 0x00, 0x0d};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74255.243280.patch
Type: text/x-patch
Size: 531 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200207/e5220eb0/attachment.bin>
More information about the lldb-commits
mailing list