1999-04-16 09:35:26 +08:00
|
|
|
/* Definitions for the Macraigor Systems BDM Wiggler
|
2005-12-18 06:34:03 +08:00
|
|
|
Copyright (C) 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
This file is part of GDB.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2005-12-18 06:34:03 +08:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
#ifndef OCD_H
|
|
|
|
#define OCD_H
|
|
|
|
|
2003-04-12 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh: Add missing opaque declarations.
* gdbarch.h: Regnerate.
* symtab.h: Add missing opaque declarations.
* value.h, target.h, symfile.h, stabsread.h: Ditto.
* x86-64-tdep.h, xmodem.h, monitor.h, typeprint.h: Ditto.
* srec.h, solib-svr4.h, source.h, inferior.h: Ditto.
* ser-unix.h, serial.h, remote-utils.h, gdbcore.h: Ditto.
* ppc-tdep.h, ocd.h, mips-tdep.h, gdbtypes.h: Ditto.
* buildsym.h, builtin-regs.h, linespec.h, language.h: Ditto.
* i387-tdep.h, gdbthread.h, event-top.h, gdb.h: Ditto.
* dwarf2cfi.h, doublest.h, disasm.h, cp-abi.h: Ditto.
* cli-out.h, c-lang.h, ax-gdb.h, arch-utils.h: Ditto.
* ada-lang.h, config/nm-lynx.h, config/nm-linux.h: Ditto.
* config/sparc/tm-sp64.h, config/rs6000/tm-rs6000.h: Ditto.
* config/pa/tm-hppah.h, config/m68k/tm-delta68.h: Ditto.
* cli/cli-setshow.h, cli/cli-script.h: Ditto.
2003-04-13 01:41:26 +08:00
|
|
|
struct mem_attrib;
|
|
|
|
struct target_ops;
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
/* Wiggler serial protocol definitions */
|
|
|
|
|
|
|
|
#define DLE 020 /* Quote char */
|
|
|
|
#define SYN 026 /* Start of packet */
|
1999-07-08 04:19:36 +08:00
|
|
|
#define RAW_SYN ((026 << 8) | 026) /* get_quoted_char found a naked SYN */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
/* Status flags */
|
|
|
|
|
|
|
|
#define OCD_FLAG_RESET 0x01 /* Target is being reset */
|
|
|
|
#define OCD_FLAG_STOPPED 0x02 /* Target is halted */
|
|
|
|
#define OCD_FLAG_BDM 0x04 /* Target is in BDM */
|
|
|
|
#define OCD_FLAG_PWF 0x08 /* Power failed */
|
1999-07-08 04:19:36 +08:00
|
|
|
#define OCD_FLAG_CABLE_DISC 0x10 /* BDM cable disconnected */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
/* Commands */
|
|
|
|
|
|
|
|
#define OCD_AYT 0x0 /* Are you there? */
|
|
|
|
#define OCD_GET_VERSION 0x1 /* Get Version */
|
|
|
|
#define OCD_SET_BAUD_RATE 0x2 /* Set Baud Rate */
|
|
|
|
#define OCD_INIT 0x10 /* Initialize Wiggler */
|
|
|
|
#define OCD_SET_SPEED 0x11 /* Set Speed */
|
1999-07-08 04:19:36 +08:00
|
|
|
#define OCD_GET_STATUS_MASK 0x12 /* Get Status Mask */
|
1999-04-16 09:35:26 +08:00
|
|
|
#define OCD_GET_CTRS 0x13 /* Get Error Counters */
|
|
|
|
#define OCD_SET_FUNC_CODE 0x14 /* Set Function Code */
|
|
|
|
#define OCD_SET_CTL_FLAGS 0x15 /* Set Control Flags */
|
|
|
|
#define OCD_SET_BUF_ADDR 0x16 /* Set Register Buffer Address */
|
|
|
|
#define OCD_RUN 0x20 /* Run Target from PC */
|
|
|
|
#define OCD_RUN_ADDR 0x21 /* Run Target from Specified Address */
|
|
|
|
#define OCD_STOP 0x22 /* Stop Target */
|
|
|
|
#define OCD_RESET_RUN 0x23 /* Reset Target and Run */
|
|
|
|
#define OCD_RESET 0x24 /* Reset Target and Halt */
|
|
|
|
#define OCD_STEP 0x25 /* Single step */
|
|
|
|
#define OCD_READ_REGS 0x30 /* Read Registers */
|
|
|
|
#define OCD_WRITE_REGS 0x31 /* Write Registers */
|
|
|
|
#define OCD_READ_MEM 0x32 /* Read Memory */
|
|
|
|
#define OCD_WRITE_MEM 0x33 /* Write Memory */
|
|
|
|
#define OCD_FILL_MEM 0x34 /* Fill Memory */
|
|
|
|
#define OCD_MOVE_MEM 0x35 /* Move Memory */
|
|
|
|
|
|
|
|
#define OCD_READ_INT_MEM 0x80 /* Read Internal Memory */
|
|
|
|
#define OCD_WRITE_INT_MEM 0x81 /* Write Internal Memory */
|
|
|
|
#define OCD_JUMP 0x82 /* Jump to Subroutine */
|
|
|
|
|
|
|
|
#define OCD_ERASE_FLASH 0x90 /* Erase flash memory */
|
|
|
|
#define OCD_PROGRAM_FLASH 0x91 /* Write flash memory */
|
|
|
|
#define OCD_EXIT_MON 0x93 /* Exit the flash programming monitor */
|
|
|
|
#define OCD_ENTER_MON 0x94 /* Enter the flash programming monitor */
|
|
|
|
|
|
|
|
#define OCD_SET_STATUS 0x0a /* Set status */
|
|
|
|
#define OCD_SET_CONNECTION 0xf0 /* Set connection (init Wigglers.dll) */
|
|
|
|
#define OCD_LOG_FILE 0xf1 /* Cmd to get Wigglers.dll to log cmds */
|
|
|
|
#define OCD_FLAG_STOP 0x0 /* Stop the target, enter BDM */
|
|
|
|
#define OCD_FLAG_START 0x01 /* Start the target at PC */
|
1999-07-08 04:19:36 +08:00
|
|
|
#define OCD_FLAG_RETURN_STATUS 0x04 /* Return async status */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
/* Target type (for OCD_INIT command) */
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
enum ocd_target_type
|
|
|
|
{
|
|
|
|
OCD_TARGET_CPU32 = 0x0, /* Moto cpu32 family */
|
|
|
|
OCD_TARGET_CPU16 = 0x1,
|
|
|
|
OCD_TARGET_MOTO_PPC = 0x2, /* Motorola PPC 5xx/8xx */
|
|
|
|
OCD_TARGET_IBM_PPC = 0x3
|
|
|
|
}; /* IBM PPC 4xx */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
void ocd_open (char *name, int from_tty, enum ocd_target_type,
|
|
|
|
struct target_ops *ops);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
void ocd_close (int quitting);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
void ocd_detach (char *args, int from_tty);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2001-05-04 12:15:33 +08:00
|
|
|
void ocd_resume (ptid_t ptid, int step, enum target_signal siggnal);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
void ocd_prepare_to_store (void);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
void ocd_stop (void);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
void ocd_files_info (struct target_ops *ignore);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
int ocd_xfer_memory (CORE_ADDR memaddr, char *myaddr,
|
2001-03-06 00:38:07 +08:00
|
|
|
int len, int should_write,
|
|
|
|
struct mem_attrib *attrib,
|
|
|
|
struct target_ops *target);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
void ocd_mourn (void);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2004-05-25 22:58:31 +08:00
|
|
|
void ocd_create_inferior (char *exec_file, char *args, char **env,
|
|
|
|
int from_tty);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2001-05-04 12:15:33 +08:00
|
|
|
int ocd_thread_alive (ptid_t th);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
void ocd_error (char *s, int error_code);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
void ocd_kill (void);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
void ocd_load (char *args, int from_tty);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
unsigned char *ocd_read_bdm_registers (int first_bdm_regno,
|
|
|
|
int last_bdm_regno, int *reglen);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
CORE_ADDR ocd_read_bdm_register (int bdm_regno);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
void ocd_write_bdm_registers (int first_bdm_regno,
|
|
|
|
unsigned char *regptr, int reglen);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
void ocd_write_bdm_register (int bdm_regno, CORE_ADDR reg);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
int ocd_wait (void);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
gdb/
* breakpoint.c (deprecated_read_memory_nobpt): Update to use
shadow_len.
(insert_bp_location, reattach_breakpoints, remove_breakpoint)
(delete_breakpoint): Update calls to changed methods.
(deprecated_insert_raw_breakpoint, deprecated_remove_raw_breakpoint)
(single_step_breakpoints, insert_single_step_breakpoint)
(remove_single_step_breakpoints): New.
* breakpoint.h (struct bp_target_info): New.
(struct bp_location): Replace shadow_contents with
target_info and overlay_target_info.
(deprecated_insert_raw_breakpoint, deprecated_remove_raw_breakpoint)
(insert_single_step_breakpoint, remove_single_step_breakpoints): New
prototypes.
* gdbarch.sh: Forward declare struct bp_target_info in gdbarch.h.
(memory_insert_breakpoint, memory_remove_breakpoint): Update second
argument.
* mem-break.c (default_memory_insert_breakpoint): Update. Set
placed_address, placed_size, and shadow_len.
(default_memory_remove_breakpoint): Update. Don't use
BREAKPOINT_FROM_PC.
(memory_insert_breakpoint, memory_remove_breakpoint): Update.
* target.c (update_current_target): Update prototypes for changed
functions.
(debug_to_insert_breakpoint, debug_to_remove_breakpoint)
(debug_to_insert_hw_breakpoint, debug_to_remove_hw_breakpoint):
Update.
* target.h: Forward declare struct bp_target_info.
(struct target_ops): Use a bp_target_info argument for
to_insert_breakpoint, to_remove_breakpoint,
to_insert_hw_breakpoint, and to_remove_hw_breakpoint.
(target_insert_breakpoint, target_remove_breakpoint)
(target_insert_hw_breakpoint, target_remove_hw_breakpoint)
(memory_insert_breakpoint, memory_remove_breakpoint)
(default_memory_insert_breakpoint, default_memory_remove_breakpoint):
Update.
* config/i386/nm-i386.h: Forward declare struct bp_target_info.
(i386_insert_hw_breakpoint, i386_remove_hw_breakpoint): Update.
(target_insert_hw_breakpoint, target_remove_hw_breakpoint): Likewise.
* gdbarch.c, gdbarch.h: Regenerated.
* alpha-tdep.c (alpha_software_single_step): Use
insert_single_step_breakpoint and remove_single_step_breakpoints.
Remove unused statics.
* arm-tdep.c (arm_software_single_step): Likewise. Add a note.
* cris-tdep.c (cris_software_single_step): Likewise.
* mips-tdep.c (mips_software_single_step): Likewise.
* rs6000-tdep.c (rs6000_software_single_step): Likewise.
* sparc-tdep.c (sparc_software_single_step): Likewise.
* wince.c (struct thread_info_struct): Remove step_prev.
(undoSStep): Use remove_single_step_breakpoints.
(wince_software_single_step): Use insert_single_step_breakpoint.
* corelow.c (ignore): Remove unneeded prototype. Update arguments.
* exec.c (ignore): Likewise.
* sol-thread.c (ignore): Likewise.
* procfs.c (dbx_link_shadow_contents): Delete.
(dbx_link_bpt): New.
(procfs_mourn_inferior): Remove it if necessary.
(remove_dbx_link_breakpoint): Use it.
(insert_dbx_link_bpt_in_file): Set it.
(procfs_init_inferior): Don't update dbx_link_bpt_addr.
* rs6000-nat.c (exec_one_dummy_insn): Use
deprecated_insert_raw_breakpoint and
deprecated_remove_raw_breakpoint.
* solib-irix.c (shadow_contents, breakpoint_addr): Delete.
(base_breakpoint): New.
(disable_break): Use it.
(enable_break): Set it.
* i386-nat.c (i386_insert_hw_breakpoint, i386_remove_hw_breakpoint):
Update.
* ia64-tdep.c (ia64_memory_insert_breakpoint)
(ia64_memory_remove_breakpoint): Likewise.
* m32r-tdep.c (m32r_memory_insert_breakpoint)
(m32r_memory_remove_breakpoint): Likewise.
* monitor.c (monitor_insert_breakpoint, monitor_remove_breakpoint):
Likewise. Remove unnecessary prototypes. Use placed_address
and placed_size. Removed useless read from memory.
* nto-procfs.c (procfs_insert_breakpoint)
(procfs_remove_breakpoint, procfs_insert_hw_breakpoint)
(procfs_remove_hw_breakpoint): Update.
* ocd.c (ocd_insert_breakpoint, ocd_remove_breakpoint): Likewise.
* ocd.h (ocd_insert_breakpoint, ocd_remove_breakpoint): Likewise.
* ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint): Likewise.
* ppc-tdep.h (ppc_linux_memory_remove_breakpoint): Likewise.
* remote-e7000.c (e7000_insert_breakpoint)
(e7000_remove_breakpoint): Likewise.
* remote-m32r-sdi.c (m32r_insert_breakpoint)
(m32r_remove_breakpoint): Likewise.
* remote-mips.c (mips_insert_breakpoint)
(mips_remove_breakpoint): Likewise.
* remote-rdp.c (remote_rdp_insert_breakpoint)
(remote_rdp_remove_breakpoint): Likewise.
(rdp_step): Use deprecated_insert_raw_breakpoint and
deprecated_remove_raw_breakpoint.
* remote-sds.c (sds_insert_breakpoint, sds_remove_breakpoint):
Update.
* remote-sim.c (gdbsim_insert_breakpoint, gdbsim_remove_breakpoint):
Delete.
(init_gdbsim_ops): Use memory_insert_breakpoint and
memory_remove_breakpoint.
* remote-st.c (st2000_insert_breakpoint)
(st2000_remove_breakpoint): Update. Remove unused
BREAKPOINT_FROM_PC.
* remote.c (remote_insert_breakpoint, remote_remove_breakpoint):
Update. Use placed_address and placed_size.
(remote_insert_hw_breakpoint, remote_remove_hw_breakpoint): Likewise.
gdb/doc/
* gdbint.texinfo (x86 Watchpoints, Target Conditionals): Update insert
and remove breakpoint prototypes.
(Watchpoints): Move description of target_insert_hw_breakpoint and
target_remove_hw_breakpoint ...
(Breakpoints): ... to here. Document target_insert_breakpoint and
target_remove_breakpoint.
2006-04-19 03:20:08 +08:00
|
|
|
int ocd_insert_breakpoint (struct bp_target_info *bp_tgt);
|
|
|
|
int ocd_remove_breakpoint (struct bp_target_info *bp_tgt);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
int ocd_write_bytes (CORE_ADDR memaddr, char *myaddr, int len);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
#endif /* OCD_H */
|