GDBserver

Classes | Macros | Enumerations | Functions | Variables
mips-linux-watch.h File Reference
`#include <asm/ptrace.h>`
`#include "break-common.h"`

Go to the source code of this file.

## Classes
struct | mips32_watch_regs
struct | mips64_watch_regs
struct | pt_watch_regs
struct | mips_watchpoint

## Macros
#define | MAX_DEBUG_REGISTER 8
#define | PTRACE_GET_WATCH_REGS 0xd0
#define | PTRACE_SET_WATCH_REGS 0xd1
#define | W_BIT 0
#define | R_BIT 1
#define | I_BIT 2
#define | W_MASK (1 << W_BIT)
#define | R_MASK (1 << R_BIT)
#define | I_MASK (1 << I_BIT)
#define | IRW_MASK (I_MASK | R_MASK | W_MASK)

## Enumerations
enum | pt_watch_style { pt_watch_style_mips32, pt_watch_style_mips64 }

## Functions
struct mips32_watch_regs | __attribute__ ((aligned(8)))
uint32_t | mips_linux_watch_get_num_valid (struct pt_watch_regs *regs)
uint32_t | mips_linux_watch_get_irw_mask (struct pt_watch_regs *regs, int n)
CORE_ADDR | mips_linux_watch_get_watchlo (struct pt_watch_regs *regs, int n)
void | mips_linux_watch_set_watchlo (struct pt_watch_regs *regs, int n, CORE_ADDR value)
uint32_t | mips_linux_watch_get_watchhi (struct pt_watch_regs *regs, int n)
void | mips_linux_watch_set_watchhi (struct pt_watch_regs *regs, int n, uint16_t value)
int | mips_linux_watch_try_one_watch (struct pt_watch_regs *regs, CORE_ADDR addr, int len, uint32_t irw)
void | mips_linux_watch_populate_regs (struct mips_watchpoint *current_watches, struct pt_watch_regs *regs)
uint32_t | mips_linux_watch_type_to_irw (enum target_hw_bp_type type)
int | mips_linux_read_watch_registers (long lwpid, struct pt_watch_regs *watch_readback, int *watch_readback_valid, int force)

## Variables
uint32_t | watchlo [MAX_DEBUG_REGISTER]
uint16_t | watchhi [MAX_DEBUG_REGISTER]
uint16_t | watch_masks [MAX_DEBUG_REGISTER]
uint32_t | num_valid
struct pt_watch_regs | __attribute__

## Macro Definition Documentation

## ◆ I_BIT

#define I_BIT 2

Definition at line 81 of file mips-linux-watch.h.

## ◆ I_MASK

#define I_MASK (1 << I_BIT)

Definition at line 85 of file mips-linux-watch.h.

## ◆ IRW_MASK

#define IRW_MASK (I_MASK | R_MASK | W_MASK)

Definition at line 87 of file mips-linux-watch.h.

Referenced by get_reg_mask(), mips_linux_watch_get_irw_mask(), mips_linux_watch_try_one_watch(), and mips_stopped_data_address().

## ◆ MAX_DEBUG_REGISTER

#define MAX_DEBUG_REGISTER 8

Definition at line 24 of file mips-linux-watch.h.

Referenced by mips_stopped_by_watchpoint(), and mips_stopped_data_address().

## ◆ PTRACE_GET_WATCH_REGS

#define PTRACE_GET_WATCH_REGS 0xd0

Definition at line 30 of file mips-linux-watch.h.

Referenced by mips_linux_read_watch_registers().

## ◆ PTRACE_SET_WATCH_REGS

#define PTRACE_SET_WATCH_REGS 0xd1

Definition at line 31 of file mips-linux-watch.h.

Referenced by mips_linux_prepare_to_resume().

## ◆ R_BIT

#define R_BIT 1

Definition at line 80 of file mips-linux-watch.h.

## ◆ R_MASK

#define R_MASK (1 << R_BIT)

