2
* Copyright (C) 2009, Mukesh Rathor, Oracle Corp. All rights reserved.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public
6
* License v2 as published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* General Public License for more details.
13
* You should have received a copy of the GNU General Public
14
* License along with this program; if not, write to the
15
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16
* Boston, MA 021110-1307, USA.
20
do {(xgprt(__FUNCTION__,__VA_ARGS__));} while (0)
22
do {(xgtrc_on) ? (xgtrc(__FUNCTION__,__VA_ARGS__)):0;} while (0)
24
do {(xgtrc_on==2) ? (xgtrc(__FUNCTION__,__VA_ARGS__)):0;} while (0)
26
#if defined(__x86_64__)
28
#define XGF64 "%016lx"
31
#define XGF64 "%016llx"
36
XG_GPRS=1, /* general purpose user regs */
37
XG_FPRS=2, /* floating point user regs */
41
typedef uint32_t vcpuid_t;
45
/* what gdb wants to receive during register read, or sends during write.
46
* this from : regformats/reg-i386-linux.dat in gdbserver */
47
struct xg_gdb_regs32 {
66
/* this from: regformats/reg-x86-64.dat in gdbserver */
67
struct xg_gdb_regs64 {
95
struct xg_gdb_regs32 gregs_32;
96
struct xg_gdb_regs64 gregs_64;
101
int xg_attach(int, int);
102
void xg_detach_deinit(void);
103
int xg_step(vcpuid_t, int);
104
vcpuid_t xg_resume_n_wait(int);
105
int xg_regs_read(regstype_t, vcpuid_t, union xg_gdb_regs *, int);
106
int xg_regs_write(regstype_t, vcpuid_t, union xg_gdb_regs *, int);
107
int xg_read_mem(uint64_t, char *, int, uint64_t);
108
int xg_write_mem(uint64_t, char *, int, uint64_t);
109
void xgprt(const char *fn, const char *fmt, ...);
110
void xgtrc(const char *fn, const char *fmt, ...);