VirtualBox

source: vbox/trunk/src/VBox/Debugger/DBGCIoProvInternal.h@ 87816

Last change on this file since 87816 was 86327, checked in by vboxsync, 4 years ago

Debugger: Allow for different I/O providers instead of only TCP

So far TCP was the only option to communicate remotely with the internal debugger, the other option
was to use the console from the GUI directly. This commit reworks basic I/O to allow for different
providers where TCP is just one option. The second one being introduced is an IPC provider using a local
socket or named pipe depending on the platform. This allows for Windows kernel debugging over a pipe
using the KD stub in VirtualBox and WinDbg running on the host (not tested yet).

Furthermore this commit allows multiple stubs to be listening for connections at the same time, so
one can have a GDB stub listening on one TCP port and the native VBox debugger listening on another one
or even using a different I/O provider. Only one session can be active at a time though, because sharing
debugger states is impossible. To configure this the following CFGM keys need to be set for each listener:

"DBGC/<Some unique ID>/Provider" "tcp|ipc"
"DBGC/<Some unique ID>/StubType" "native|gdb|kd"
"DBGC/<Some unique ID>/Address" "<ip>|<local named pipe or socket path>"
"DBGC/<Some unique ID>/Port" "<port>" (for TCP only)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1/* $Id: DBGCIoProvInternal.h 86327 2020-09-28 16:20:50Z vboxsync $ */
2/** @file
3 * DBGC - Debugger Console, Internal I/O provider header file.
4 */
5
6/*
7 * Copyright (C) 2020 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef DEBUGGER_INCLUDED_SRC_DBGCIoProvInternal_h
19#define DEBUGGER_INCLUDED_SRC_DBGCIoProvInternal_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24
25/*******************************************************************************
26* Header Files *
27*******************************************************************************/
28#include <VBox/dbg.h>
29#include <VBox/err.h>
30#include <VBox/vmm/cfgm.h>
31
32
33/*******************************************************************************
34* Structures and Typedefs *
35*******************************************************************************/
36
37/** An Opaque I/O provider handle. */
38typedef struct DBGCIOPROVINT *DBGCIOPROV;
39/** Pointer to an opaque I/O provider handle. */
40typedef DBGCIOPROV *PDBGCIOPROV;
41
42
43/**
44 * I/O provider registration record.
45 */
46typedef struct DBGCIOPROVREG
47{
48 /** Unique name for the I/O provider. */
49 const char *pszName;
50 /** I/O provider description. */
51 const char *pszDesc;
52
53 /**
54 * Creates an I/O provider instance from the given config.
55 *
56 * @returns VBox status code.
57 * @param phDbgcIoProv Where to store the handle to the I/O provider instance on success.
58 * @param pCfg The config to use.
59 */
60 DECLCALLBACKMEMBER(int, pfnCreate, (PDBGCIOPROV phDbgcIoProv, PCFGMNODE pCfg));
61
62 /**
63 * Destroys the given I/O provider instance.
64 *
65 * @returns nothing.
66 * @param hDbgcIoProv The I/O provider instance handle to destroy.
67 */
68 DECLCALLBACKMEMBER(void, pfnDestroy, (DBGCIOPROV hDbgcIoProv));
69
70 /**
71 * Waits for someone to connect to the provider instance.
72 *
73 * @returns VBox status code.
74 * @retval VERR_TIMEOUT if the waiting time was exceeded without anyone connecting.
75 * @retval VERR_INTERRUPTED if the waiting was interrupted by DBGCIOPROVREG::pfnWaitInterrupt.
76 * @param hDbgcIoProv The I/O provider instance handle.
77 * @param cMsTimeout Number of milliseconds to wait, use RT_INDEFINITE_WAIT to wait indefinitely.
78 * @param ppDbgcIo Where to return the I/O connection callback table upon a succesful return.
79 */
80 DECLCALLBACKMEMBER(int, pfnWaitForConnect, (DBGCIOPROV hDbgcIoProv, RTMSINTERVAL cMsTimeout, PCDBGCIO *ppDbgcIo));
81
82 /**
83 * Interrupts the thread waiting in DBGCIOPROVREG::pfnWaitForConnect.
84 *
85 * @returns VBox status code.
86 * @param hDbgcIoProv The I/O provider instance handle.
87 */
88 DECLCALLBACKMEMBER(int, pfnWaitInterrupt, (DBGCIOPROV hDbgcIoProv));
89
90} DBGCIOPROVREG;
91/** Pointer to an I/O provider registration record. */
92typedef DBGCIOPROVREG *PDBGCIOPROVREG;
93/** Pointer toa const I/O provider registration record. */
94typedef const DBGCIOPROVREG *PCDBGCIOPROVREG;
95
96
97/*******************************************************************************
98* Global Variables *
99*******************************************************************************/
100extern const DBGCIOPROVREG g_DbgcIoProvTcp;
101extern const DBGCIOPROVREG g_DbgcIoProvIpc;
102
103
104#endif /* !DEBUGGER_INCLUDED_SRC_DBGCIoProvInternal_h */
105
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette