-
Notifications
You must be signed in to change notification settings - Fork 19
/
globalbp.h
64 lines (58 loc) · 1.93 KB
/
globalbp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* globalbp.h -
*
* This file defines the (shared-memory) structures used by the PL debugger
* to keep track of global breakpoints.
*
* Copyright (c) 2004-2024 EnterpriseDB Corporation. All Rights Reserved.
*
* Licensed under the Artistic License v2.0, see
* https://opensource.org/licenses/artistic-license-2.0
* for full details
*/
#ifndef GLOBALBP_H
#define GLOBALBP_H
#include "utils/hsearch.h"
typedef enum
{
BP_LOCAL = 0,
BP_GLOBAL
} eBreakpointScope;
/*
* Stores information pertaining to a global breakpoint.
*/
typedef struct BreakpointData
{
bool isTmp; /* tmp breakpoints are removed when hit */
bool busy; /* is this session already in use by a target? */
int proxyPort; /* port number of the proxy listener */
int proxyPid; /* process id of the proxy process */
} BreakpointData;
/*
* The key of the global breakpoints hash table. For now holds only have an Oid field.
* but it may contain more fields in future.
*/
typedef struct BreakpointKey
{
Oid databaseId;
Oid functionId;
int lineNumber;
int targetPid; /* -1 means any process */
} BreakpointKey;
typedef struct Breakpoint
{
BreakpointKey key;
BreakpointData data;
} Breakpoint;
extern Breakpoint * BreakpointLookup(eBreakpointScope scope, BreakpointKey *key);
extern bool BreakpointInsert(eBreakpointScope scope, BreakpointKey *key, BreakpointData *brkpnt);
extern bool BreakpointDelete(eBreakpointScope scope, BreakpointKey *key);
extern void BreakpointShowAll(eBreakpointScope scope);
extern bool BreakpointInsertOrUpdate(eBreakpointScope scope, BreakpointKey *key, BreakpointData *data);
extern bool BreakpointOnId(eBreakpointScope scope, Oid funcOid);
extern void BreakpointCleanupProc(int pid);
extern void BreakpointGetList(eBreakpointScope scope, HASH_SEQ_STATUS *scan);
extern void BreakpointReleaseList(eBreakpointScope scope);
extern void BreakpointBusySession(int pid);
extern void BreakpointFreeSession(int pid);
#endif