Definition at line 84 of file mips-linux-watch.h.

Referenced by mips_linux_watch_type_to_irw(), mips_stopped_by_watchpoint(), and mips_stopped_data_address().

## ◆ W_BIT

#define W_BIT 0

Definition at line 79 of file mips-linux-watch.h.

## ◆ W_MASK

#define W_MASK (1 << W_BIT)

Definition at line 83 of file mips-linux-watch.h.

Referenced by mips_linux_watch_type_to_irw(), mips_stopped_by_watchpoint(), and mips_stopped_data_address().

## Enumeration Type Documentation

## ◆ pt_watch_style

enum pt_watch_style

Enumerator
pt_watch_style_mips32 |
pt_watch_style_mips64 |

Definition at line 33 of file mips-linux-watch.h.

## Function Documentation

## ◆ __attribute__()

struct mips32_watch_regs __attribute__ | ( | (aligned(8)) |  | ) |

## ◆ mips_linux_read_watch_registers()

int mips_linux_read_watch_registers | ( | long | lwpid,
|  | struct pt_watch_regs * | watch_readback,
|  | int * | watch_readback_valid,
|  | int | force
| ) |  |

Definition at line 161 of file mips-linux-watch.c.

References pt_watch_regs::mips32, pt_watch_regs::mips64, mips32_watch_regs::num_valid, mips64_watch_regs::num_valid, pt_watch_style_mips32, pt_watch_style_mips64, ptrace(), PTRACE_GET_WATCH_REGS, and pt_watch_regs::style.

Referenced by mips_insert_point(), mips_stopped_by_watchpoint(), and mips_stopped_data_address().

## ◆ mips_linux_watch_get_irw_mask()

uint32_t mips_linux_watch_get_irw_mask | ( | struct pt_watch_regs * | regs,
|  | int | n
| ) |  |

Definition at line 26 of file mips-linux-watch.c.

References _, internal_error(), IRW_MASK, pt_watch_regs::mips32, pt_watch_regs::mips64, pt_watch_style_mips32, pt_watch_style_mips64, pt_watch_regs::style, mips32_watch_regs::watch_masks, and mips64_watch_regs::watch_masks.

Referenced by mips_linux_watch_try_one_watch().

## ◆ mips_linux_watch_get_num_valid()

uint32_t mips_linux_watch_get_num_valid | ( | struct pt_watch_regs * | regs | ) |

Definition at line 61 of file mips-linux-watch.c.

References _, internal_error(), pt_watch_regs::mips32, pt_watch_regs::mips64, mips32_watch_regs::num_valid, mips64_watch_regs::num_valid, pt_watch_style_mips32, pt_watch_style_mips64, and pt_watch_regs::style.

Referenced by mips_linux_prepare_to_resume(), mips_linux_watch_populate_regs(), mips_linux_watch_try_one_watch(), mips_stopped_by_watchpoint(), and mips_stopped_data_address().

## ◆ mips_linux_watch_get_watchhi()

uint32_t mips_linux_watch_get_watchhi | ( | struct pt_watch_regs * | regs,
|  | int | n
| ) |  |

Definition at line 120 of file mips-linux-watch.c.

References _, internal_error(), pt_watch_regs::mips32, pt_watch_regs::mips64, pt_watch_style_mips32, pt_watch_style_mips64, pt_watch_regs::style, mips32_watch_regs::watchhi, and mips64_watch_regs::watchhi.

Referenced by mips_linux_watch_try_one_watch(), mips_stopped_by_watchpoint(), and mips_stopped_data_address().

## ◆ mips_linux_watch_get_watchlo()

CORE_ADDR mips_linux_watch_get_watchlo | ( | struct pt_watch_regs * | regs,
|  | int | n
| ) |  |

Definition at line 79 of file mips-linux-watch.c.

