Skip to content

Commit 10f16bc

Browse files
committed
Revert "[lldb] [ABI/X86] Split base x86 and i386 classes"
This change broke the windows lldb bot. This reverts commit a30a36f.
1 parent f86c930 commit 10f16bc

File tree

8 files changed

+27
-61
lines changed

8 files changed

+27
-61
lines changed

lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
#ifndef LLDB_SOURCE_PLUGINS_ABI_X86_ABIMACOSX_I386_H
1010
#define LLDB_SOURCE_PLUGINS_ABI_X86_ABIMACOSX_I386_H
1111

12-
#include "Plugins/ABI/X86/ABIX86_i386.h"
12+
#include "Plugins/ABI/X86/ABIX86.h"
1313
#include "lldb/Core/Value.h"
1414
#include "lldb/lldb-private.h"
1515

16-
class ABIMacOSX_i386 : public ABIX86_i386 {
16+
class ABIMacOSX_i386 : public ABIX86 {
1717
public:
1818
~ABIMacOSX_i386() override = default;
1919

@@ -92,7 +92,7 @@ class ABIMacOSX_i386 : public ABIX86_i386 {
9292
}
9393

9494
private:
95-
using ABIX86_i386::ABIX86_i386; // Call CreateInstance instead.
95+
using ABIX86::ABIX86; // Call CreateInstance instead.
9696
};
9797

9898
#endif // LLDB_SOURCE_PLUGINS_ABI_X86_ABIMACOSX_I386_H

lldb/source/Plugins/ABI/X86/ABISysV_i386.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#ifndef LLDB_SOURCE_PLUGINS_ABI_X86_ABISYSV_I386_H
1010
#define LLDB_SOURCE_PLUGINS_ABI_X86_ABISYSV_I386_H
1111

12-
#include "Plugins/ABI/X86/ABIX86_i386.h"
12+
#include "Plugins/ABI/X86/ABIX86.h"
1313
#include "lldb/lldb-private.h"
1414

15-
class ABISysV_i386 : public ABIX86_i386 {
15+
class ABISysV_i386 : public ABIX86 {
1616
public:
1717
~ABISysV_i386() override = default;
1818

@@ -95,7 +95,7 @@ class ABISysV_i386 : public ABIX86_i386 {
9595
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info);
9696

9797
private:
98-
using ABIX86_i386::ABIX86_i386; // Call CreateInstance instead.
98+
using ABIX86::ABIX86; // Call CreateInstance instead.
9999
};
100100

101101
#endif // LLDB_SOURCE_PLUGINS_ABI_X86_ABISYSV_I386_H

lldb/source/Plugins/ABI/X86/ABIX86.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- ABIX86.cpp --------------------------------------------------------===//
1+
//===-- X86.h -------------------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -28,3 +28,16 @@ void ABIX86::Terminate() {
2828
ABISysV_x86_64::Terminate();
2929
ABIWindows_x86_64::Terminate();
3030
}
31+
32+
uint32_t ABIX86::GetGenericNum(llvm::StringRef name) {
33+
return llvm::StringSwitch<uint32_t>(name)
34+
.Case("eip", LLDB_REGNUM_GENERIC_PC)
35+
.Case("esp", LLDB_REGNUM_GENERIC_SP)
36+
.Case("ebp", LLDB_REGNUM_GENERIC_FP)
37+
.Case("eflags", LLDB_REGNUM_GENERIC_FLAGS)
38+
.Case("edi", LLDB_REGNUM_GENERIC_ARG1)
39+
.Case("esi", LLDB_REGNUM_GENERIC_ARG2)
40+
.Case("edx", LLDB_REGNUM_GENERIC_ARG3)
41+
.Case("ecx", LLDB_REGNUM_GENERIC_ARG4)
42+
.Default(LLDB_INVALID_REGNUM);
43+
}

lldb/source/Plugins/ABI/X86/ABIX86.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- ABIX86.h ------------------------------------------------*- C++ -*-===//
1+
//===-- X86.h ---------------------------------------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,15 +10,15 @@
1010
#define LLDB_SOURCE_PLUGINS_ABI_X86_ABIX86_H
1111

1212
#include "lldb/Target/ABI.h"
13-
#include "lldb/lldb-private.h"
1413

1514
class ABIX86 : public lldb_private::MCBasedABI {
1615
public:
1716
static void Initialize();
1817
static void Terminate();
1918

19+
uint32_t GetGenericNum(llvm::StringRef name) override;
20+
2021
private:
2122
using lldb_private::MCBasedABI::MCBasedABI;
2223
};
23-
2424
#endif

lldb/source/Plugins/ABI/X86/ABIX86_64.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,18 @@
99
#ifndef LLDB_SOURCE_PLUGINS_ABI_X86_ABIX86_64_H
1010
#define LLDB_SOURCE_PLUGINS_ABI_X86_ABIX86_64_H
1111

12-
#include "Plugins/ABI/X86/ABIX86.h"
13-
14-
class ABIX86_64 : public ABIX86 {
15-
public:
16-
uint32_t GetGenericNum(llvm::StringRef name) override;
12+
#include "lldb/Target/ABI.h"
13+
#include "lldb/lldb-private.h"
1714

15+
class ABIX86_64 : public lldb_private::MCBasedABI {
1816
protected:
1917
std::string GetMCName(std::string name) override {
2018
MapRegisterName(name, "stmm", "st");
2119
return name;
2220
}
2321

2422
private:
25-
using ABIX86::ABIX86;
23+
using lldb_private::MCBasedABI::MCBasedABI;
2624
};
2725

2826
#endif // LLDB_SOURCE_PLUGINS_ABI_X86_ABIX86_64_H

lldb/source/Plugins/ABI/X86/ABIX86_i386.cpp

Lines changed: 0 additions & 22 deletions
This file was deleted.

lldb/source/Plugins/ABI/X86/ABIX86_i386.h

Lines changed: 0 additions & 22 deletions
This file was deleted.

lldb/source/Plugins/ABI/X86/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
add_lldb_library(lldbPluginABIX86 PLUGIN
22
ABIX86.cpp
3-
ABIX86_i386.cpp
43
ABIMacOSX_i386.cpp
54
ABISysV_i386.cpp
65
ABISysV_x86_64.cpp

0 commit comments

Comments
 (0)