[31510] | 1 | /* $Id: DBGPlugInCommonELF.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
| 2 | /** @file
|
---|
| 3 | * DBGPlugInCommonELF - Common code for dealing with ELF images, Header.
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2008-2023 Oracle and/or its affiliates.
|
---|
[31510] | 8 | *
|
---|
[96407] | 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
|
---|
[31510] | 26 | */
|
---|
| 27 |
|
---|
[76564] | 28 | #ifndef DEBUGGER_INCLUDED_SRC_DBGPlugInCommonELF_h
|
---|
| 29 | #define DEBUGGER_INCLUDED_SRC_DBGPlugInCommonELF_h
|
---|
[76518] | 30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 31 | # pragma once
|
---|
| 32 | #endif
|
---|
[31510] | 33 |
|
---|
| 34 | #include <VBox/types.h>
|
---|
[69435] | 35 | #include <iprt/formats/elf32.h>
|
---|
| 36 | #include <iprt/formats/elf64.h>
|
---|
[31510] | 37 |
|
---|
| 38 | /** @name DBGDiggerCommonParseElf32Mod and DBGDiggerCommonParseElf64Mod flags
|
---|
| 39 | * @{ */
|
---|
[33540] | 40 | /** Whether to adjust the symbol values or not. */
|
---|
[31510] | 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)
|
---|
[81369] | 48 | /** @} */
|
---|
[31510] | 49 |
|
---|
[93470] | 50 | int DBGDiggerCommonParseElf32Mod(PUVM pUVM, PCVMMR3VTABLE pVMM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
|
---|
[31510] | 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 |
|
---|
[93470] | 56 | int DBGDiggerCommonParseElf64Mod(PUVM pUVM, PCVMMR3VTABLE pVMM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
|
---|
[31510] | 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 |
|
---|
[76564] | 62 | #endif /* !DEBUGGER_INCLUDED_SRC_DBGPlugInCommonELF_h */
|
---|
[31510] | 63 |
|
---|