Skip to content

Commit 8456120

Browse files
committed
Revert "[lldb] Add support for MSP430 in LLDB."
This reverts commit 82c02b7. Apparently, the original patch was not rebased onto `main
1 parent 5041fe8 commit 8456120

File tree

18 files changed

+18
-1078
lines changed

18 files changed

+18
-1078
lines changed

lldb/include/lldb/Utility/ArchSpec.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ class ArchSpec {
172172
eCore_mips64r5el,
173173
eCore_mips64r6el,
174174

175-
eCore_msp430,
176-
177175
eCore_ppc_generic,
178176
eCore_ppc_ppc601,
179177
eCore_ppc_ppc602,

lldb/include/lldb/Utility/DataExtractor.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,9 @@ class DataExtractor {
843843
/// \param[in] addr_size
844844
/// The size in bytes to use when extracting addresses.
845845
void SetAddressByteSize(uint32_t addr_size) {
846-
assert(addr_size == 2 || addr_size == 4 || addr_size == 8);
846+
#ifdef LLDB_CONFIGURATION_DEBUG
847+
assert(addr_size == 4 || addr_size == 8);
848+
#endif
847849
m_addr_size = addr_size;
848850
}
849851

lldb/source/Expression/IRMemoryMap.cpp

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,12 @@ lldb::addr_t IRMemoryMap::FindSpace(size_t size) {
9696
// regions, walk forward through memory until a region is found that has
9797
// adequate space for our allocation.
9898
if (process_is_alive) {
99-
uint64_t end_of_memory;
100-
switch (process_sp->GetAddressByteSize()) {
101-
case 2:
102-
end_of_memory = 0xffffull;
103-
break;
104-
case 4:
105-
end_of_memory = 0xffffffffull;
106-
break;
107-
case 8:
108-
end_of_memory = 0xffffffffffffffffull;
109-
break;
110-
default:
111-
lldbassert(false && "Invalid address size.");
112-
return LLDB_INVALID_ADDRESS;
113-
}
99+
const uint64_t end_of_memory = process_sp->GetAddressByteSize() == 8
100+
? 0xffffffffffffffffull
101+
: 0xffffffffull;
102+
103+
lldbassert(process_sp->GetAddressByteSize() == 4 ||
104+
end_of_memory != 0xffffffffull);
114105

115106
MemoryRegionInfo region_info;
116107
Status err = process_sp->GetMemoryRegionInfo(ret, region_info);
@@ -146,31 +137,26 @@ lldb::addr_t IRMemoryMap::FindSpace(size_t size) {
146137
// We've tried our algorithm, and it didn't work. Now we have to reset back
147138
// to the end of the allocations we've already reported, or use a 'sensible'
148139
// default if this is our first allocation.
140+
149141
if (m_allocations.empty()) {
150142
uint32_t address_byte_size = GetAddressByteSize();
151143
if (address_byte_size != UINT32_MAX) {
152144
switch (address_byte_size) {
153-
case 2:
154-
ret = 0x8000ull;
145+
case 8:
146+
ret = 0xdead0fff00000000ull;
155147
break;
156148
case 4:
157149
ret = 0xee000000ull;
158150
break;
159-
case 8:
160-
ret = 0xdead0fff00000000ull;
161-
break;
162151
default:
163-
lldbassert(false && "Invalid address size.");
164-
return LLDB_INVALID_ADDRESS;
152+
break;
165153
}
166154
}
167155
} else {
168156
auto back = m_allocations.rbegin();
169157
lldb::addr_t addr = back->first;
170158
size_t alloc_size = back->second.m_size;
171-
auto arch = target_sp->GetArchitecture().GetTriple().getArch();
172-
auto align = arch == llvm::Triple::msp430 ? 512 : 4096;
173-
ret = llvm::alignTo(addr + alloc_size, align);
159+
ret = llvm::alignTo(addr + alloc_size, 4096);
174160
}
175161

176162
return ret;

lldb/source/Expression/LLVMUserExpression.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,7 @@ bool LLVMUserExpression::PrepareToExecuteJITExpression(
333333
if (m_can_interpret && m_stack_frame_bottom == LLDB_INVALID_ADDRESS) {
334334
Status alloc_error;
335335

336-
auto arch = target->GetArchitecture().GetTriple().getArch();
337-
const size_t stack_frame_size =
338-
arch == llvm::Triple::msp430 ? 512 : 512 * 1024;
336+
const size_t stack_frame_size = 512 * 1024;
339337

340338
const bool zero_memory = false;
341339

lldb/source/Host/common/NativeProcessProtocol.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,6 @@ NativeProcessProtocol::GetSoftwareBreakpointTrapOpcode(size_t size_hint) {
503503
static const uint8_t g_i386_opcode[] = {0xCC};
504504
static const uint8_t g_mips64_opcode[] = {0x00, 0x00, 0x00, 0x0d};
505505
static const uint8_t g_mips64el_opcode[] = {0x0d, 0x00, 0x00, 0x00};
506-
static const uint8_t g_msp430_opcode[] = {0x43, 0x43};
507506
static const uint8_t g_s390x_opcode[] = {0x00, 0x01};
508507
static const uint8_t g_ppc_opcode[] = {0x7f, 0xe0, 0x00, 0x08}; // trap
509508
static const uint8_t g_ppcle_opcode[] = {0x08, 0x00, 0xe0, 0x7f}; // trap
@@ -529,9 +528,6 @@ NativeProcessProtocol::GetSoftwareBreakpointTrapOpcode(size_t size_hint) {
529528
case llvm::Triple::mips64el:
530529
return llvm::ArrayRef(g_mips64el_opcode);
531530

532-
case llvm::Triple::msp430:
533-
return llvm::ArrayRef(g_msp430_opcode);
534-
535531
case llvm::Triple::systemz:
536532
return llvm::ArrayRef(g_s390x_opcode);
537533

lldb/source/Plugins/ABI/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
foreach(target AArch64 ARM ARC Hexagon Mips MSP430 PowerPC SystemZ X86)
1+
foreach(target AArch64 ARM ARC Hexagon Mips PowerPC SystemZ X86)
22
if (${target} IN_LIST LLVM_TARGETS_TO_BUILD)
33
add_subdirectory(${target})
44
endif()

0 commit comments

Comments
 (0)