Rizin
unix-like reverse engineering framework and cli tools
core.h File Reference
#include "rz_types.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "libqnxr.h"
#include "utils.h"
#include "arch.h"

Go to the source code of this file.

Macros

#define offsetof(TYPE, MEMBER)   ((size_t) & ((TYPE *)0)->MEMBER)
 

Enumerations

enum  Breakpoint {
  BREAKPOINT , HARDWARE_BREAKPOINT , WRITE_WATCHPOINT , READ_WATCHPOINT ,
  ACCESS_WATCHPOINT , BREAKPOINT , HARDWARE_BREAKPOINT , WRITE_WATCHPOINT ,
  READ_WATCHPOINT , ACCESS_WATCHPOINT
}
 

Functions

int qnxr_send_vcont (libqnxr_t *g, int step, int thread_id)
 
int _qnxr_set_bp (libqnxr_t *g, ut64 address, const char *conditions, enum Breakpoint type)
 
int _qnxr_remove_bp (libqnxr_t *g, ut64 address, enum Breakpoint type)
 

Macro Definition Documentation

◆ offsetof

#define offsetof (   TYPE,
  MEMBER 
)    ((size_t) & ((TYPE *)0)->MEMBER)

Definition at line 23 of file core.h.

Enumeration Type Documentation

◆ Breakpoint

enum Breakpoint
Enumerator
BREAKPOINT 
HARDWARE_BREAKPOINT 
WRITE_WATCHPOINT 
READ_WATCHPOINT 
ACCESS_WATCHPOINT 
BREAKPOINT 
HARDWARE_BREAKPOINT 
WRITE_WATCHPOINT 
READ_WATCHPOINT 
ACCESS_WATCHPOINT 

Definition at line 26 of file core.h.

26  {
27  BREAKPOINT,
32 };
@ WRITE_WATCHPOINT
Definition: core.h:49
@ READ_WATCHPOINT
Definition: core.h:50
@ ACCESS_WATCHPOINT
Definition: core.h:51
@ BREAKPOINT
Definition: core.h:47
@ HARDWARE_BREAKPOINT
Definition: core.h:48

Function Documentation

◆ _qnxr_remove_bp()

int _qnxr_remove_bp ( libqnxr_t g,
ut64  address,
enum Breakpoint  type 
)

Definition at line 629 of file core.c.

629  {
630  if (!g)
631  return -1;
632 
634  g->tran.pkt.brk.addr = EXTRACT_UNSIGNED_INTEGER(&address, 4);
635  g->tran.pkt.brk.size = -1;
636  nto_send(g, sizeof(g->tran.pkt.brk), 0);
637 
638  if (g->recv.pkt.hdr.cmd == DSrMsg_err)
639  return -1;
640  return 0;
641 }
@ DSMSG_BRK_EXEC
Definition: dsmsgs.h:232
#define SET_CHANNEL_DEBUG
Definition: dsmsgs.h:94
@ DStMsg_brk
Definition: dsmsgs.h:137
@ DSrMsg_err
Definition: dsmsgs.h:152
struct @667 g
#define EXTRACT_UNSIGNED_INTEGER(addr, len)
Definition: utils.h:22
void nto_send_init(libqnxr_t *g, ut32 cmd, ut32 subcmd, ut32 chan)
Definition: core.c:643
int nto_send(libqnxr_t *g, ut32 len, int report_errors)

References DSMSG_BRK_EXEC, DSrMsg_err, DStMsg_brk, EXTRACT_UNSIGNED_INTEGER, g, nto_send(), nto_send_init(), and SET_CHANNEL_DEBUG.

Referenced by qnxr_remove_bp(), and qnxr_remove_hwbp().

◆ _qnxr_set_bp()

int _qnxr_set_bp ( libqnxr_t g,
ut64  address,
const char *  conditions,
enum Breakpoint  type 
)

Definition at line 615 of file core.c.

615  {
616  if (!g)
617  return -1;
618 
620  g->tran.pkt.brk.addr = EXTRACT_UNSIGNED_INTEGER(&address, 4);
621  g->tran.pkt.brk.size = 0;
622  nto_send(g, sizeof(g->tran.pkt.brk), 0);
623 
624  if (g->recv.pkt.hdr.cmd == DSrMsg_err)
625  return -1;
626  return 0;
627 }

References DSMSG_BRK_EXEC, DSrMsg_err, DStMsg_brk, EXTRACT_UNSIGNED_INTEGER, g, nto_send(), nto_send_init(), and SET_CHANNEL_DEBUG.

Referenced by qnxr_set_bp(), and qnxr_set_hwbp().

◆ qnxr_send_vcont()

int qnxr_send_vcont ( libqnxr_t g,
int  step,
int  thread_id 
)

Definition at line 517 of file core.c.

517  {
518  if (!g)
519  return -1;
520 
523  g->tran.pkt.run.step.count = 1;
524  nto_send(g, sizeof(g->tran.pkt.run), 1);
525  return 0;
526 }
@ DSMSG_RUN_COUNT
Definition: dsmsgs.h:201
@ DSMSG_RUN
Definition: dsmsgs.h:200
@ DStMsg_run
Definition: dsmsgs.h:136
static states step(struct re_guts *, sopno, sopno, states, int, states)
Definition: engine.c:888

References DSMSG_RUN, DSMSG_RUN_COUNT, DStMsg_run, g, nto_send(), nto_send_init(), SET_CHANNEL_DEBUG, and step().

Referenced by qnxr_continue(), and qnxr_step().