Skip to content

Commit

Permalink
Revert "[lldb] [ABI/X86] Split base x86 and i386 classes"
Browse files Browse the repository at this point in the history
This change broke the windows lldb bot.

This reverts commit a30a36f.
  • Loading branch information
sstamenova committed Oct 6, 2021
1 parent f86c930 commit 10f16bc
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 61 deletions.
6 changes: 3 additions & 3 deletions lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#ifndef LLDB_SOURCE_PLUGINS_ABI_X86_ABIMACOSX_I386_H
#define LLDB_SOURCE_PLUGINS_ABI_X86_ABIMACOSX_I386_H

#include "Plugins/ABI/X86/ABIX86_i386.h"
#include "Plugins/ABI/X86/ABIX86.h"
#include "lldb/Core/Value.h"
#include "lldb/lldb-private.h"

class ABIMacOSX_i386 : public ABIX86_i386 {
class ABIMacOSX_i386 : public ABIX86 {
public:
~ABIMacOSX_i386() override = default;

Expand Down Expand Up @@ -92,7 +92,7 @@ class ABIMacOSX_i386 : public ABIX86_i386 {
}

private:
using ABIX86_i386::ABIX86_i386; // Call CreateInstance instead.
using ABIX86::ABIX86; // Call CreateInstance instead.
};

#endif // LLDB_SOURCE_PLUGINS_ABI_X86_ABIMACOSX_I386_H
6 changes: 3 additions & 3 deletions lldb/source/Plugins/ABI/X86/ABISysV_i386.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#ifndef LLDB_SOURCE_PLUGINS_ABI_X86_ABISYSV_I386_H
#define LLDB_SOURCE_PLUGINS_ABI_X86_ABISYSV_I386_H

#include "Plugins/ABI/X86/ABIX86_i386.h"
#include "Plugins/ABI/X86/ABIX86.h"
#include "lldb/lldb-private.h"

class ABISysV_i386 : public ABIX86_i386 {
class ABISysV_i386 : public ABIX86 {
public:
~ABISysV_i386() override = default;

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

private:
using ABIX86_i386::ABIX86_i386; // Call CreateInstance instead.
using ABIX86::ABIX86; // Call CreateInstance instead.
};

#endif // LLDB_SOURCE_PLUGINS_ABI_X86_ABISYSV_I386_H
15 changes: 14 additions & 1 deletion lldb/source/Plugins/ABI/X86/ABIX86.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- ABIX86.cpp --------------------------------------------------------===//
//===-- X86.h -------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down Expand Up @@ -28,3 +28,16 @@ void ABIX86::Terminate() {
ABISysV_x86_64::Terminate();
ABIWindows_x86_64::Terminate();
}

uint32_t ABIX86::GetGenericNum(llvm::StringRef name) {
return llvm::StringSwitch<uint32_t>(name)
.Case("eip", LLDB_REGNUM_GENERIC_PC)
.Case("esp", LLDB_REGNUM_GENERIC_SP)
.Case("ebp", LLDB_REGNUM_GENERIC_FP)
.Case("eflags", LLDB_REGNUM_GENERIC_FLAGS)
.Case("edi", LLDB_REGNUM_GENERIC_ARG1)
.Case("esi", LLDB_REGNUM_GENERIC_ARG2)
.Case("edx", LLDB_REGNUM_GENERIC_ARG3)
.Case("ecx", LLDB_REGNUM_GENERIC_ARG4)
.Default(LLDB_INVALID_REGNUM);
}
6 changes: 3 additions & 3 deletions lldb/source/Plugins/ABI/X86/ABIX86.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- ABIX86.h ------------------------------------------------*- C++ -*-===//
//===-- X86.h ---------------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -10,15 +10,15 @@
#define LLDB_SOURCE_PLUGINS_ABI_X86_ABIX86_H

#include "lldb/Target/ABI.h"
#include "lldb/lldb-private.h"

class ABIX86 : public lldb_private::MCBasedABI {
public:
static void Initialize();
static void Terminate();

uint32_t GetGenericNum(llvm::StringRef name) override;

private:
using lldb_private::MCBasedABI::MCBasedABI;
};

#endif
10 changes: 4 additions & 6 deletions lldb/source/Plugins/ABI/X86/ABIX86_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,18 @@
#ifndef LLDB_SOURCE_PLUGINS_ABI_X86_ABIX86_64_H
#define LLDB_SOURCE_PLUGINS_ABI_X86_ABIX86_64_H

#include "Plugins/ABI/X86/ABIX86.h"

class ABIX86_64 : public ABIX86 {
public:
uint32_t GetGenericNum(llvm::StringRef name) override;
#include "lldb/Target/ABI.h"
#include "lldb/lldb-private.h"

class ABIX86_64 : public lldb_private::MCBasedABI {
protected:
std::string GetMCName(std::string name) override {
MapRegisterName(name, "stmm", "st");
return name;
}

private:
using ABIX86::ABIX86;
using lldb_private::MCBasedABI::MCBasedABI;
};

#endif // LLDB_SOURCE_PLUGINS_ABI_X86_ABIX86_64_H
22 changes: 0 additions & 22 deletions lldb/source/Plugins/ABI/X86/ABIX86_i386.cpp

This file was deleted.

22 changes: 0 additions & 22 deletions lldb/source/Plugins/ABI/X86/ABIX86_i386.h

This file was deleted.

1 change: 0 additions & 1 deletion lldb/source/Plugins/ABI/X86/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
add_lldb_library(lldbPluginABIX86 PLUGIN
ABIX86.cpp
ABIX86_i386.cpp
ABIMacOSX_i386.cpp
ABISysV_i386.cpp
ABISysV_x86_64.cpp
Expand Down

0 comments on commit 10f16bc

Please sign in to comment.