References _, internal_error(), pt_watch_regs::mips32, pt_watch_regs::mips64, pt_watch_style_mips32, pt_watch_style_mips64, pt_watch_regs::style, mips32_watch_regs::watchlo, and mips64_watch_regs::watchlo.

Referenced by mips_linux_watch_try_one_watch(), and mips_stopped_data_address().

## ◆ mips_linux_watch_populate_regs()

void mips_linux_watch_populate_regs | ( | struct mips_watchpoint * | current_watches,
|  | struct pt_watch_regs * | regs
| ) |  |

Definition at line 325 of file mips-linux-watch.c.

References mips_watchpoint::addr, gdb_assert, mips_watchpoint::len, mips_linux_watch_get_num_valid(), mips_linux_watch_set_watchhi(), mips_linux_watch_set_watchlo(), mips_linux_watch_try_one_watch(), mips_linux_watch_type_to_irw(), mips_watchpoint::next, and mips_watchpoint::type.

Referenced by mips_insert_point(), and mips_remove_point().

## ◆ mips_linux_watch_set_watchhi()

void mips_linux_watch_set_watchhi | ( | struct pt_watch_regs * | regs,
|  | int | n,
|  | uint16_t | value
| ) |  |

Definition at line 138 of file mips-linux-watch.c.

References _, internal_error(), pt_watch_regs::mips32, pt_watch_regs::mips64, pt_watch_style_mips32, pt_watch_style_mips64, pt_watch_regs::style, mips32_watch_regs::watchhi, and mips64_watch_regs::watchhi.

Referenced by mips_linux_watch_populate_regs(), and mips_linux_watch_try_one_watch().

## ◆ mips_linux_watch_set_watchlo()

void mips_linux_watch_set_watchlo | ( | struct pt_watch_regs * | regs,
|  | int | n,
|  | CORE_ADDR | value
| ) |  |

Definition at line 97 of file mips-linux-watch.c.

References _, internal_error(), pt_watch_regs::mips32, pt_watch_regs::mips64, pt_watch_style_mips32, pt_watch_style_mips64, pt_watch_regs::style, mips32_watch_regs::watchlo, and mips64_watch_regs::watchlo.

Referenced by mips_linux_watch_populate_regs(), and mips_linux_watch_try_one_watch().

## ◆ mips_linux_watch_try_one_watch()

int mips_linux_watch_try_one_watch | ( | struct pt_watch_regs * | regs,
|  | CORE_ADDR | addr,
|  | int | len,
|  | uint32_t | irw
| ) |  |

Definition at line 236 of file mips-linux-watch.c.

References fill_mask(), get_reg_mask(), IRW_MASK, mips_linux_watch_get_irw_mask(), mips_linux_watch_get_num_valid(), mips_linux_watch_get_watchhi(), mips_linux_watch_get_watchlo(), mips_linux_watch_set_watchhi(), and mips_linux_watch_set_watchlo().

Referenced by mips_insert_point(), and mips_linux_watch_populate_regs().

## ◆ mips_linux_watch_type_to_irw()

uint32_t mips_linux_watch_type_to_irw | ( | enum target_hw_bp_type | type | ) |

Definition at line 201 of file mips-linux-watch.c.

References hw_access, hw_read, hw_write, R_MASK, and W_MASK.

Referenced by mips_insert_point(), mips_linux_watch_populate_regs(), and mips_stopped_data_address().

## Variable Documentation

## ◆ __attribute__

struct pt_watch_regs __attribute__

## ◆ num_valid

uint32_t num_valid

Definition at line 337 of file mips-linux-watch.h.

Referenced by mips_stopped_by_watchpoint(), and mips_stopped_data_address().

## ◆ watch_masks

uint16_t watch_masks

Definition at line 335 of file mips-linux-watch.h.

## ◆ watchhi

uint16_t watchhi

Definition at line 328 of file mips-linux-watch.h.

## ◆ watchlo

uint64_t watchlo

Definition at line 326 of file mips-linux-watch.h.