1 | /* $Id: DBGPlugInCommonELF.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * DBGPlugInCommonELF - Common code for dealing with ELF images, Header.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2008-2024 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef DEBUGGER_INCLUDED_SRC_DBGPlugInCommonELF_h
|
---|
29 | #define DEBUGGER_INCLUDED_SRC_DBGPlugInCommonELF_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include <VBox/types.h>
|
---|
35 | #include <iprt/formats/elf32.h>
|
---|
36 | #include <iprt/formats/elf64.h>
|
---|
37 |
|
---|
38 | /** @name DBGDiggerCommonParseElf32Mod and DBGDiggerCommonParseElf64Mod flags
|
---|
39 | * @{ */
|
---|
40 | /** Whether to adjust the symbol values or not. */
|
---|
41 | #define DBG_DIGGER_ELF_ADJUST_SYM_VALUE RT_BIT_32(0)
|
---|
42 | /** Indicates that we're missing section headers and that
|
---|
43 | * all section indexes are to be considered invalid. (Solaris hack.)
|
---|
44 | * This flag is incompatible with DBG_DIGGER_ELF_ADJUST_SYM_VALUE. */
|
---|
45 | #define DBG_DIGGER_ELF_FUNNY_SHDRS RT_BIT_32(1)
|
---|
46 | /** Valid bit mask. */
|
---|
47 | #define DBG_DIGGER_ELF_MASK UINT32_C(0x00000003)
|
---|
48 | /** @} */
|
---|
49 |
|
---|
50 | int DBGDiggerCommonParseElf32Mod(PUVM pUVM, PCVMMR3VTABLE pVMM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
|
---|
51 | Elf32_Ehdr const *pEhdr, Elf32_Shdr const *paShdrs,
|
---|
52 | Elf32_Sym const *paSyms, size_t cMaxSyms,
|
---|
53 | char const *pbStrings, size_t cbMaxStrings,
|
---|
54 | RTGCPTR MinAddr, RTGCPTR MaxAddr, uint64_t uModTag);
|
---|
55 |
|
---|
56 | int DBGDiggerCommonParseElf64Mod(PUVM pUVM, PCVMMR3VTABLE pVMM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
|
---|
57 | Elf64_Ehdr const *pEhdr, Elf64_Shdr const *paShdrs,
|
---|
58 | Elf64_Sym const *paSyms, size_t cMaxSyms,
|
---|
59 | char const *pbStrings, size_t cbMaxStrings,
|
---|
60 | RTGCPTR MinAddr, RTGCPTR MaxAddr, uint64_t uModTag);
|
---|
61 |
|
---|
62 | #endif /* !DEBUGGER_INCLUDED_SRC_DBGPlugInCommonELF_h */
|
---|
63 |
|
---|