xref: /freebsd-src/contrib/llvm-project/lldb/source/Plugins/ABI/X86/ABIX86_i386.cpp (revision 349cc55c9796c4596a5b9904cd3281af295f878f)
1*349cc55cSDimitry Andric //===-- ABIX86_i386.cpp ---------------------------------------------------===//
2*349cc55cSDimitry Andric //
3*349cc55cSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*349cc55cSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*349cc55cSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*349cc55cSDimitry Andric //
7*349cc55cSDimitry Andric //===----------------------------------------------------------------------===//
8*349cc55cSDimitry Andric 
9*349cc55cSDimitry Andric #include "ABIX86_i386.h"
10*349cc55cSDimitry Andric 
GetGenericNum(llvm::StringRef name)11*349cc55cSDimitry Andric uint32_t ABIX86_i386::GetGenericNum(llvm::StringRef name) {
12*349cc55cSDimitry Andric   return llvm::StringSwitch<uint32_t>(name)
13*349cc55cSDimitry Andric       .Case("eip", LLDB_REGNUM_GENERIC_PC)
14*349cc55cSDimitry Andric       .Case("esp", LLDB_REGNUM_GENERIC_SP)
15*349cc55cSDimitry Andric       .Case("ebp", LLDB_REGNUM_GENERIC_FP)
16*349cc55cSDimitry Andric       .Case("eflags", LLDB_REGNUM_GENERIC_FLAGS)
17*349cc55cSDimitry Andric       .Case("edi", LLDB_REGNUM_GENERIC_ARG1)
18*349cc55cSDimitry Andric       .Case("esi", LLDB_REGNUM_GENERIC_ARG2)
19*349cc55cSDimitry Andric       .Case("edx", LLDB_REGNUM_GENERIC_ARG3)
20*349cc55cSDimitry Andric       .Case("ecx", LLDB_REGNUM_GENERIC_ARG4)
21*349cc55cSDimitry Andric       .Default(LLDB_INVALID_REGNUM);
22*349cc55cSDimitry Andric }
23