RE: symbolic debug of loadable modules with kgdb light

Caz Yokoyama
2009-10-01T04:51:42Z

[-- Attachment #1: Type: text/plain, Size: 2874 bytes --]

How about this?
I am not familiar with texinfo.
-caz

-----Original Message-----
From: Eli Zaretskii [mailto:eliz@gnu.org]
Sent: Wednesday, September 30, 2009 9:11 PM
To: Caz Yokoyama
Cc: brobecker@adacore.com; pedro@codesourcery.com;
gdb-patches@sourceware.org
Subject: Re: symbolic debug of loadable modules with kgdb light

> From: Caz Yokoyama <cazyokoyama@gmail.com>
> Cc: <pedro@codesourcery.com>,
> <gdb-patches@sourceware.org>
> Date: Wed, 30 Sep 2009 20:48:37 -0700
>
> Hello Joel and Eli,
> Here is the patch which integrates your inputs. Even though I carefully
look
> through your inputs, there may be missing. Let me know if you find.

Thanks.

> --- gdb/NEWS 15 Sep 2009 03:30:04 -0000 1.331
> +++ gdb/NEWS 1 Oct 2009 03:32:18 -0000
> @@ -3,6 +3,9 @@
>
> *** Changes since GDB 6.8
>
> +* "set/show remotebreak" command is deprecated. Use "set/show remote
> +interrupt-sequence" instead.

I'd prefer this to be in the "New commands" section, even though it is
not strictly speaking a new command.

> +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g]
> +show remote interrupt-sequence
> + Allow the user to select one of ^C, a break or Magic SysRq g as the
> + sequence to the remote target in order to interrupt the execution.
> + Ctrl-C is a default. Some system prefers BREAK which is high level of
> + serial line for some certain time. Linux kernel prefers SysRq-g, a.k.a
> + Magic SysRq. It is BREAK signal and character 'g'.
^^
Still one space.

> - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\
> -Set whether to send break if interrupted."), _("\
> -Show whether to send break if interrupted."), _("\
> + add_setshow_boolean_cmd ("remotebreak", class_obscure, &remote_break,
_("\
> +Deprecated. Use \"set remote interrupt-sequence [control-c|break]\"
instead."), _("\
> +Deprecated. Use \"show remote interrupt-sequence\" instead."), _("\

You cannot have periods in the first line of the command's doc
string.

> +@item set remote interrupt-sequence
> +@cindex interrupt remote programs
> +@cindex select Ctrl-C, BREAK or SysRq-g
> +Allow the user to specify what sequence @value{GDBN} sends to the remote
target
> +when you type @samp{Ctrl-c} to interrupt the program running
> +on the remote target. Although @samp{Ctrl-C} is usually
> +what remote systems expect (this is the default, here), it is
> +sometimes preferable to send a @code{BREAK}. When debugging the Linux
kernel,
> +a @code{BREAK} followed by @code{g}, which is
> +Magic SysRq g is required in order to interrupt the execution.

Sorry, this still doesn't say what can be given to "set remote
interrupt-sequence" to set the sequence, and does not clearly state
the list of supported alternatives.

> +Specify whether interrupt_sequence is sent
^^^^^^^^^^^^^^^^^^
Why do you use an underscore here?

[-- Attachment #2: remotebreak.patch --]
[-- Type: application/octet-stream, Size: 37785 bytes --]

? cscope.out
? serdep.tmp
? bfd/.deps
? bfd/.libs
? bfd/Makefile
? bfd/aout32.lo
? bfd/archive.lo
? bfd/archive64.lo
? bfd/archures.lo
? bfd/bfd-in3.h
? bfd/bfd.h
? bfd/bfd.lo
? bfd/bfd_stdint.h
? bfd/bfdio.lo
? bfd/bfdver.h
? bfd/bfdwin.lo
? bfd/binary.lo
? bfd/cache.lo
? bfd/coffgen.lo
? bfd/cofflink.lo
? bfd/compress.lo
? bfd/config.cache
? bfd/config.h
? bfd/config.log
? bfd/config.status
? bfd/corefile.lo
? bfd/cpu-i386.lo
? bfd/cpu-l1om.lo
? bfd/dwarf1.lo
? bfd/dwarf2.lo
? bfd/elf-attrs.lo
? bfd/elf-eh-frame.lo
? bfd/elf-ifunc.lo
? bfd/elf-strtab.lo
? bfd/elf-vxworks.lo
? bfd/elf.lo
? bfd/elf32-gen.lo
? bfd/elf32-i386.lo
? bfd/elf32-target.h
? bfd/elf32.lo
? bfd/elf64-gen.lo
? bfd/elf64-target.h
? bfd/elf64-x86-64.lo
? bfd/elf64.lo
? bfd/elflink.lo
? bfd/format.lo
? bfd/hash.lo
? bfd/i386linux.lo
? bfd/ihex.lo
? bfd/init.lo
? bfd/libbfd.la
? bfd/libbfd.lo
? bfd/libtool
? bfd/libtool-soversion
? bfd/linker.lo
? bfd/merge.lo
? bfd/ofiles
? bfd/opncls.lo
? bfd/pei-i386.lo
? bfd/pei-x86_64.lo
? bfd/peigen.c
? bfd/peigen.lo
? bfd/pex64igen.c
? bfd/pex64igen.lo
? bfd/reloc.lo
? bfd/section.lo
? bfd/simple.lo
? bfd/srec.lo
? bfd/stab-syms.lo
? bfd/stabs.lo
? bfd/stamp-h1
? bfd/stamp-lib
? bfd/stamp-ofiles
? bfd/stmp-bfd-h
? bfd/syms.lo
? bfd/targets.lo
? bfd/targmatch.h
? bfd/tekhex.lo
? bfd/verilog.lo
? bfd/doc/Makefile
? bfd/doc/aoutx.texi
? bfd/doc/archive.texi
? bfd/doc/archures.texi
? bfd/doc/bfd.info
? bfd/doc/bfdio.texi
? bfd/doc/bfdt.texi
? bfd/doc/bfdver.texi
? bfd/doc/bfdwin.texi
? bfd/doc/cache.texi
? bfd/doc/chew
? bfd/doc/coffcode.texi
? bfd/doc/core.texi
? bfd/doc/elf.texi
? bfd/doc/elfcode.texi
? bfd/doc/format.texi
? bfd/doc/hash.texi
? bfd/doc/init.texi
? bfd/doc/libbfd.texi
? bfd/doc/linker.texi
? bfd/doc/mmo.texi
? bfd/doc/opncls.texi
? bfd/doc/reloc.texi
? bfd/doc/section.texi
? bfd/doc/syms.texi
? bfd/doc/targets.texi
? bfd/po/BLD-POTFILES
? bfd/po/Makefile
? bfd/po/Makefile.in
? bfd/po/SRC-POTFILES
? etc/Makefile
? etc/config.cache
? etc/config.status
? etc/configure.info
? etc/standards.info
? gdb/.deps
? gdb/.gdbinit
? gdb/.remote.c-00
? gdb/ChangeLog-00
? gdb/ChangeLog-01
? gdb/Makefile
? gdb/ada-exp.c
? gdb/ada-lex.c
? gdb/c-exp.c
? gdb/config.cache
? gdb/config.h
? gdb/config.log
? gdb/config.status
? gdb/cp-name-parser.c
? gdb/f-exp.c
? gdb/gdb
? gdb/gdbtui
? gdb/init.c
? gdb/jv-exp.c
? gdb/m2-exp.c
? gdb/objc-exp.c
? gdb/observer.h
? gdb/observer.inc
? gdb/p-exp.c
? gdb/remote.c-00
? gdb/remote.c-01
? gdb/remote.c-02
? gdb/remote.h-00
? gdb/remote.h-01
? gdb/solib-svr4.c-00
? gdb/stZSyur3
? gdb/stamp-h
? gdb/stamp-h1
? gdb/stamp-xml
? gdb/stqYjWZH
? gdb/symfile.c-00
? gdb/symfile.c-01
? gdb/symfile.c-02
? gdb/symfile.c-03
? gdb/version.c
? gdb/xml-builtin.c
? gdb/doc/ChangeLog-00
? gdb/doc/GDBvn.texi
? gdb/doc/Makefile
? gdb/doc/annotate.info
? gdb/doc/annotate.pdf
? gdb/doc/config.log
? gdb/doc/config.status
? gdb/doc/gdb.aux
? gdb/doc/gdb.bt
? gdb/doc/gdb.cp
? gdb/doc/gdb.cps
? gdb/doc/gdb.fn
? gdb/doc/gdb.info
? gdb/doc/gdb.info-1
? gdb/doc/gdb.info-2
? gdb/doc/gdb.info-3
? gdb/doc/gdb.info-4
? gdb/doc/gdb.info-5
? gdb/doc/gdb.ky
? gdb/doc/gdb.log
? gdb/doc/gdb.pdf
? gdb/doc/gdb.pg
? gdb/doc/gdb.pgs
? gdb/doc/gdb.texinfo-00
? gdb/doc/gdb.toc
? gdb/doc/gdb.tp
? gdb/doc/gdb.vr
? gdb/doc/gdbint.info
? gdb/doc/gdbint.info-1
? gdb/doc/gdbint.info-2
? gdb/doc/gdbint.pdf
? gdb/doc/refcard.pdf
? gdb/doc/stabs.info
? gdb/doc/stabs.pdf
? gdb/gdbserver/Makefile
? gdb/gdbserver/config.h
? gdb/gdbserver/config.log
? gdb/gdbserver/config.status
? gdb/gdbserver/gdbreplay
? gdb/gdbserver/gdbserver
? gdb/gdbserver/reg-i386-linux.c
? gdb/gdbserver/reg-x86-64-linux.c
? gdb/gdbserver/stamp-h
? gdb/gdbserver/version.c
? gdb/gnulib/.deps
? gdb/gnulib/Makefile
? gdb/gnulib/string.h
? gdb/testsuite/.gdb_history
? gdb/testsuite/Makefile
? gdb/testsuite/bigcore.corefile
? gdb/testsuite/cell20277-spu.c
? gdb/testsuite/cell20277.c
? gdb/testsuite/cell25846-spu.c
? gdb/testsuite/cell25846.c
? gdb/testsuite/cell8669-spu.c
? gdb/testsuite/cell8669.c
? gdb/testsuite/cell9747-spu.c
? gdb/testsuite/cell9747.c
? gdb/testsuite/config.log
? gdb/testsuite/config.status
? gdb/testsuite/copy1.txt
? gdb/testsuite/foobar.baz
? gdb/testsuite/gdb.base1
? gdb/testsuite/gdb.base2
? gdb/testsuite/gdb.log
? gdb/testsuite/gdb.sum
? gdb/testsuite/site.exp
? gdb/testsuite/tracecommandsscript
? gdb/testsuite/gdb.ada/Makefile
? gdb/testsuite/gdb.ada/gdb.log
? gdb/testsuite/gdb.ada/gdb.sum
? gdb/testsuite/gdb.arch/Makefile
? gdb/testsuite/gdb.arch/amd64-disp-step
? gdb/testsuite/gdb.arch/amd64-i386-address
? gdb/testsuite/gdb.arch/gdb.log
? gdb/testsuite/gdb.arch/gdb.sum
? gdb/testsuite/gdb.arch/i386-permbkpt
? gdb/testsuite/gdb.arch/i386-signal
? gdb/testsuite/gdb.arch/i386-sse
? gdb/testsuite/gdb.asm/Makefile
? gdb/testsuite/gdb.asm/asm-source
? gdb/testsuite/gdb.asm/gdb.log
? gdb/testsuite/gdb.asm/gdb.sum
? gdb/testsuite/gdb.base/.build-id
? gdb/testsuite/gdb.base/.debug
? gdb/testsuite/gdb.base/Makefile
? gdb/testsuite/gdb.base/a2-run
? gdb/testsuite/gdb.base/advance
? gdb/testsuite/gdb.base/all-types
? gdb/testsuite/gdb.base/annota1
? gdb/testsuite/gdb.base/annota1-watch_thread_num
? gdb/testsuite/gdb.base/annota3
? gdb/testsuite/gdb.base/args
? gdb/testsuite/gdb.base/arrayidx
? gdb/testsuite/gdb.base/async
? gdb/testsuite/gdb.base/attach
? gdb/testsuite/gdb.base/attach2
? gdb/testsuite/gdb.base/auxv
? gdb/testsuite/gdb.base/auxv.gcore
? gdb/testsuite/gdb.base/bang!
? gdb/testsuite/gdb.base/bfp-test
? gdb/testsuite/gdb.base/bigcore
? gdb/testsuite/gdb.base/bigcore.corefile
? gdb/testsuite/gdb.base/bitfields
? gdb/testsuite/gdb.base/bitfields2
? gdb/testsuite/gdb.base/break
? gdb/testsuite/gdb.base/break-always
? gdb/testsuite/gdb.base/breako2
? gdb/testsuite/gdb.base/breakpoint-shadow
? gdb/testsuite/gdb.base/call-ar-st
? gdb/testsuite/gdb.base/call-rt-st
? gdb/testsuite/gdb.base/call-sc-tc
? gdb/testsuite/gdb.base/call-sc-td
? gdb/testsuite/gdb.base/call-sc-te
? gdb/testsuite/gdb.base/call-sc-tf
? gdb/testsuite/gdb.base/call-sc-ti
? gdb/testsuite/gdb.base/call-sc-tl
? gdb/testsuite/gdb.base/call-sc-tld
? gdb/testsuite/gdb.base/call-sc-tll
? gdb/testsuite/gdb.base/call-sc-ts
? gdb/testsuite/gdb.base/call-signals
? gdb/testsuite/gdb.base/call-strs
? gdb/testsuite/gdb.base/callexit
? gdb/testsuite/gdb.base/callfuncs
? gdb/testsuite/gdb.base/catch-syscall
? gdb/testsuite/gdb.base/charset
? gdb/testsuite/gdb.base/checkpoint
? gdb/testsuite/gdb.base/chng-syms
? gdb/testsuite/gdb.base/commands
? gdb/testsuite/gdb.base/compl-uNiQuEdIr
? gdb/testsuite/gdb.base/complex
? gdb/testsuite/gdb.base/consecutive
? gdb/testsuite/gdb.base/constvars
? gdb/testsuite/gdb.base/corefile
? gdb/testsuite/gdb.base/coremaker
? gdb/testsuite/gdb.base/cursal
? gdb/testsuite/gdb.base/cvexpr
? gdb/testsuite/gdb.base/dbx-test
? gdb/testsuite/gdb.base/del
? gdb/testsuite/gdb.base/display
? gdb/testsuite/gdb.base/dump
? gdb/testsuite/gdb.base/ending-run
? gdb/testsuite/gdb.base/execd-prog
? gdb/testsuite/gdb.base/expand-psymtabs
? gdb/testsuite/gdb.base/exprs
? gdb/testsuite/gdb.base/fileio
? gdb/testsuite/gdb.base/find
? gdb/testsuite/gdb.base/finish
? gdb/testsuite/gdb.base/fixsection
? gdb/testsuite/gdb.base/fixsectshr.sl
? gdb/testsuite/gdb.base/float
? gdb/testsuite/gdb.base/foll-exec
? gdb/testsuite/gdb.base/foll-fork
? gdb/testsuite/gdb.base/foll-vfork
? gdb/testsuite/gdb.base/frame-args
? gdb/testsuite/gdb.base/freebpcmd
? gdb/testsuite/gdb.base/fullname
? gdb/testsuite/gdb.base/funcargs
? gdb/testsuite/gdb.base/gcore
? gdb/testsuite/gdb.base/gcore-buffer-overflow-01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
? gdb/testsuite/gdb.base/gcore-buffer-overflow.test
? gdb/testsuite/gdb.base/gcore.test
? gdb/testsuite/gdb.base/gdb1090
? gdb/testsuite/gdb.base/gdb1250
? gdb/testsuite/gdb.base/gdb1555-main
? gdb/testsuite/gdb.base/gdb1821
? gdb/testsuite/gdb.base/gdbvars
? gdb/testsuite/gdb.base/hashline1
? gdb/testsuite/gdb.base/hashline1.c
? gdb/testsuite/gdb.base/hashline2
? gdb/testsuite/gdb.base/hashline2.c
? gdb/testsuite/gdb.base/hashline3
? gdb/testsuite/gdb.base/hashline3.c
? gdb/testsuite/gdb.base/hook-stop-continue
? gdb/testsuite/gdb.base/hook-stop-frame
? gdb/testsuite/gdb.base/huge
? gdb/testsuite/gdb.base/included
? gdb/testsuite/gdb.base/infnan
? gdb/testsuite/gdb.base/info-target
? gdb/testsuite/gdb.base/int-type
? gdb/testsuite/gdb.base/interrupt
? gdb/testsuite/gdb.base/jump
? gdb/testsuite/gdb.base/langs
? gdb/testsuite/gdb.base/lineinc
? gdb/testsuite/gdb.base/list
? gdb/testsuite/gdb.base/long_long
? gdb/testsuite/gdb.base/longjmp
? gdb/testsuite/gdb.base/macscp
? gdb/testsuite/gdb.base/mips_pro
? gdb/testsuite/gdb.base/miscexprs
? gdb/testsuite/gdb.base/multi-forks
? gdb/testsuite/gdb.base/nodebug
? gdb/testsuite/gdb.base/nofield
? gdb/testsuite/gdb.base/opaque
? gdb/testsuite/gdb.base/pc-fp
? gdb/testsuite/gdb.base/pending
? gdb/testsuite/gdb.base/pendshr.sl
? gdb/testsuite/gdb.base/pie-support
? gdb/testsuite/gdb.base/pointers
? gdb/testsuite/gdb.base/prelink.core
? gdb/testsuite/gdb.base/prelinkt
? gdb/testsuite/gdb.base/printcmds
? gdb/testsuite/gdb.base/prologue
? gdb/testsuite/gdb.base/psymtab
? gdb/testsuite/gdb.base/ptr-typedef
? gdb/testsuite/gdb.base/ptype
? gdb/testsuite/gdb.base/randomize
? gdb/testsuite/gdb.base/recurse
? gdb/testsuite/gdb.base/relational
? gdb/testsuite/gdb.base/relativedebug
? gdb/testsuite/gdb.base/reread
? gdb/testsuite/gdb.base/reread1
? gdb/testsuite/gdb.base/restore
? gdb/testsuite/gdb.base/return
? gdb/testsuite/gdb.base/return-nodebug-int
? gdb/testsuite/gdb.base/return-nodebug-long
? gdb/testsuite/gdb.base/return-nodebug-long-long
? gdb/testsuite/gdb.base/return-nodebug-short
? gdb/testsuite/gdb.base/return-nodebug-signed-char
? gdb/testsuite/gdb.base/return2
? gdb/testsuite/gdb.base/savedregs
? gdb/testsuite/gdb.base/scope
? gdb/testsuite/gdb.base/sep
? gdb/testsuite/gdb.base/sepdebug
? gdb/testsuite/gdb.base/sepdebug.stripped
? gdb/testsuite/gdb.base/sepsymtab
? gdb/testsuite/gdb.base/sepsymtab.stripped
? gdb/testsuite/gdb.base/setshow
? gdb/testsuite/gdb.base/setvar
? gdb/testsuite/gdb.base/shmain
? gdb/testsuite/gdb.base/shr1.sl
? gdb/testsuite/gdb.base/shr2.sl
? gdb/testsuite/gdb.base/shreloc
? gdb/testsuite/gdb.base/shreloc.txt
? gdb/testsuite/gdb.base/shreloc1.sl
? gdb/testsuite/gdb.base/shreloc2.sl
? gdb/testsuite/gdb.base/sigall
? gdb/testsuite/gdb.base/sigaltstack
? gdb/testsuite/gdb.base/sigbpt
? gdb/testsuite/gdb.base/sigchld
? gdb/testsuite/gdb.base/siginfo
? gdb/testsuite/gdb.base/siginfo-addr
? gdb/testsuite/gdb.base/siginfo-obj
? gdb/testsuite/gdb.base/signals
? gdb/testsuite/gdb.base/signull
? gdb/testsuite/gdb.base/sigrepeat
? gdb/testsuite/gdb.base/sigstep
? gdb/testsuite/gdb.base/sizeof
? gdb/testsuite/gdb.base/so-impl-ld
? gdb/testsuite/gdb.base/solib-display-main
? gdb/testsuite/gdb.base/solib-overlap-lib1-0x40000000.so-running
? gdb/testsuite/gdb.base/solib-overlap-lib1-0x50000000.so-running
? gdb/testsuite/gdb.base/solib-overlap-lib2-0x40000000.so-running
? gdb/testsuite/gdb.base/solib-overlap-lib2-0x50000000.so-running
? gdb/testsuite/gdb.base/solib-overlap-main-0x40000000
? gdb/testsuite/gdb.base/solib-overlap-main-0x50000000
? gdb/testsuite/gdb.base/solib-symbol-main
? gdb/testsuite/gdb.base/solib-weak
? gdb/testsuite/gdb.base/solib-weak-lib2
? gdb/testsuite/gdb.base/solib1.sl
? gdb/testsuite/gdb.base/stack-checking
? gdb/testsuite/gdb.base/start
? gdb/testsuite/gdb.base/step-break
? gdb/testsuite/gdb.base/step-bt
? gdb/testsuite/gdb.base/step-line
? gdb/testsuite/gdb.base/step-test
? gdb/testsuite/gdb.base/store
? gdb/testsuite/gdb.base/structs-tc
? gdb/testsuite/gdb.base/structs-tc-td
? gdb/testsuite/gdb.base/structs-tc-tf
? gdb/testsuite/gdb.base/structs-tc-ti
? gdb/testsuite/gdb.base/structs-tc-tl
? gdb/testsuite/gdb.base/structs-tc-tld
? gdb/testsuite/gdb.base/structs-tc-tll
? gdb/testsuite/gdb.base/structs-tc-ts
? gdb/testsuite/gdb.base/structs-td
? gdb/testsuite/gdb.base/structs-td-tc
? gdb/testsuite/gdb.base/structs-td-tf
? gdb/testsuite/gdb.base/structs-tf
? gdb/testsuite/gdb.base/structs-tf-tc
? gdb/testsuite/gdb.base/structs-tf-td
? gdb/testsuite/gdb.base/structs-ti
? gdb/testsuite/gdb.base/structs-ti-tc
? gdb/testsuite/gdb.base/structs-tl
? gdb/testsuite/gdb.base/structs-tl-tc
? gdb/testsuite/gdb.base/structs-tld
? gdb/testsuite/gdb.base/structs-tld-tc
? gdb/testsuite/gdb.base/structs-tll
? gdb/testsuite/gdb.base/structs-tll-tc
? gdb/testsuite/gdb.base/structs-ts
? gdb/testsuite/gdb.base/structs-ts-tc
? gdb/testsuite/gdb.base/structs2
? gdb/testsuite/gdb.base/structs3
? gdb/testsuite/gdb.base/term
? gdb/testsuite/gdb.base/tmp-fullname.c
? gdb/testsuite/gdb.base/twice-tmp
? gdb/testsuite/gdb.base/twice-tmp.c
? gdb/testsuite/gdb.base/type-opaque-main
? gdb/testsuite/gdb.base/unload
? gdb/testsuite/gdb.base/unloadshr.sl
? gdb/testsuite/gdb.base/until
? gdb/testsuite/gdb.base/unwindonsignal
? gdb/testsuite/gdb.base/value-double-free
? gdb/testsuite/gdb.base/varargs
? gdb/testsuite/gdb.base/vforked-prog
? gdb/testsuite/gdb.base/volatile
? gdb/testsuite/gdb.base/watch_thread_num
? gdb/testsuite/gdb.base/watchpoint
? gdb/testsuite/gdb.base/watchpoint-hw
? gdb/testsuite/gdb.base/watchpoint-solib
? gdb/testsuite/gdb.base/watchpoint-solib-shr.sl
? gdb/testsuite/gdb.base/watchpoints
? gdb/testsuite/gdb.base/weaklib1.sl
? gdb/testsuite/gdb.base/weaklib2.sl
? gdb/testsuite/gdb.base/whatis
? gdb/testsuite/gdb.base/whatis-exp
? gdb/testsuite/gdb.cell/gdb.log
? gdb/testsuite/gdb.cell/gdb.sum
? gdb/testsuite/gdb.cp/Makefile
? gdb/testsuite/gdb.cp/abstract-origin
? gdb/testsuite/gdb.cp/annota2
? gdb/testsuite/gdb.cp/annota3
? gdb/testsuite/gdb.cp/anon-union
? gdb/testsuite/gdb.cp/arg-reference
? gdb/testsuite/gdb.cp/bool
? gdb/testsuite/gdb.cp/breakpoint
? gdb/testsuite/gdb.cp/bs15503
? gdb/testsuite/gdb.cp/call-c
? gdb/testsuite/gdb.cp/casts
? gdb/testsuite/gdb.cp/class2
? gdb/testsuite/gdb.cp/classes
? gdb/testsuite/gdb.cp/cplusfuncs
? gdb/testsuite/gdb.cp/cttiadd
? gdb/testsuite/gdb.cp/derivation
? gdb/testsuite/gdb.cp/exception
? gdb/testsuite/gdb.cp/expand-sals
? gdb/testsuite/gdb.cp/formatted-ref
? gdb/testsuite/gdb.cp/gdb.log
? gdb/testsuite/gdb.cp/gdb.sum
? gdb/testsuite/gdb.cp/gdb1355
? gdb/testsuite/gdb.cp/gdb2384
? gdb/testsuite/gdb.cp/gdb2495
? gdb/testsuite/gdb.cp/hang
? gdb/testsuite/gdb.cp/inherit
? gdb/testsuite/gdb.cp/local
? gdb/testsuite/gdb.cp/m-data
? gdb/testsuite/gdb.cp/m-static
? gdb/testsuite/gdb.cp/mb-ctor
? gdb/testsuite/gdb.cp/mb-inline
? gdb/testsuite/gdb.cp/mb-templates
? gdb/testsuite/gdb.cp/member-ptr
? gdb/testsuite/gdb.cp/method
? gdb/testsuite/gdb.cp/method2
? gdb/testsuite/gdb.cp/misc
? gdb/testsuite/gdb.cp/namespace
? gdb/testsuite/gdb.cp/namespace-nested-import
? gdb/testsuite/gdb.cp/namespace-using
? gdb/testsuite/gdb.cp/overload
? gdb/testsuite/gdb.cp/ovldbreak
? gdb/testsuite/gdb.cp/pass-by-ref
? gdb/testsuite/gdb.cp/pr-1023
? gdb/testsuite/gdb.cp/pr-1210
? gdb/testsuite/gdb.cp/pr-574
? gdb/testsuite/gdb.cp/pr9594
? gdb/testsuite/gdb.cp/pr9631
? gdb/testsuite/gdb.cp/printmethod
? gdb/testsuite/gdb.cp/psmang
? gdb/testsuite/gdb.cp/ref-params
? gdb/testsuite/gdb.cp/ref-types
? gdb/testsuite/gdb.cp/rtti
? gdb/testsuite/gdb.cp/templates
? gdb/testsuite/gdb.cp/try_catch
? gdb/testsuite/gdb.cp/userdef
? gdb/testsuite/gdb.cp/virtfunc
? gdb/testsuite/gdb.disasm/Makefile
? gdb/testsuite/gdb.disasm/gdb.log
? gdb/testsuite/gdb.disasm/gdb.sum
? gdb/testsuite/gdb.dwarf2/Makefile
? gdb/testsuite/gdb.dwarf2/dup-psym.x
? gdb/testsuite/gdb.dwarf2/dw2-basic.x
? gdb/testsuite/gdb.dwarf2/dw2-compressed.x
? gdb/testsuite/gdb.dwarf2/dw2-cu-size.x
? gdb/testsuite/gdb.dwarf2/dw2-inheritance.x
? gdb/testsuite/gdb.dwarf2/dw2-intercu.x
? gdb/testsuite/gdb.dwarf2/dw2-intermix.x
? gdb/testsuite/gdb.dwarf2/dw2-noloc
? gdb/testsuite/gdb.dwarf2/dw2-producer.x
? gdb/testsuite/gdb.dwarf2/dw2-ranges
? gdb/testsuite/gdb.dwarf2/dw2-restore.x
? gdb/testsuite/gdb.dwarf2/dw2-strp.x
? gdb/testsuite/gdb.dwarf2/dw2-unresolved
? gdb/testsuite/gdb.dwarf2/gdb.log
? gdb/testsuite/gdb.dwarf2/gdb.sum
? gdb/testsuite/gdb.dwarf2/mac-fileno.x
? gdb/testsuite/gdb.fortran/Makefile
? gdb/testsuite/gdb.fortran/gdb.log
? gdb/testsuite/gdb.fortran/gdb.sum
? gdb/testsuite/gdb.gdb/gdb.log
? gdb/testsuite/gdb.gdb/gdb.sum
? gdb/testsuite/gdb.java/Makefile
? gdb/testsuite/gdb.java/gdb.log
? gdb/testsuite/gdb.java/gdb.sum
? gdb/testsuite/gdb.mi/Makefile
? gdb/testsuite/gdb.mi/basics
? gdb/testsuite/gdb.mi/gdb.log
? gdb/testsuite/gdb.mi/gdb.sum
? gdb/testsuite/gdb.mi/gdb669-pthreads
? gdb/testsuite/gdb.mi/gdb701
? gdb/testsuite/gdb.mi/gdb792
? gdb/testsuite/gdb.mi/mi-async
? gdb/testsuite/gdb.mi/mi-basics
? gdb/testsuite/gdb.mi/mi-break
? gdb/testsuite/gdb.mi/mi-cli
? gdb/testsuite/gdb.mi/mi-console
? gdb/testsuite/gdb.mi/mi-disassemble
? gdb/testsuite/gdb.mi/mi-eval
? gdb/testsuite/gdb.mi/mi-file
? gdb/testsuite/gdb.mi/mi-file-transfer
? gdb/testsuite/gdb.mi/mi-non-stop
? gdb/testsuite/gdb.mi/mi-non-stop-exit
? gdb/testsuite/gdb.mi/mi-nsintrall
? gdb/testsuite/gdb.mi/mi-nsmoribund
? gdb/testsuite/gdb.mi/mi-nsthrexec
? gdb/testsuite/gdb.mi/mi-pending
? gdb/testsuite/gdb.mi/mi-pendshr.sl
? gdb/testsuite/gdb.mi/mi-pthreads
? gdb/testsuite/gdb.mi/mi-read-memory
? gdb/testsuite/gdb.mi/mi-regs
? gdb/testsuite/gdb.mi/mi-return
? gdb/testsuite/gdb.mi/mi-simplerun
? gdb/testsuite/gdb.mi/mi-stack
? gdb/testsuite/gdb.mi/mi-stepi
? gdb/testsuite/gdb.mi/mi-syn-frame
? gdb/testsuite/gdb.mi/mi-var-block
? gdb/testsuite/gdb.mi/mi-var-child
? gdb/testsuite/gdb.mi/mi-var-cmd
? gdb/testsuite/gdb.mi/mi-var-cp
? gdb/testsuite/gdb.mi/mi-var-display
? gdb/testsuite/gdb.mi/mi-var-invalidate
? gdb/testsuite/gdb.mi/mi-var-invalidate_bis
? gdb/testsuite/gdb.mi/mi-watch
? gdb/testsuite/gdb.mi/mi2-basics
? gdb/testsuite/gdb.mi/mi2-break
? gdb/testsuite/gdb.mi/mi2-cli
? gdb/testsuite/gdb.mi/mi2-disassemble
? gdb/testsuite/gdb.mi/mi2-eval
? gdb/testsuite/gdb.mi/mi2-file
? gdb/testsuite/gdb.mi/mi2-pthreads
? gdb/testsuite/gdb.mi/mi2-regs
? gdb/testsuite/gdb.mi/mi2-return
? gdb/testsuite/gdb.mi/mi2-simplerun
? gdb/testsuite/gdb.mi/mi2-stepi
? gdb/testsuite/gdb.mi/mi2-var-block
? gdb/testsuite/gdb.mi/mi2-var-child
? gdb/testsuite/gdb.mi/mi2-var-cmd
? gdb/testsuite/gdb.mi/mi2-var-display
? gdb/testsuite/gdb.mi/mi2-watch
? gdb/testsuite/gdb.mi/until
? gdb/testsuite/gdb.modula2/Makefile
? gdb/testsuite/gdb.modula2/gdb.log
? gdb/testsuite/gdb.modula2/gdb.sum
? gdb/testsuite/gdb.modula2/unbounded1
? gdb/testsuite/gdb.objc/Makefile
? gdb/testsuite/gdb.objc/gdb.log
? gdb/testsuite/gdb.objc/gdb.sum
? gdb/testsuite/gdb.opt/Makefile
? gdb/testsuite/gdb.opt/clobbered-registers-O2
? gdb/testsuite/gdb.opt/gdb.log
? gdb/testsuite/gdb.opt/gdb.sum
? gdb/testsuite/gdb.opt/inline-bt
? gdb/testsuite/gdb.opt/inline-cmds
? gdb/testsuite/gdb.opt/inline-locals
? gdb/testsuite/gdb.pascal/Makefile
? gdb/testsuite/gdb.pascal/gdb.log
? gdb/testsuite/gdb.pascal/gdb.sum
? gdb/testsuite/gdb.python/Makefile
? gdb/testsuite/gdb.python/gdb.log
? gdb/testsuite/gdb.python/gdb.sum
? gdb/testsuite/gdb.python/py-frame
? gdb/testsuite/gdb.python/py-prettyprint
? gdb/testsuite/gdb.python/py-template
? gdb/testsuite/gdb.python/py-value
? gdb/testsuite/gdb.python/python-frame
? gdb/testsuite/gdb.python/python-prettyprint
? gdb/testsuite/gdb.python/python-template
? gdb/testsuite/gdb.reverse/Makefile
? gdb/testsuite/gdb.reverse/gdb.log
? gdb/testsuite/gdb.reverse/gdb.sum
? gdb/testsuite/gdb.server/Makefile
? gdb/testsuite/gdb.server/ext-attach
? gdb/testsuite/gdb.server/ext-run
? gdb/testsuite/gdb.server/file-transfer
? gdb/testsuite/gdb.server/gdb.log
? gdb/testsuite/gdb.server/gdb.sum
? gdb/testsuite/gdb.server/server-mon
? gdb/testsuite/gdb.server/server-run
? gdb/testsuite/gdb.stabs/Makefile
? gdb/testsuite/gdb.stabs/config.log
? gdb/testsuite/gdb.stabs/config.status
? gdb/testsuite/gdb.stabs/exclfwd
? gdb/testsuite/gdb.stabs/gdb.log
? gdb/testsuite/gdb.stabs/gdb.sum
? gdb/testsuite/gdb.threads/Makefile
? gdb/testsuite/gdb.threads/attach-into-signal
? gdb/testsuite/gdb.threads/attach-stopped
? gdb/testsuite/gdb.threads/attachstop-mt
? gdb/testsuite/gdb.threads/bp_in_thread
? gdb/testsuite/gdb.threads/current-lwp-dead
? gdb/testsuite/gdb.threads/execl
? gdb/testsuite/gdb.threads/execl1
? gdb/testsuite/gdb.threads/fork-child-threads
? gdb/testsuite/gdb.threads/fork-thread-pending
? gdb/testsuite/gdb.threads/gcore-pthreads
? gdb/testsuite/gdb.threads/gcore.test
? gdb/testsuite/gdb.threads/gdb.log
? gdb/testsuite/gdb.threads/gdb.sum
? gdb/testsuite/gdb.threads/hand-call-in-threads
? gdb/testsuite/gdb.threads/interrupted-hand-call
? gdb/testsuite/gdb.threads/killed
? gdb/testsuite/gdb.threads/linux-dp
? gdb/testsuite/gdb.threads/manythreads
? gdb/testsuite/gdb.threads/multi-create
? gdb/testsuite/gdb.threads/pending-step
? gdb/testsuite/gdb.threads/print-threads
? gdb/testsuite/gdb.threads/pthread_cond_wait
? gdb/testsuite/gdb.threads/pthreads
? gdb/testsuite/gdb.threads/schedlock
? gdb/testsuite/gdb.threads/sigthread
? gdb/testsuite/gdb.threads/staticthreads
? gdb/testsuite/gdb.threads/switch-threads
? gdb/testsuite/gdb.threads/thread-execl
? gdb/testsuite/gdb.threads/thread-specific
? gdb/testsuite/gdb.threads/thread_check
? gdb/testsuite/gdb.threads/thread_events
? gdb/testsuite/gdb.threads/threadapply
? gdb/testsuite/gdb.threads/threxit-hop-specific
? gdb/testsuite/gdb.threads/tls
? gdb/testsuite/gdb.threads/tls-main
? gdb/testsuite/gdb.threads/tls-nodebug
? gdb/testsuite/gdb.threads/watchthreads
? gdb/testsuite/gdb.threads/watchthreads2
? gdb/testsuite/gdb.trace/Makefile
? gdb/testsuite/gdb.trace/actions
? gdb/testsuite/gdb.trace/backtrace
? gdb/testsuite/gdb.trace/circ
? gdb/testsuite/gdb.trace/collection
? gdb/testsuite/gdb.trace/deltrace
? gdb/testsuite/gdb.trace/gdb.log
? gdb/testsuite/gdb.trace/gdb.sum
? gdb/testsuite/gdb.trace/infotrace
? gdb/testsuite/gdb.trace/limits
? gdb/testsuite/gdb.trace/packetlen
? gdb/testsuite/gdb.trace/passc-dyn
? gdb/testsuite/gdb.trace/passcount
? gdb/testsuite/gdb.trace/report
? gdb/testsuite/gdb.trace/save-trace
? gdb/testsuite/gdb.trace/tfind
? gdb/testsuite/gdb.trace/tracecmd
? gdb/testsuite/gdb.trace/while-dyn
? gdb/testsuite/gdb.trace/while-stepping
? gdb/testsuite/gdb.xml/Makefile
? gdb/testsuite/gdb.xml/gdb.log
? gdb/testsuite/gdb.xml/gdb.sum
? intl/Makefile
? intl/config.cache
? intl/config.h
? intl/config.intl
? intl/config.log
? intl/config.status
? libdecnumber/Makefile
? libdecnumber/config.cache
? libdecnumber/config.h
? libdecnumber/config.log
? libdecnumber/config.status
? libdecnumber/gstdint.h
? libdecnumber/stamp-h1
? libiberty/Makefile
? libiberty/config.cache
? libiberty/config.h
? libiberty/config.log
? libiberty/config.status
? libiberty/required-list
? libiberty/stamp-h
? libiberty/stamp-picdir
? libiberty/xhost-mkfrag
? libiberty/testsuite/Makefile
? libiberty/testsuite/test-demangle
? libiberty/testsuite/test-expandargv
? libiberty/testsuite/test-pexecute
? opcodes/.deps
? opcodes/.libs
? opcodes/Makefile
? opcodes/config.cache
? opcodes/config.h
? opcodes/config.log
? opcodes/config.status
? opcodes/dis-buf.lo
? opcodes/dis-init.lo
? opcodes/disassemble.lo
? opcodes/i386-dis.lo
? opcodes/i386-opc.lo
? opcodes/libopcodes.la
? opcodes/libtool
? opcodes/stamp-h1
? opcodes/stamp-lib
? opcodes/po/Makefile
? opcodes/po/Makefile.in
? opcodes/po/POTFILES
? readline/Makefile
? readline/config.cache
? readline/config.h
? readline/config.log
? readline/config.status
? readline/stamp-h
? readline/doc/Makefile
? readline/examples/Makefile
? readline/shlib/Makefile
? sim/Makefile
? sim/config.cache
? sim/config.log
? sim/config.status
Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.10923
diff -u -r1.10923 ChangeLog
--- gdb/ChangeLog 29 Sep 2009 16:27:05 -0000 1.10923
+++ gdb/ChangeLog 1 Oct 2009 04:49:47 -0000
@@ -1,3 +1,17 @@
+2009-09-30 Kazuyoshi Caz Yokoyama <caz@caztech.com>
+
+ * remote.c (interrupt_sequence_control_c)
+ (interrupt_sequence_break, interrupt_sequence_sysrq_g)
+ (interrupt_sequence_modes): New constants.
+ (interrupt_sequence_mode, interrupt_on_connect): New variable.
+ (show_interrupt_sequence): New function.
+ (set_remotebreak, show_remotebreak): New function.
+ (send_interrupt_sequence: New function.
+ (remote_start_remote): Call send_interrupt_sequence if interrupt_on_connect.
+ (remote_stop_as): Call send_interrupt_sequence.
+ (_initialize_remote): Add interrupt-sequence and interrupt-on-connect,
+ modify remotebreak to call set_remotebreak and show_remotebreak.
+
2009-09-29 Jan Kratochvil <jan.kratochvil@redhat.com>

* ia64-tdep.c (ia64_convert_from_func_ptr_addr): New variable buf.
Index: gdb/NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.331
diff -u -r1.331 NEWS
--- gdb/NEWS 15 Sep 2009 03:30:04 -0000 1.331
+++ gdb/NEWS 1 Oct 2009 04:49:49 -0000
@@ -234,6 +234,24 @@

* New commands (for set/show, see "New options" below)

+set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g]
+show remote interrupt-sequence
+ Allow the user to select one of ^C, a break or Magic SysRq g as the
+ sequence to the remote target in order to interrupt the execution.
+ Ctrl-C is a default. Some system prefers BREAK which is high level of
+ serial line for some certain time. Linux kernel prefers SysRq-g, a.k.a
+ Magic SysRq. It is BREAK signal and character 'g'.
+
+set remote interrupt-on-connect [on | off]
+show remote interrupt-on-connect
+ When interrupt-on-connect is ON, gdb sends interrupt-sequence to
+ remote target when gdb connects to it. This is needed when you debug
+ Linux kernel.
+
+set remotebreak [on | off]
+show remotebreak
+Deprecated. Use "set/show remote interrupt-sequence" instead.
+
catch syscall [NAME(S) | NUMBER(S)]
Catch system calls. Arguments, which should be names of system
calls or their numbers, mean catch only those syscalls. Without
Index: gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.372
diff -u -r1.372 remote.c
--- gdb/remote.c 10 Sep 2009 22:47:56 -0000 1.372
+++ gdb/remote.c 1 Oct 2009 04:49:52 -0000
@@ -546,14 +546,76 @@
this can go away. */
static int wait_forever_enabled_p = 1;

+/* Allow the user to specify what sequence to send to the remote
+ when he requests a program interruption: Although ^C is usually
+ what remote systems expect (this is the default, here), it is
+ sometimes preferable to send a break. On other systems such
+ as the Linux kernel, a break followed by g, which is Magic SysRq g
+ is required in order to interrupt the execution. */
+const char interrupt_sequence_control_c[] = "Ctrl-C";
+const char interrupt_sequence_break[] = "BREAK";
+const char interrupt_sequence_sysrq_g[] = "SysRq-g";
+static const char *interrupt_sequence_modes[] =
+ {
+ interrupt_sequence_control_c,
+ interrupt_sequence_break,
+ interrupt_sequence_sysrq_g,
+ NULL
+ };
+static const char *interrupt_sequence_mode = interrupt_sequence_control_c;

-/* This variable chooses whether to send a ^C or a break when the user
- requests program interruption. Although ^C is usually what remote
- systems expect, and that is the default here, sometimes a break is
- preferable instead. */
+static void
+show_interrupt_sequence (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c,
+ const char *value)
+{
+ if (interrupt_sequence_mode == interrupt_sequence_control_c)
+ fprintf_filtered (file,
+ _("Send the ASCII ETX character (Ctrl-c) "
+ "to the remote target to interrupt the "
+ "execution of the program.\n"));
+ else if (interrupt_sequence_mode == interrupt_sequence_break)
+ fprintf_filtered (file,
+ _("send a break signal to the remote target "
+ "to interrupt the execution of the program.\n"));
+ else if (interrupt_sequence_mode == interrupt_sequence_sysrq_g)
+ fprintf_filtered (file,
+ _("Send a break signal and 'g' a.k.a. SysRq-g and Magic SysRq to "
+ "the remote target to interrupt the execution "
+ "of Linux kernel.\n"));
+ else
+ internal_error (__FILE__, __LINE__,
+ _("Invalid value for interrupt_sequence_mode: %s."),
+ interrupt_sequence_mode);
+}

+/* This boolean variable specifies whether interrupt_sequence is sent
+ to remote target when gdb starts. This is mostly needed when you debug
+ Linux kernel. Linux kernel expects BREAK g which is Magic SysRq for
+ connecting gdb. */
+static int interrupt_on_connect = 0;
+
+/* This variable is used to implement the "set/show remotebreak" commands.
+ Since these commands are now deprecated in favor of "set/show remote
+ interrupt-sequence", it no longer has any effect on the code. */
static int remote_break;

+static void
+set_remotebreak (char *args, int from_tty, struct cmd_list_element *c)
+{
+ if (remote_break)
+ interrupt_sequence_mode = interrupt_sequence_break;
+ else
+ interrupt_sequence_mode = interrupt_sequence_control_c;
+}
+
+static void
+show_remotebreak (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c,
+ const char *value)
+{
+}
+
/* Descriptor for I/O to remote machine. Initialize it to NULL so that
remote_open knows that we don't have a file open when the program
starts. */
@@ -2585,6 +2647,25 @@
int extended_p;
};

+/* Send interrupt_sequence to remote target. */
+static void
+send_interrupt_sequence ()
+{
+ if (interrupt_sequence_mode == interrupt_sequence_control_c)
+ serial_write (remote_desc, "\x03", 1);
+ else if (interrupt_sequence_mode == interrupt_sequence_break)
+ serial_send_break (remote_desc);
+ else if (interrupt_sequence_mode == interrupt_sequence_sysrq_g)
+ {
+ serial_send_break (remote_desc);
+ serial_write (remote_desc, "g", 1);
+ }
+ else
+ internal_error (__FILE__, __LINE__,
+ _("Invalid value for interrupt_sequence_mode: %s."),
+ interrupt_sequence_mode);
+}
+
static void
remote_start_remote (struct ui_out *uiout, void *opaque)
{
@@ -2598,6 +2679,9 @@
/* Ack any packet which the remote side has already sent. */
serial_write (remote_desc, "+", 1);

+ if (interrupt_on_connect)
+ send_interrupt_sequence ();
+
/* The first packet we send to the target is the optional "supported
packets" request. If the target can answer this, it will tell us
which later probes to skip. */
@@ -4021,12 +4105,8 @@
if (rs->cached_wait_status)
return;

- /* Send a break or a ^C, depending on user preference. */
-
- if (remote_break)
- serial_send_break (remote_desc);
- else
- serial_write (remote_desc, "\003", 1);
+ /* Send interrupt_sequence to remote target. */
+ send_interrupt_sequence ();
}

/* This is the generic stop called via the target vector. When a target
@@ -8993,6 +9073,10 @@
_initialize_remote (void)
{
struct remote_state *rs;
+ struct cmd_list_element *cmd;
+ /* I can't use the same string for lookup_cmd(). Cause segment fault. */
+ static char *_set_remotebreak_ = "remotebreak";
+ static char *_show_remotebreak_ = "remotebreak";

/* architecture specific data */
remote_gdbarch_data_handle =
@@ -9056,12 +9140,33 @@
terminating `#' character and checksum."),
&maintenancelist);

- add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\
-Set whether to send break if interrupted."), _("\
-Show whether to send break if interrupted."), _("\
+ add_setshow_boolean_cmd ("remotebreak", class_obscure, &remote_break, _("\
+Use \"set remote interrupt-sequence [control-c|break]\" instead."), _("\
+Use \"show remote interrupt-sequence\" instead."), _("\
If set, a break, instead of a cntrl-c, is sent to the remote target."),
- NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is %s. */
+ set_remotebreak, show_remotebreak,
&setlist, &showlist);
+ cmd = lookup_cmd (&_set_remotebreak_, setlist, "", -1, 1);
+ deprecate_cmd (cmd, "set remote interrupt-sequence");
+ cmd = lookup_cmd (&_show_remotebreak_, showlist, "", -1, 1);
+ deprecate_cmd (cmd, "show remote interrupt-sequence");
+
+ add_setshow_enum_cmd ("interrupt-sequence", class_support,
+ interrupt_sequence_modes, &interrupt_sequence_mode, _("\
+Set interrupt sequence to remote target."), _("\
+Show interrupt sequence to remote target."), _("\
+Valid value is \"Ctrl-C\", \"BREAK\" or \"SysRq-g\". The default is \"Ctrl-C\"."),
+ NULL, show_interrupt_sequence,
+ &remote_set_cmdlist,
+ &remote_show_cmdlist);
+
+ add_setshow_boolean_cmd ("interrupt-on-connect", class_support,
+ &interrupt_on_connect, _("\
+Set whether interrupt-sequence is sent to remote target when gdb connects to."), _(" \
+Show whether interrupt-sequence is sent to remote target when gdb connects to."), _(" \
+If set, interrupt sequence is sent to remote target."),
+ NULL, NULL,
+ &remote_set_cmdlist, &remote_show_cmdlist);

/* Install commands for configuring memory read/write packets. */

Index: gdb/doc/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/doc/ChangeLog,v
retrieving revision 1.958
diff -u -r1.958 ChangeLog
--- gdb/doc/ChangeLog 26 Sep 2009 16:47:13 -0000 1.958
+++ gdb/doc/ChangeLog 1 Oct 2009 04:49:55 -0000
@@ -1,3 +1,8 @@
+2009-09-30 Kazuyoshi Caz Yokoyama <caz@caztech.com>
+
+ * gdb.texinfo (Remote Configuration): Add "set/show remote interrupt-sequence" and
+ "set/show remote interrupt-on-connect" command.
+
2009-09-26 Pierre Muller <muller@ics.u-strasbg.fr>

* gdb.texinfo (Cygwin Native): Mention support for Ctrl-BREAK.
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.629
diff -u -r1.629 gdb.texinfo
--- gdb/doc/gdb.texinfo 26 Sep 2009 16:47:13 -0000 1.629
+++ gdb/doc/gdb.texinfo 1 Oct 2009 04:50:07 -0000
@@ -15011,6 +15011,33 @@
target system. If it is not set, the target will use a default
filename (e.g.@: the last program run).

+@item set remote interrupt-sequence
+@cindex interrupt remote programs
+@cindex select Ctrl-C, BREAK or SysRq-g
+Allow the user to select one of @samp{Ctrl-C}, a @code{BREAK} or
+@samp{SysRq-g} as the
+sequence to the remote target in order to interrupt the execution.
+@samp{Ctrl-C} is a default. Some system prefers @code{BREAK} which
+is high level of serial line for some certain time.
+Linux kernel prefers @samp{SysRq-g}, a.k.a Magic SysRq g.
+It is @code{BREAK} signal followed by character @code{g}.
+
+@item show interrupt-sequence
+Show which of @samp{Ctrl-C}, @code{BREAK} or @code{BREAK} followed by @code{g}
+is sent by @value{GDBN} to interrupt the remote program.
+@code{BREAK} followed by @code{g} is also known as Magic SysRq.
+
+@item set remote interrupt-on-connect
+@cindex send interrupt-sequence on start
+Specify whether interrupt-sequence is sent
+to remote target when @value{GDBN} connects to it. This is mostly needed when you debug
+Linux kernel. Linux kernel expects @code{BREAK} followed by @code{g} which is Magic SysRq
+in order to connect @value{GDBN}.
+
+@item show interrupt-on-connect
+Show whether interrupt-sequence is sent
+to remote target when @value{GDBN} connects to it.
+
@kindex set tcp
@kindex show tcp
@item set tcp auto-retry on
@@ -29817,9 +29844,9 @@
@cindex interrupts (remote protocol)

When a program on the remote target is running, @value{GDBN} may
-attempt to interrupt it by sending a @samp{Ctrl-C} or a @code{BREAK},
-control of which is specified via @value{GDBN}'s @samp{remotebreak}
-setting (@pxref{set remotebreak}).
+attempt to interrupt it by sending a @samp{Ctrl-C}, @code{BREAK} or
+a @code{BREAK} followed by @code{g},
+control of which is specified via @value{GDBN}'s @samp{interrupt-sequence}.

The precise meaning of @code{BREAK} is defined by the transport
mechanism and may, in fact, be undefined. @value{GDBN} does not
@@ -29836,6 +29863,11 @@
(@pxref{X packet}), used for binary downloads, may include an unescaped
@code{0x03} as part of its packet.

+@code{BREAK} followed by @code{g} is also known as Magic SysRq and is
+@code{BREAK} and @code{g}.
+When Linux kernel receives this sequence from serial port,
+it stops execution and connects to gdb.
+
Stubs are not required to recognize these interrupt mechanisms and the
precise meaning associated with receipt of the interrupt is
implementation defined. If the target supports debugging of multiple