[2] | 1 | /* $Id: kDbgModLdr.cpp 6 2008-02-03 23:37:34Z bird $ */
|
---|
| 2 | /** @file
|
---|
| 3 | * kDbg - The Debug Info Reader, kLdr Based.
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
| 7 | * Copyright (c) 2006-2007 knut st. osmundsen <bird-kStuff-spam@anduin.net>
|
---|
| 8 | *
|
---|
| 9 | * This file is part of kStuff.
|
---|
| 10 | *
|
---|
| 11 | * kStuff is free software; you can redistribute it and/or
|
---|
| 12 | * modify it under the terms of the GNU Lesser General Public
|
---|
| 13 | * License as published by the Free Software Foundation; either
|
---|
| 14 | * version 2.1 of the License, or (at your option) any later version.
|
---|
| 15 | *
|
---|
| 16 | * In addition to the permissions in the GNU Lesser General Public
|
---|
| 17 | * License, you are granted unlimited permission to link the compiled
|
---|
| 18 | * version of this file into combinations with other programs, and to
|
---|
| 19 | * distribute those combinations without any restriction coming from
|
---|
| 20 | * the use of this file.
|
---|
| 21 | *
|
---|
| 22 | * kStuff is distributed in the hope that it will be useful,
|
---|
| 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 25 | * Lesser General Public License for more details.
|
---|
| 26 | *
|
---|
| 27 | * You should have received a copy of the GNU Lesser General Public
|
---|
| 28 | * License along with kStuff; if not, write to the Free Software
|
---|
| 29 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
---|
| 30 | * 02110-1301, USA
|
---|
| 31 | */
|
---|
| 32 |
|
---|
| 33 | /*******************************************************************************
|
---|
| 34 | * Header Files *
|
---|
| 35 | *******************************************************************************/
|
---|
| 36 | #include <k/kDbg.h>
|
---|
[6] | 37 | #include <k/kLdr.h>
|
---|
[2] | 38 | #include "kDbgInternal.h"
|
---|
| 39 |
|
---|
| 40 |
|
---|
| 41 | /*******************************************************************************
|
---|
| 42 | * Structures and Typedefs *
|
---|
| 43 | *******************************************************************************/
|
---|
| 44 | /**
|
---|
| 45 | * A kLdr based debug reader.
|
---|
| 46 | */
|
---|
| 47 | typedef struct KDBGMODLDR
|
---|
| 48 | {
|
---|
| 49 | /** The common module core. */
|
---|
| 50 | KDBGMOD Core;
|
---|
| 51 | /** Pointer to the loader module. */
|
---|
| 52 | PKLDRMOD pLdrMod;
|
---|
| 53 | } KDBGMODLDR, *PKDBGMODLDR;
|
---|
| 54 |
|
---|
| 55 |
|
---|
| 56 | /**
|
---|
| 57 | * @copydoc KDBGMODOPS::pfnQueryLine
|
---|
| 58 | */
|
---|
[6] | 59 | static int kDbgModLdrQueryLine(PKDBGMOD pMod, KI32 iSegment, KDBGADDR uOffset, PKDBGLINE pLine)
|
---|
[2] | 60 | {
|
---|
| 61 | //PKDBGMODLDR pThis = (PKDBGMODLDR)pMod;
|
---|
| 62 | return KERR_NOT_IMPLEMENTED;
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 |
|
---|
| 66 | /**
|
---|
| 67 | * @copydoc KDBGMODOPS::pfnQuerySymbol
|
---|
| 68 | */
|
---|
[6] | 69 | static int kDbgModLdrQuerySymbol(PKDBGMOD pMod, KI32 iSegment, KDBGADDR off, PKDBGSYMBOL pSym)
|
---|
[2] | 70 | {
|
---|
| 71 | //PKDBGMODLDR pThis = (PKDBGMODLDR)pMod;
|
---|
| 72 | return KERR_NOT_IMPLEMENTED;
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 |
|
---|
| 76 | /**
|
---|
| 77 | * @copydoc KDBGMODOPS::pfnClose
|
---|
| 78 | */
|
---|
| 79 | static int kDbgModLdrClose(PKDBGMOD pMod)
|
---|
| 80 | {
|
---|
| 81 | //PKDBGMODLDr pThis = (PKDBGMODLDR)pMod;
|
---|
| 82 | return KERR_NOT_IMPLEMENTED;
|
---|
| 83 | }
|
---|
| 84 |
|
---|
| 85 |
|
---|
| 86 | /**
|
---|
| 87 | * @copydocs KDBGMODOPS::pfnOpen.
|
---|
| 88 | */
|
---|
[6] | 89 | static int kDbgModLdrOpen(PKDBGMOD *ppMod, PKRDR pRdr, KBOOL fCloseRdr, KFOFF off, KFOFF cb, struct KLDRMOD *pLdrMod)
|
---|
[2] | 90 | {
|
---|
| 91 | return KERR_NOT_IMPLEMENTED;
|
---|
| 92 | }
|
---|
| 93 |
|
---|
| 94 |
|
---|
| 95 | /**
|
---|
| 96 | * Methods for a PE module.
|
---|
| 97 | */
|
---|
[6] | 98 | const KDBGMODOPS g_kDbgModLdr =
|
---|
[2] | 99 | {
|
---|
| 100 | "kLdr",
|
---|
[6] | 101 | NULL,
|
---|
[2] | 102 | kDbgModLdrOpen,
|
---|
| 103 | kDbgModLdrClose,
|
---|
| 104 | kDbgModLdrQuerySymbol,
|
---|
[6] | 105 | kDbgModLdrQueryLine,
|
---|
[2] | 106 | "kLdr"
|
---|
| 107 | };
|
---|
| 108 |
|
---|
| 109 |
|
---|
| 110 |
|
---|
| 111 |
|
---|