15 g->stub_features.extended_mode = -1;
16 g->stub_features.pkt_sz = 64;
17 g->stub_features.P =
true;
18 g->remote_file_fd = -1;
19 g->is_server = is_server;
21 g->send_buff = (
char *)
calloc(
g->send_max, 1);
29 g->read_buff = (
char *)
calloc(
g->read_max, 1);
36 g->gdbr_lock_depth = 0;
56 if (
g->target.valid &&
g->registers) {
62 eprintf(
"cannot find gdb reg_profile\n");
69 g->target.arch =
arch;
70 g->target.bits =
bits;
71 g->target.valid =
true;
81 }
else if (
bits == 64) {
84 eprintf(
"%s: unsupported x86 bits: %d\n", __func__,
bits);
91 }
else if (
bits == 64) {
94 eprintf(
"%s: unsupported arm bits: %d\n", __func__,
bits);
108 eprintf(
"%s: unsupported riscv bits: %d\n", __func__,
bits);
131 eprintf(
"cannot parse reg profile\n");
134 if (
g->target.regprofile) {
135 free(
g->target.regprofile);
int bits(struct state *s, int need)
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
int gdbr_set_reg_profile(libgdbr_t *g, const char *str)
Function set the gdbr internal registers profile.
bool gdbr_set_architecture(libgdbr_t *g, int arch, int bits)
Function initializes the architecture of the gdbsession.
char * gdbr_get_reg_profile(int arch, int bits)
Function get gdb registers profile based on arch and bits.
int gdbr_cleanup(libgdbr_t *g)
frees all buffers and cleans the libgdbr instance stuff
int gdbr_init(libgdbr_t *g, bool is_server)
Function initializes the libgdbr lib.
#define GDB_REMOTE_TYPE_GDB
void * calloc(size_t number, size_t size)
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
RZ_API RzSocket * rz_socket_new(bool is_ssl)
RZ_API int rz_socket_free(RzSocket *s)
gdb_reg_t * arch_parse_reg_profile(const char *reg_profile)
RZ_API void rz_th_lock_free(RZ_NULLABLE RzThreadLock *thl)
Frees a RzThreadLock structure.
RZ_API RZ_OWN RzThreadLock * rz_th_lock_new(bool recursive)
Allocates and initialize a RzThreadLock structure.