aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authornobody <>2004-02-14 00:00:34 +0000
committernobody <>2004-02-14 00:00:34 +0000
commit2f344a4dcd2a8c4297702027a943e3587e6b60c8 (patch)
tree8614f4d9fc669ec37a90e4b4f70b31f00c489661 /gdb/remote.c
parenta5dd37ab655106440e987830db5111b43f271ecc (diff)
downloadgdb-cagney_bfdfile-20040213-branch.zip
gdb-cagney_bfdfile-20040213-branch.tar.gz
gdb-cagney_bfdfile-20040213-branch.tar.bz2
This commit was manufactured by cvs2svn to create branchcagney_bfdfile-20040213-branchpointcagney_bfdfile-20040213-branch
'cagney_bfdfile-20040213-branch'. Sprout from cagney_bigcore-20040122-branch 2004-01-22 00:00:03 UTC nobody 'This commit was manufactured by cvs2svn to create branch' Cherrypick from master 2004-02-14 00:00:33 UTC gdbadmin <gdbadmin@sourceware.org> '*** empty log message ***': COPYING.NEWLIB ChangeLog Makefile.def Makefile.in bfd/ChangeLog bfd/bfd-in.h bfd/bfd-in2.h bfd/bfdio.c bfd/cache.c bfd/coff-h8300.c bfd/config.in bfd/configure bfd/configure.in bfd/elf-bfd.h bfd/elf.c bfd/elf32-arm.h bfd/elf32-frv.c bfd/elf32-h8300.c bfd/elf64-alpha.c bfd/elfxx-ia64.c bfd/elfxx-mips.c bfd/elfxx-mips.h bfd/elfxx-target.h bfd/libbfd-in.h bfd/libbfd.h bfd/version.h binutils/ChangeLog binutils/readelf.c configure configure.in gas/ChangeLog gas/config/tc-arm.c gas/config/tc-ia64.c gas/config/tc-ia64.h gas/config/tc-m68k.c gas/config/tc-m68k.h gas/config/tc-mips.c gas/config/tc-mips.h gas/doc/internals.texi gas/dwarf2dbg.c gas/frags.c gas/frags.h gas/read.c gas/read.h gas/testsuite/ChangeLog gas/testsuite/gas/arm/arm.exp gas/testsuite/gas/arm/undefined.l gas/testsuite/gas/arm/undefined.s gas/testsuite/gas/macros/test2.s gas/testsuite/gas/mips/div.d gas/testsuite/gas/mips/elf-rel-got-n32.d gas/testsuite/gas/mips/elf-rel-got-n64.d gas/testsuite/gas/mips/elf-rel-xgot-n32.d gas/testsuite/gas/mips/elf-rel-xgot-n64.d gas/testsuite/gas/mips/elf-rel19.d gas/testsuite/gas/mips/elf-rel19.s gas/testsuite/gas/mips/la-svr4pic.d gas/testsuite/gas/mips/la-xgot.d gas/testsuite/gas/mips/lca-svr4pic.d gas/testsuite/gas/mips/lca-xgot.d gas/testsuite/gas/mips/macro-warn-1-n32.d gas/testsuite/gas/mips/macro-warn-1-n32.l gas/testsuite/gas/mips/macro-warn-1.d gas/testsuite/gas/mips/macro-warn-1.l gas/testsuite/gas/mips/macro-warn-1.s gas/testsuite/gas/mips/macro-warn-2-n32.d gas/testsuite/gas/mips/macro-warn-2.d gas/testsuite/gas/mips/macro-warn-2.l gas/testsuite/gas/mips/macro-warn-2.s gas/testsuite/gas/mips/macro-warn-3.d gas/testsuite/gas/mips/macro-warn-3.l gas/testsuite/gas/mips/macro-warn-3.s gas/testsuite/gas/mips/macro-warn-4.d gas/testsuite/gas/mips/macro-warn-4.l gas/testsuite/gas/mips/macro-warn-4.s gas/testsuite/gas/mips/mips.exp gas/testsuite/gas/mips/relax-swap1-mips2.d gas/testsuite/gas/mips/relax-swap1.s gas/testsuite/gas/mips/relax-swap2.s gas/testsuite/gas/sh/basic.exp gas/testsuite/gas/sh/err-sh4a-fp.s gas/testsuite/gas/sh/sh4a-fp.d gas/testsuite/gas/sh/sh4a-fp.s gdb/ChangeLog gdb/Makefile.in gdb/NEWS gdb/PROBLEMS gdb/ada-lang.c gdb/alpha-tdep.c gdb/arch-utils.c gdb/arch-utils.h gdb/arm-tdep.c gdb/auxv.c gdb/auxv.h gdb/avr-tdep.c gdb/ax-gdb.c gdb/bcache.c gdb/blockframe.c gdb/breakpoint.c gdb/breakpoint.h gdb/buildsym.c gdb/c-lang.c gdb/cli/cli-cmds.c gdb/cli/cli-decode.c gdb/coffread.c gdb/config/mips/tm-linux.h gdb/config/nm-linux.h gdb/config/sparc/nm-nbsd.h gdb/config/sparc/obsd.mt gdb/config/sparc/obsd64.mt gdb/configure gdb/configure.host gdb/configure.in gdb/configure.tgt gdb/corelow.c gdb/cp-namespace.c gdb/cp-support.c gdb/cp-support.h gdb/cris-tdep.c gdb/d10v-tdep.c gdb/dbxread.c gdb/defs.h gdb/doc/ChangeLog gdb/doc/gdb.texinfo gdb/doc/gdbint.texinfo gdb/doc/stabs.texinfo gdb/dwarf2-frame.c gdb/dwarf2-frame.h gdb/dwarf2loc.c gdb/dwarf2loc.h gdb/dwarf2read.c gdb/dwarfread.c gdb/elfread.c gdb/f-lang.c gdb/findvar.c gdb/frame.c gdb/frame.h gdb/frv-tdep.c gdb/gdb-events.h gdb/gdb-events.sh gdb/gdb_curses.h gdb/gdb_obstack.h gdb/gdbarch.c gdb/gdbarch.h gdb/gdbarch.sh gdb/gdbserver/ChangeLog gdb/gdbserver/linux-low.c gdb/gdbserver/linux-low.h gdb/gdbserver/regcache.c gdb/gdbtypes.c gdb/gdbtypes.h gdb/h8300-tdep.c gdb/hppa-tdep.c gdb/hpread.c gdb/i386-linux-tdep.c gdb/i386-nto-tdep.c gdb/ia64-tdep.c gdb/infcmd.c gdb/infrun.c gdb/inftarg.c gdb/jv-lang.c gdb/language.c gdb/language.h gdb/linespec.c gdb/linux-proc.c gdb/m2-lang.c gdb/m32r-rom.c gdb/m32r-tdep.c gdb/m68hc11-tdep.c gdb/m68k-tdep.c gdb/m68klinux-tdep.c gdb/main.c gdb/mcore-tdep.c gdb/mdebugread.c gdb/mi/mi-cmd-stack.c gdb/mi/mi-cmd-var.c gdb/mi/mi-cmds.h gdb/minsyms.c gdb/mips-linux-nat.c gdb/mips-linux-tdep.c gdb/mips-tdep.c gdb/mn10300-tdep.c gdb/ns32k-tdep.c gdb/objc-lang.c gdb/objfiles.c gdb/objfiles.h gdb/osabi.c gdb/p-lang.c gdb/pa64solib.c gdb/printcmd.c gdb/proc-api.c gdb/procfs.c gdb/regcache.c gdb/remote-fileio.c gdb/remote-rdi.c gdb/remote-sim.c gdb/remote.c gdb/rs6000-tdep.c gdb/s390-tdep.c gdb/scm-lang.c gdb/ser-pipe.c gdb/sh-tdep.c gdb/sh64-tdep.c gdb/sol-thread.c gdb/solib-sunos.c gdb/somread.c gdb/somsolib.c gdb/source.c gdb/sparc-nat.c gdb/sparc-tdep.c gdb/sparc-tdep.h gdb/sparc64-tdep.h gdb/sparc64nbsd-tdep.c gdb/sparc64obsd-tdep.c gdb/sparcnbsd-tdep.c gdb/sparcobsd-tdep.c gdb/stabsread.c gdb/stack.c gdb/symfile.c gdb/symfile.h gdb/symmisc.c gdb/symtab.c gdb/symtab.h gdb/target.h gdb/testsuite/ChangeLog gdb/testsuite/config/sim.exp gdb/testsuite/gdb.arch/gdb1291.c gdb/testsuite/gdb.arch/gdb1431.c gdb/testsuite/gdb.asm/asm-source.exp gdb/testsuite/gdb.asm/ia64.inc gdb/testsuite/gdb.asm/openbsd.inc gdb/testsuite/gdb.base/Makefile.in gdb/testsuite/gdb.base/bang.exp gdb/testsuite/gdb.base/call-ar-st.exp gdb/testsuite/gdb.base/charset.c gdb/testsuite/gdb.base/chng-syms.c gdb/testsuite/gdb.base/chng-syms.exp gdb/testsuite/gdb.base/completion.exp gdb/testsuite/gdb.base/dump.c gdb/testsuite/gdb.base/dump.exp gdb/testsuite/gdb.base/fileio.c gdb/testsuite/gdb.base/finish.exp gdb/testsuite/gdb.base/gcore.exp gdb/testsuite/gdb.base/huge.c gdb/testsuite/gdb.base/huge.exp gdb/testsuite/gdb.base/info-proc.exp gdb/testsuite/gdb.base/langs.exp gdb/testsuite/gdb.base/maint.exp gdb/testsuite/gdb.base/pending.c gdb/testsuite/gdb.base/pending.exp gdb/testsuite/gdb.base/pendshr.c gdb/testsuite/gdb.base/return2.exp gdb/testsuite/gdb.base/shlib-call.exp gdb/testsuite/gdb.cp/ambiguous.exp gdb/testsuite/gdb.cp/annota2.exp gdb/testsuite/gdb.cp/annota3.exp gdb/testsuite/gdb.cp/anon-union.exp gdb/testsuite/gdb.cp/breakpoint.cc gdb/testsuite/gdb.cp/breakpoint.exp gdb/testsuite/gdb.cp/bs15503.cc gdb/testsuite/gdb.cp/casts.exp gdb/testsuite/gdb.cp/class2.cc gdb/testsuite/gdb.cp/classes.exp gdb/testsuite/gdb.cp/cplusfuncs.exp gdb/testsuite/gdb.cp/ctti.exp gdb/testsuite/gdb.cp/cttiadd.cc gdb/testsuite/gdb.cp/cttiadd1.cc gdb/testsuite/gdb.cp/cttiadd2.cc gdb/testsuite/gdb.cp/cttiadd3.cc gdb/testsuite/gdb.cp/demangle.exp gdb/testsuite/gdb.cp/derivation.exp gdb/testsuite/gdb.cp/exception.cc gdb/testsuite/gdb.cp/exception.exp gdb/testsuite/gdb.cp/hang.exp gdb/testsuite/gdb.cp/inherit.exp gdb/testsuite/gdb.cp/local.exp gdb/testsuite/gdb.cp/maint.exp gdb/testsuite/gdb.cp/member-ptr.cc gdb/testsuite/gdb.cp/member-ptr.exp gdb/testsuite/gdb.cp/method.exp gdb/testsuite/gdb.cp/misc.exp gdb/testsuite/gdb.cp/namespace.cc gdb/testsuite/gdb.cp/namespace.exp gdb/testsuite/gdb.cp/namespace1.cc gdb/testsuite/gdb.cp/overload.cc gdb/testsuite/gdb.cp/overload.exp gdb/testsuite/gdb.cp/ovldbreak.exp gdb/testsuite/gdb.cp/psmang.exp gdb/testsuite/gdb.cp/ref-types.exp gdb/testsuite/gdb.cp/rtti.exp gdb/testsuite/gdb.cp/rtti1.cc gdb/testsuite/gdb.cp/templates.exp gdb/testsuite/gdb.cp/userdef.exp gdb/testsuite/gdb.cp/virtfunc.exp gdb/testsuite/gdb.mi/mi-stack.exp gdb/testsuite/gdb.mi/mi-var-child.exp gdb/testsuite/gdb.objc/basicclass.exp gdb/testsuite/gdb.threads/gcore-thread.exp gdb/testsuite/gdb.threads/thread-specific.c gdb/testsuite/gdb.threads/thread-specific.exp gdb/testsuite/lib/compiler.c gdb/testsuite/lib/compiler.cc gdb/testsuite/lib/gdb.exp gdb/tui/tui-command.c gdb/tui/tui-data.c gdb/tui/tui-data.h gdb/tui/tui-disasm.c gdb/tui/tui-file.c gdb/tui/tui-hooks.c gdb/tui/tui-hooks.h gdb/tui/tui-interp.c gdb/tui/tui-io.c gdb/tui/tui-layout.c gdb/tui/tui-layout.h gdb/tui/tui-regs.c gdb/tui/tui-regs.h gdb/tui/tui-source.c gdb/tui/tui-source.h gdb/tui/tui-stack.c gdb/tui/tui-stack.h gdb/tui/tui-win.c gdb/tui/tui-win.h gdb/tui/tui-windata.c gdb/tui/tui-windata.h gdb/tui/tui-wingeneral.c gdb/tui/tui-wingeneral.h gdb/tui/tui-winsource.c gdb/tui/tui-winsource.h gdb/tui/tui.c gdb/tui/tui.h gdb/utils.c gdb/v850-tdep.c gdb/valops.c gdb/values.c gdb/vax-tdep.c gdb/version.in gdb/xcoffread.c gdb/xstormy16-tdep.c include/elf/ChangeLog include/elf/common.h include/opcode/ChangeLog include/opcode/h8300.h ld/ChangeLog ld/emulparams/armelf.sh ld/emulparams/armelf_linux.sh ld/emulparams/elf32bmip.sh ld/emulparams/elf32bmipn32.sh ld/emulparams/elf32btsmipn32.sh ld/emulparams/elf64_ia64.sh ld/emulparams/shlelf_linux.sh ld/emultempl/pe.em ld/genscripts.sh ld/testsuite/ChangeLog ld/testsuite/ld-arm/arm-app-abs32.d ld/testsuite/ld-arm/arm-app-abs32.r ld/testsuite/ld-arm/arm-app-abs32.s ld/testsuite/ld-arm/arm-elf.exp ld/testsuite/ld-h8300/h8300.exp ld/testsuite/ld-h8300/relax-5-coff.d ld/testsuite/ld-h8300/relax-5.d ld/testsuite/ld-h8300/relax-5.s libiberty/ChangeLog libiberty/Makefile.in libiberty/configure libiberty/configure.ac libiberty/getpwd.c libiberty/maint-tool opcodes/ChangeLog opcodes/m32r-dis.c opcodes/sh-opc.h readline/ChangeLog.gdb readline/bind.c readline/mbutil.c readline/readline.c readline/vi_mode.c sim/ChangeLog sim/configure sim/configure.in sim/m32r/ChangeLog sim/m32r/mloop2.in sim/m32r/mloopx.in sim/ppc/ChangeLog sim/ppc/ppc-instructions sim/sh/ChangeLog sim/sh/gencode.c sim/sh/interp.c sim/testsuite/ChangeLog sim/testsuite/lib/sim-defs.exp sim/testsuite/sim/mips/ChangeLog sim/testsuite/sim/mips/basic.exp sim/testsuite/sim/mips/sanity.s sim/testsuite/sim/mips/testutils.inc sim/testsuite/sim/sh/ChangeLog sim/testsuite/sim/sh/allinsn.exp sim/testsuite/sim/sh/and.s sim/testsuite/sim/sh/movi.s sim/testsuite/sim/sh/sett.s sim/testsuite/sim/sh/testutils.inc Delete: gdb/testsuite/gdb.mi/mi1-basics.exp gdb/testsuite/gdb.mi/mi1-break.exp gdb/testsuite/gdb.mi/mi1-console.exp gdb/testsuite/gdb.mi/mi1-disassemble.exp gdb/testsuite/gdb.mi/mi1-eval.exp gdb/testsuite/gdb.mi/mi1-hack-cli.exp gdb/testsuite/gdb.mi/mi1-pthreads.exp gdb/testsuite/gdb.mi/mi1-read-memory.exp gdb/testsuite/gdb.mi/mi1-regs.exp gdb/testsuite/gdb.mi/mi1-return.exp gdb/testsuite/gdb.mi/mi1-simplerun.exp gdb/testsuite/gdb.mi/mi1-stack.exp gdb/testsuite/gdb.mi/mi1-stepi.exp gdb/testsuite/gdb.mi/mi1-symbol.exp gdb/testsuite/gdb.mi/mi1-until.exp gdb/testsuite/gdb.mi/mi1-var-block.exp gdb/testsuite/gdb.mi/mi1-var-child.exp gdb/testsuite/gdb.mi/mi1-var-cmd.exp gdb/testsuite/gdb.mi/mi1-var-display.exp gdb/testsuite/gdb.mi/mi1-watch.exp
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c677
1 files changed, 3 insertions, 674 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 617e55d..99f51a3 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -152,10 +152,6 @@ static void init_remote_ops (void);
static void init_extended_remote_ops (void);
-static void init_remote_cisco_ops (void);
-
-static struct target_ops remote_cisco_ops;
-
static void remote_stop (void);
static int ishex (int ch, int *val);
@@ -373,10 +369,6 @@ static int remote_break;
starts. */
static struct serial *remote_desc = NULL;
-/* This is set by the target (thru the 'S' message)
- to denote that the target is in kernel mode. */
-static int cisco_kernel_mode = 0;
-
/* This variable sets the number of bits in an address that are to be
sent in a memory ("M" or "m") packet. Normally, after stripping
leading zeros, the entire address would be sent. This variable
@@ -1994,123 +1986,6 @@ get_offsets (void)
objfile_relocate (symfile_objfile, offs);
}
-/*
- * Cisco version of section offsets:
- *
- * Instead of having GDB query the target for the section offsets,
- * Cisco lets the target volunteer the information! It's also in
- * a different format, so here are the functions that will decode
- * a section offset packet from a Cisco target.
- */
-
-/*
- * Function: remote_cisco_section_offsets
- *
- * Returns: zero for success, non-zero for failure
- */
-
-static int
-remote_cisco_section_offsets (bfd_vma text_addr,
- bfd_vma data_addr,
- bfd_vma bss_addr,
- bfd_signed_vma *text_offs,
- bfd_signed_vma *data_offs,
- bfd_signed_vma *bss_offs)
-{
- bfd_vma text_base, data_base, bss_base;
- struct minimal_symbol *start;
- asection *sect;
- bfd *abfd;
- int len;
-
- if (symfile_objfile == NULL)
- return -1; /* no can do nothin' */
-
- start = lookup_minimal_symbol ("_start", NULL, NULL);
- if (start == NULL)
- return -1; /* Can't find "_start" symbol */
-
- data_base = bss_base = 0;
- text_base = SYMBOL_VALUE_ADDRESS (start);
-
- abfd = symfile_objfile->obfd;
- for (sect = abfd->sections;
- sect != 0;
- sect = sect->next)
- {
- const char *p = bfd_get_section_name (abfd, sect);
- len = strlen (p);
- if (strcmp (p + len - 4, "data") == 0) /* ends in "data" */
- if (data_base == 0 ||
- data_base > bfd_get_section_vma (abfd, sect))
- data_base = bfd_get_section_vma (abfd, sect);
- if (strcmp (p + len - 3, "bss") == 0) /* ends in "bss" */
- if (bss_base == 0 ||
- bss_base > bfd_get_section_vma (abfd, sect))
- bss_base = bfd_get_section_vma (abfd, sect);
- }
- *text_offs = text_addr - text_base;
- *data_offs = data_addr - data_base;
- *bss_offs = bss_addr - bss_base;
- if (remote_debug)
- {
- char tmp[128];
-
- sprintf (tmp, "VMA: text = 0x");
- sprintf_vma (tmp + strlen (tmp), text_addr);
- sprintf (tmp + strlen (tmp), " data = 0x");
- sprintf_vma (tmp + strlen (tmp), data_addr);
- sprintf (tmp + strlen (tmp), " bss = 0x");
- sprintf_vma (tmp + strlen (tmp), bss_addr);
- fputs_filtered (tmp, gdb_stdlog);
- fprintf_filtered (gdb_stdlog,
- "Reloc offset: text = 0x%s data = 0x%s bss = 0x%s\n",
- paddr_nz (*text_offs),
- paddr_nz (*data_offs),
- paddr_nz (*bss_offs));
- }
-
- return 0;
-}
-
-/*
- * Function: remote_cisco_objfile_relocate
- *
- * Relocate the symbol file for a remote target.
- */
-
-void
-remote_cisco_objfile_relocate (bfd_signed_vma text_off, bfd_signed_vma data_off,
- bfd_signed_vma bss_off)
-{
- struct section_offsets *offs;
-
- if (text_off != 0 || data_off != 0 || bss_off != 0)
- {
- /* FIXME: This code assumes gdb-stabs.h is being used; it's
- broken for xcoff, dwarf, sdb-coff, etc. But there is no
- simple canonical representation for this stuff. */
-
- offs = (struct section_offsets *)
- alloca (SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections));
- memcpy (offs, symfile_objfile->section_offsets,
- SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections));
-
- offs->offsets[SECT_OFF_TEXT (symfile_objfile)] = text_off;
- offs->offsets[SECT_OFF_DATA (symfile_objfile)] = data_off;
- offs->offsets[SECT_OFF_BSS (symfile_objfile)] = bss_off;
-
- /* First call the standard objfile_relocate. */
- objfile_relocate (symfile_objfile, offs);
-
- /* Now we need to fix up the section entries already attached to
- the exec target. These entries will control memory transfers
- from the exec file. */
-
- exec_set_section_offsets (text_off, data_off, bss_off);
- }
-}
-
/* Stub for catch_errors. */
static int
@@ -3097,70 +2972,10 @@ Packet: '%s'\n",
if (buf[3] == 'p')
{
- /* Export Cisco kernel mode as a convenience variable
- (so that it can be used in the GDB prompt if desired). */
-
- if (cisco_kernel_mode == 1)
- set_internalvar (lookup_internalvar ("cisco_kernel_mode"),
- value_from_string ("PDEBUG-"));
- cisco_kernel_mode = 0;
thread_num = strtol ((const char *) &buf[4], NULL, 16);
record_currthread (thread_num);
}
- else if (buf[3] == 'k')
- {
- /* Export Cisco kernel mode as a convenience variable
- (so that it can be used in the GDB prompt if desired). */
-
- if (cisco_kernel_mode == 1)
- set_internalvar (lookup_internalvar ("cisco_kernel_mode"),
- value_from_string ("KDEBUG-"));
- cisco_kernel_mode = 1;
- }
goto got_status;
- case 'N': /* Cisco special: status and offsets */
- {
- bfd_vma text_addr, data_addr, bss_addr;
- bfd_signed_vma text_off, data_off, bss_off;
- unsigned char *p1;
-
- status->kind = TARGET_WAITKIND_STOPPED;
- status->value.sig = (enum target_signal)
- (((fromhex (buf[1])) << 4) + (fromhex (buf[2])));
-
- if (symfile_objfile == NULL)
- {
- warning ("Relocation packet received with no symbol file. \
-Packet Dropped");
- goto got_status;
- }
-
- /* Relocate object file. Buffer format is NAATT;DD;BB
- * where AA is the signal number, TT is the new text
- * address, DD * is the new data address, and BB is the
- * new bss address. */
-
- p = &buf[3];
- text_addr = strtoul (p, (char **) &p1, 16);
- if (p1 == p || *p1 != ';')
- warning ("Malformed relocation packet: Packet '%s'", buf);
- p = p1 + 1;
- data_addr = strtoul (p, (char **) &p1, 16);
- if (p1 == p || *p1 != ';')
- warning ("Malformed relocation packet: Packet '%s'", buf);
- p = p1 + 1;
- bss_addr = strtoul (p, (char **) &p1, 16);
- if (p1 == p)
- warning ("Malformed relocation packet: Packet '%s'", buf);
-
- if (remote_cisco_section_offsets (text_addr, data_addr, bss_addr,
- &text_off, &data_off, &bss_off)
- == 0)
- if (text_off != 0 || data_off != 0 || bss_off != 0)
- remote_cisco_objfile_relocate (text_off, data_off, bss_off);
-
- goto got_status;
- }
case 'W': /* Target exited */
{
/* The remote process exited. */
@@ -3346,70 +3161,10 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
if (buf[3] == 'p')
{
- /* Export Cisco kernel mode as a convenience variable
- (so that it can be used in the GDB prompt if desired). */
-
- if (cisco_kernel_mode == 1)
- set_internalvar (lookup_internalvar ("cisco_kernel_mode"),
- value_from_string ("PDEBUG-"));
- cisco_kernel_mode = 0;
thread_num = strtol ((const char *) &buf[4], NULL, 16);
record_currthread (thread_num);
}
- else if (buf[3] == 'k')
- {
- /* Export Cisco kernel mode as a convenience variable
- (so that it can be used in the GDB prompt if desired). */
-
- if (cisco_kernel_mode == 1)
- set_internalvar (lookup_internalvar ("cisco_kernel_mode"),
- value_from_string ("KDEBUG-"));
- cisco_kernel_mode = 1;
- }
goto got_status;
- case 'N': /* Cisco special: status and offsets */
- {
- bfd_vma text_addr, data_addr, bss_addr;
- bfd_signed_vma text_off, data_off, bss_off;
- unsigned char *p1;
-
- status->kind = TARGET_WAITKIND_STOPPED;
- status->value.sig = (enum target_signal)
- (((fromhex (buf[1])) << 4) + (fromhex (buf[2])));
-
- if (symfile_objfile == NULL)
- {
- warning ("Relocation packet recieved with no symbol file. \
-Packet Dropped");
- goto got_status;
- }
-
- /* Relocate object file. Buffer format is NAATT;DD;BB
- * where AA is the signal number, TT is the new text
- * address, DD * is the new data address, and BB is the
- * new bss address. */
-
- p = &buf[3];
- text_addr = strtoul (p, (char **) &p1, 16);
- if (p1 == p || *p1 != ';')
- warning ("Malformed relocation packet: Packet '%s'", buf);
- p = p1 + 1;
- data_addr = strtoul (p, (char **) &p1, 16);
- if (p1 == p || *p1 != ';')
- warning ("Malformed relocation packet: Packet '%s'", buf);
- p = p1 + 1;
- bss_addr = strtoul (p, (char **) &p1, 16);
- if (p1 == p)
- warning ("Malformed relocation packet: Packet '%s'", buf);
-
- if (remote_cisco_section_offsets (text_addr, data_addr, bss_addr,
- &text_off, &data_off, &bss_off)
- == 0)
- if (text_off != 0 || data_off != 0 || bss_off != 0)
- remote_cisco_objfile_relocate (text_off, data_off, bss_off);
-
- goto got_status;
- }
case 'W': /* Target exited */
{
/* The remote process exited. */
@@ -4250,8 +4005,6 @@ putpkt_binary (char *buf, int cnt)
}
}
-static int remote_cisco_mode;
-
/* Come here after finding the start of the frame. Collect the rest
into BUF, verifying the checksum, length, and handling run-length
compression. No more than sizeof_buf-1 characters are read so that
@@ -4333,24 +4086,9 @@ read_frame (char *buf,
int repeat;
csum += c;
- if (remote_cisco_mode == 0)
- {
- c = readchar (remote_timeout);
- csum += c;
- repeat = c - ' ' + 3; /* Compute repeat count */
- }
- else
- {
- /* Cisco's run-length encoding variant uses two
- hex chars to represent the repeat count. */
-
- c = readchar (remote_timeout);
- csum += c;
- repeat = fromhex (c) << 4;
- c = readchar (remote_timeout);
- csum += c;
- repeat += fromhex (c);
- }
+ c = readchar (remote_timeout);
+ csum += c;
+ repeat = c - ' ' + 3; /* Compute repeat count */
/* The character before ``*'' is repeated. */
@@ -5488,409 +5226,6 @@ Specify the serial device it is connected to (e.g. /dev/ttya).",
extended_remote_ops.to_mourn_inferior = extended_remote_mourn;
}
-/*
- * Command: info remote-process
- *
- * This implements Cisco's version of the "info proc" command.
- *
- * This query allows the target stub to return an arbitrary string
- * (or strings) giving arbitrary information about the target process.
- * This is optional; the target stub isn't required to implement it.
- *
- * Syntax: qfProcessInfo request first string
- * qsProcessInfo request subsequent string
- * reply: 'O'<hex-encoded-string>
- * 'l' last reply (empty)
- */
-
-static void
-remote_info_process (char *args, int from_tty)
-{
- struct remote_state *rs = get_remote_state ();
- char *buf = alloca (rs->remote_packet_size);
-
- if (remote_desc == 0)
- error ("Command can only be used when connected to the remote target.");
-
- putpkt ("qfProcessInfo");
- getpkt (buf, (rs->remote_packet_size), 0);
- if (buf[0] == 0)
- return; /* Silently: target does not support this feature. */
-
- if (buf[0] == 'E')
- error ("info proc: target error.");
-
- while (buf[0] == 'O') /* Capitol-O packet */
- {
- remote_console_output (&buf[1]);
- putpkt ("qsProcessInfo");
- getpkt (buf, (rs->remote_packet_size), 0);
- }
-}
-
-/*
- * Target Cisco
- */
-
-static void
-remote_cisco_open (char *name, int from_tty)
-{
- int ex;
- if (name == 0)
- error ("To open a remote debug connection, you need to specify what \n"
- "device is attached to the remote system (e.g. host:port).");
-
- /* See FIXME above */
- wait_forever_enabled_p = 1;
-
- target_preopen (from_tty);
-
- unpush_target (&remote_cisco_ops);
-
- remote_desc = remote_serial_open (name);
- if (!remote_desc)
- perror_with_name (name);
-
- /*
- * If a baud rate was specified on the gdb command line it will
- * be greater than the initial value of -1. If it is, use it otherwise
- * default to 9600
- */
-
- baud_rate = (baud_rate > 0) ? baud_rate : 9600;
- if (serial_setbaudrate (remote_desc, baud_rate))
- {
- /* The requested speed could not be set. Error out to
- top level after closing remote_desc. Take care to
- set remote_desc to NULL to avoid closing remote_desc
- more than once. */
- serial_close (remote_desc);
- remote_desc = NULL;
- perror_with_name (name);
- }
-
- serial_raw (remote_desc);
-
- /* If there is something sitting in the buffer we might take it as a
- response to a command, which would be bad. */
- serial_flush_input (remote_desc);
-
- if (from_tty)
- {
- puts_filtered ("Remote debugging using ");
- puts_filtered (name);
- puts_filtered ("\n");
- }
-
- remote_cisco_mode = 1;
-
- push_target (&remote_cisco_ops); /* Switch to using cisco target now */
-
- init_all_packet_configs ();
-
- general_thread = -2;
- continue_thread = -2;
-
- /* Probe for ability to use "ThreadInfo" query, as required. */
- use_threadinfo_query = 1;
- use_threadextra_query = 1;
-
- /* Without this, some commands which require an active target (such
- as kill) won't work. This variable serves (at least) double duty
- as both the pid of the target process (if it has such), and as a
- flag indicating that a target is active. These functions should
- be split out into seperate variables, especially since GDB will
- someday have a notion of debugging several processes. */
- inferior_ptid = pid_to_ptid (MAGIC_NULL_PID);
-
- /* Start the remote connection; if error, discard this target. See
- the comments in remote_open_1() for further details such as the
- need to re-throw the exception. */
- ex = catch_exceptions (uiout,
- remote_start_remote_dummy, NULL,
- "Couldn't establish connection to remote"
- " target\n",
- RETURN_MASK_ALL);
- if (ex < 0)
- {
- pop_target ();
- throw_exception (ex);
- }
-}
-
-static void
-remote_cisco_close (int quitting)
-{
- remote_cisco_mode = 0;
- remote_close (quitting);
-}
-
-static void
-remote_cisco_mourn (void)
-{
- remote_mourn_1 (&remote_cisco_ops);
-}
-
-enum
-{
- READ_MORE,
- FATAL_ERROR,
- ENTER_DEBUG,
- DISCONNECT_TELNET
-}
-minitelnet_return;
-
-/* Shared between readsocket() and readtty(). The size is arbitrary,
- however all targets are known to support a 400 character packet. */
-static char tty_input[400];
-
-static int escape_count;
-static int echo_check;
-extern int quit_flag;
-
-static int
-readsocket (void)
-{
- int data;
-
- /* Loop until the socket doesn't have any more data */
-
- while ((data = readchar (0)) >= 0)
- {
- /* Check for the escape sequence */
- if (data == '|')
- {
- /* If this is the fourth escape, get out */
- if (++escape_count == 4)
- {
- return ENTER_DEBUG;
- }
- else
- { /* This is a '|', but not the fourth in a row.
- Continue without echoing it. If it isn't actually
- one of four in a row, it'll be echoed later. */
- continue;
- }
- }
- else
- /* Not a '|' */
- {
- /* Ensure any pending '|'s are flushed. */
-
- for (; escape_count > 0; escape_count--)
- putchar ('|');
- }
-
- if (data == '\r') /* If this is a return character, */
- continue; /* - just supress it. */
-
- if (echo_check != -1) /* Check for echo of user input. */
- {
- if (tty_input[echo_check] == data)
- {
- gdb_assert (echo_check <= sizeof (tty_input));
- echo_check++; /* Character matched user input: */
- continue; /* Continue without echoing it. */
- }
- else if ((data == '\n') && (tty_input[echo_check] == '\r'))
- { /* End of the line (and of echo checking). */
- echo_check = -1; /* No more echo supression */
- continue; /* Continue without echoing. */
- }
- else
- { /* Failed check for echo of user input.
- We now have some suppressed output to flush! */
- int j;
-
- for (j = 0; j < echo_check; j++)
- putchar (tty_input[j]);
- echo_check = -1;
- }
- }
- putchar (data); /* Default case: output the char. */
- }
-
- if (data == SERIAL_TIMEOUT) /* Timeout returned from readchar. */
- return READ_MORE; /* Try to read some more */
- else
- return FATAL_ERROR; /* Trouble, bail out */
-}
-
-static int
-readtty (void)
-{
- int tty_bytecount;
-
- /* First, read a buffer full from the terminal */
- tty_bytecount = read (fileno (stdin), tty_input, sizeof (tty_input) - 1);
- if (tty_bytecount == -1)
- {
- perror ("readtty: read failed");
- return FATAL_ERROR;
- }
-
- /* Remove a quoted newline. */
- if (tty_input[tty_bytecount - 1] == '\n' &&
- tty_input[tty_bytecount - 2] == '\\') /* line ending in backslash */
- {
- tty_input[--tty_bytecount] = 0; /* remove newline */
- tty_input[--tty_bytecount] = 0; /* remove backslash */
- }
-
- /* Turn trailing newlines into returns */
- if (tty_input[tty_bytecount - 1] == '\n')
- tty_input[tty_bytecount - 1] = '\r';
-
- /* If the line consists of a ~, enter debugging mode. */
- if ((tty_input[0] == '~') && (tty_bytecount == 2))
- return ENTER_DEBUG;
-
- /* Make this a zero terminated string and write it out */
- tty_input[tty_bytecount] = 0;
- if (serial_write (remote_desc, tty_input, tty_bytecount))
- {
- perror_with_name ("readtty: write failed");
- return FATAL_ERROR;
- }
-
- return READ_MORE;
-}
-
-static int
-minitelnet (void)
-{
- fd_set input; /* file descriptors for select */
- int tablesize; /* max number of FDs for select */
- int status;
- int quit_count = 0;
-
- escape_count = 0;
- echo_check = -1;
-
- tablesize = 8 * sizeof (input);
-
- for (;;)
- {
- /* Check for anything from our socket - doesn't block. Note that
- this must be done *before* the select as there may be
- buffered I/O waiting to be processed. */
-
- if ((status = readsocket ()) == FATAL_ERROR)
- {
- error ("Debugging terminated by communications error");
- }
- else if (status != READ_MORE)
- {
- return (status);
- }
-
- fflush (stdout); /* Flush output before blocking */
-
- /* Now block on more socket input or TTY input */
-
- FD_ZERO (&input);
- FD_SET (fileno (stdin), &input);
- FD_SET (deprecated_serial_fd (remote_desc), &input);
-
- status = select (tablesize, &input, 0, 0, 0);
- if ((status == -1) && (errno != EINTR))
- {
- error ("Communications error on select %d", errno);
- }
-
- /* Handle Control-C typed */
-
- if (quit_flag)
- {
- if ((++quit_count) == 2)
- {
- if (query ("Interrupt GDB? "))
- {
- printf_filtered ("Interrupted by user.\n");
- throw_exception (RETURN_QUIT);
- }
- quit_count = 0;
- }
- quit_flag = 0;
-
- if (remote_break)
- serial_send_break (remote_desc);
- else
- serial_write (remote_desc, "\003", 1);
-
- continue;
- }
-
- /* Handle console input */
-
- if (FD_ISSET (fileno (stdin), &input))
- {
- quit_count = 0;
- echo_check = 0;
- status = readtty ();
- if (status == READ_MORE)
- continue;
-
- return status; /* telnet session ended */
- }
- }
-}
-
-static ptid_t
-remote_cisco_wait (ptid_t ptid, struct target_waitstatus *status)
-{
- if (minitelnet () != ENTER_DEBUG)
- {
- error ("Debugging session terminated by protocol error");
- }
- putpkt ("?");
- return remote_wait (ptid, status);
-}
-
-static void
-init_remote_cisco_ops (void)
-{
- remote_cisco_ops.to_shortname = "cisco";
- remote_cisco_ops.to_longname = "Remote serial target in cisco-specific protocol";
- remote_cisco_ops.to_doc =
- "Use a remote machine via TCP, using a cisco-specific protocol.\n\
-Specify the serial device it is connected to (e.g. host:2020).";
- remote_cisco_ops.to_open = remote_cisco_open;
- remote_cisco_ops.to_close = remote_cisco_close;
- remote_cisco_ops.to_detach = remote_detach;
- remote_cisco_ops.to_disconnect = remote_disconnect;
- remote_cisco_ops.to_resume = remote_resume;
- remote_cisco_ops.to_wait = remote_cisco_wait;
- remote_cisco_ops.to_fetch_registers = remote_fetch_registers;
- remote_cisco_ops.to_store_registers = remote_store_registers;
- remote_cisco_ops.to_prepare_to_store = remote_prepare_to_store;
- remote_cisco_ops.to_xfer_memory = remote_xfer_memory;
- remote_cisco_ops.to_files_info = remote_files_info;
- remote_cisco_ops.to_insert_breakpoint = remote_insert_breakpoint;
- remote_cisco_ops.to_remove_breakpoint = remote_remove_breakpoint;
- remote_cisco_ops.to_remove_hw_breakpoint = remote_remove_hw_breakpoint;
- remote_cisco_ops.to_insert_hw_breakpoint = remote_insert_hw_breakpoint;
- remote_cisco_ops.to_insert_watchpoint = remote_insert_watchpoint;
- remote_cisco_ops.to_remove_watchpoint = remote_remove_watchpoint;
- remote_cisco_ops.to_stopped_by_watchpoint = remote_stopped_by_watchpoint;
- remote_cisco_ops.to_stopped_data_address = remote_stopped_data_address;
- remote_cisco_ops.to_can_use_hw_breakpoint = remote_check_watch_resources;
- remote_cisco_ops.to_kill = remote_kill;
- remote_cisco_ops.to_load = generic_load;
- remote_cisco_ops.to_mourn_inferior = remote_cisco_mourn;
- remote_cisco_ops.to_thread_alive = remote_thread_alive;
- remote_cisco_ops.to_find_new_threads = remote_threads_info;
- remote_cisco_ops.to_pid_to_str = remote_pid_to_str;
- remote_cisco_ops.to_extra_thread_info = remote_threads_extra_info;
- remote_cisco_ops.to_stratum = process_stratum;
- remote_cisco_ops.to_has_all_memory = 1;
- remote_cisco_ops.to_has_memory = 1;
- remote_cisco_ops.to_has_stack = 1;
- remote_cisco_ops.to_has_registers = 1;
- remote_cisco_ops.to_has_execution = 1;
- remote_cisco_ops.to_magic = OPS_MAGIC;
-}
-
static int
remote_can_async_p (void)
{
@@ -6087,9 +5422,6 @@ _initialize_remote (void)
init_extended_async_remote_ops ();
add_target (&extended_async_remote_ops);
- init_remote_cisco_ops ();
- add_target (&remote_cisco_ops);
-
/* Hook into new objfile notification. */
remote_new_objfile_chain = target_new_objfile_hook;
target_new_objfile_hook = remote_new_objfile;
@@ -6203,9 +5535,6 @@ in a memory packet.\n",
&showlist);
#endif
- add_info ("remote-process", remote_info_process,
- "Query the remote system for process info.");
-
add_packet_config_cmd (&remote_protocol_vcont,
"vCont", "verbose-resume",
set_remote_protocol_vcont_packet_cmd,