Re: interrupting target kernel using single sio

2002-09-11 Thread John Polstra

In article <[EMAIL PROTECTED]>,
Nate Lawson  <[EMAIL PROTECTED]> wrote:
> On Mon, 9 Sep 2002, John Polstra wrote:
> > 
> > BSD/OS has a little state machine in its sio driver which notices
> > if something looking like a kgdb packet comes in and interrupts
> > the target automatically.  It's extremely handy.  You just type
> > "target remote /dev/tty00" into kgdb and the target breaks into the
> > debugger -- no muss, no fuss.  I wish we had this feature too.  It
> > should obviously be under the control of a sysctl to protect against
> > accidental entry into the debugger.
> > 
> > Another nice thing about BSD/OS is that when you exit kgdb, the target
> > OS automatically starts running again.  So you can enter and exit the
> > debugger painlessly, as many times as you'd like.
> 
> Any chance of getting that from BSD/OS?  If not, perhaps we could
> reimplement.

We used to have the BSD/OS sources on-line, and we had carte blanche
to take things from them and put them into FreeBSD.  I don't know
what the situation is now.

John
-- 
  John Polstra
  John D. Polstra & Co., Inc.Seattle, Washington USA
  "Disappointment is a good sign of basic intelligence."  -- Chögyam Trungpa


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: interrupting target kernel using single sio

2002-09-11 Thread Christian Zander

On Wed, Sep 11, 2002 at 01:15:53PM -0700, Nate Lawson wrote:
> 
> > Another nice thing about BSD/OS is that when you exit kgdb, the
> > target OS automatically starts running again.  So you can enter
> > and exit the debugger painlessly, as many times as you'd like.
> 
> Any chance of getting that from BSD/OS?  If not, perhaps we could
> reimplement.
> 

The Linux gdb kernel stub (kgdb.sourceforge.net) also supports this
behaviour, you don't need to detach explicitely.

-- 
christian zander
[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: interrupting target kernel using single sio

2002-09-11 Thread Nate Lawson

On Mon, 9 Sep 2002, John Polstra wrote:
> In article <[EMAIL PROTECTED]>,
> Hanspeter Roth  <[EMAIL PROTECTED]> wrote:
> > 
> > using a single serial cable I can pass control to the remote kgdb
> > pressing ctl-alt-del at the target host.
> > I'm looking for a means to interrupt the target kernel from the
> > remote host.
> > I got suggestions using a second serial cable or using ipgdb
> > instead.
> > Setting remotechat didn't help me.
> > 
> > Is it intended to be able to interrupt the target kernel from the
> > remote kgdb by some means at all? Or is this a wrong expectation?
> 
> BSD/OS has a little state machine in its sio driver which notices
> if something looking like a kgdb packet comes in and interrupts
> the target automatically.  It's extremely handy.  You just type
> "target remote /dev/tty00" into kgdb and the target breaks into the
> debugger -- no muss, no fuss.  I wish we had this feature too.  It
> should obviously be under the control of a sysctl to protect against
> accidental entry into the debugger.
> 
> Another nice thing about BSD/OS is that when you exit kgdb, the target
> OS automatically starts running again.  So you can enter and exit the
> debugger painlessly, as many times as you'd like.

Any chance of getting that from BSD/OS?  If not, perhaps we could
reimplement.

-Nate


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: interrupting target kernel using single sio

2002-09-09 Thread Terry Lambert

Hanspeter Roth wrote:
>   On Sep 09 at 04:52, Julian Elischer spoke:
> > it isdangerous because rebooting the local machine can en up sending a break
> > to the remote machine.
> 
> Is that to say rebooting the machine where I want to run gdb?
> I've rebooted this machine and nothing happened.
> Is that to say that the target machine ignores the break on the sio?

If you reboot the PC you are using as a console, it can result
in a break being sent down the line, which can cause the other
machine to break into the debugger, because the hardware post
of the console machine may send a break when you reboot it.
That's what he's saying.


> I tried to set brkint but after examining it again it is still
> cleared.
> Is the serial port bogus or is the serial cable an incomplete
> implementation?

It's 250+ms of spacing/line silence/+11v on the data line, so if
it were not working, or it was an incomplete cable, then you would
not be getting and serial communication at all.  Since you are,
the problem is not an incomplete cable.

Have you tried compiling in these options, NOT turning on the
GDB options, and simply sending a break down the serial line?
If you are using "tip", the command on the laptop you are using
as a console is "~#".

As I said previously, it's unlikely that the GDB client program
will send the right signal.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: interrupting target kernel using single sio

2002-09-09 Thread John Polstra

In article <[EMAIL PROTECTED]>,
Hanspeter Roth  <[EMAIL PROTECTED]> wrote:
> 
> using a single serial cable I can pass control to the remote kgdb
> pressing ctl-alt-del at the target host.
> I'm looking for a means to interrupt the target kernel from the
> remote host.
> I got suggestions using a second serial cable or using ipgdb
> instead.
> Setting remotechat didn't help me.
> 
> Is it intended to be able to interrupt the target kernel from the
> remote kgdb by some means at all? Or is this a wrong expectation?

BSD/OS has a little state machine in its sio driver which notices
if something looking like a kgdb packet comes in and interrupts
the target automatically.  It's extremely handy.  You just type
"target remote /dev/tty00" into kgdb and the target breaks into the
debugger -- no muss, no fuss.  I wish we had this feature too.  It
should obviously be under the control of a sysctl to protect against
accidental entry into the debugger.

Another nice thing about BSD/OS is that when you exit kgdb, the target
OS automatically starts running again.  So you can enter and exit the
debugger painlessly, as many times as you'd like.

John
-- 
  John Polstra
  John D. Polstra & Co., Inc.Seattle, Washington USA
  "Disappointment is a good sign of basic intelligence."  -- Chögyam Trungpa


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: interrupting target kernel using single sio

2002-09-09 Thread Hanspeter Roth

  On Sep 09 at 04:52, Julian Elischer spoke:

> there is the following option:
> # Options for serial drivers that support consoles (only for sio now):
> options BREAK_TO_DEBUGGER   #a BREAK on a comconsole goes to
> #DDB, if available.
> it isdangerous because rebooting the local machine can en up sending a break
> to the remote machine.

I also have:
options ALT_BREAK_TO_DEBUGGER
I hope it doesn't disturb.

Is that to say rebooting the machine where I want to run gdb?
I've rebooted this machine and nothing happened. 
Is that to say that the target machine ignores the break on the sio?

stty values are:

speed 9600 baud; 0 rows; 0 columns;
lflags: -icanon -isig -iexten -echo -echoe -echok -echoke -echonl
-echoctl -echoprt -altwerase -noflsh -tostop -flusho -pendin
-nokerninfo -extproc
iflags: -istrip -icrnl -inlcr -igncr -ixon -ixoff -ixany -imaxbel -ignbrk
-brkint -inpck -ignpar -parmrk
oflags: -opost -onlcr -ocrnl -oxtabs -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
-dtrflow -mdmbuf
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = ;
eol2 = ; erase = ^?; erase2 = ^H; intr = ^C; kill = ^U;
lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q;
status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W;

I tried to set brkint but after examining it again it is still
cleared.
Is the serial port bogus or is the serial cable an incomplete
implementation?

-Hanspeter

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: interrupting target kernel using single sio

2002-09-09 Thread Julian Elischer

there is the following option:
# Options for serial drivers that support consoles (only for sio now):
options BREAK_TO_DEBUGGER   #a BREAK on a comconsole goes to
#DDB, if available.
it isdangerous because rebooting the local machine can en up sending a break
to the remote machine.


On Mon, 9 Sep 2002, Hanspeter Roth wrote:

> Hello,
> 
> using a single serial cable I can pass control to the remote kgdb
> pressing ctl-alt-del at the target host.
> I'm looking for a means to interrupt the target kernel from the
> remote host.
> I got suggestions using a second serial cable or using ipgdb
> instead.
> Setting remotechat didn't help me.
> 
> Is it intended to be able to interrupt the target kernel from the
> remote kgdb by some means at all? Or is this a wrong expectation?
> 
> -Hanspeter
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-hackers" in the body of the message
> 


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: interrupting target kernel using single sio

2002-09-09 Thread Terry Lambert

Hanspeter Roth wrote:
> using a single serial cable I can pass control to the remote kgdb
> pressing ctl-alt-del at the target host.
> I'm looking for a means to interrupt the target kernel from the
> remote host.
> I got suggestions using a second serial cable or using ipgdb
> instead.
> Setting remotechat didn't help me.
> 
> Is it intended to be able to interrupt the target kernel from the
> remote kgdb by some means at all? Or is this a wrong expectation?

You need to send something which sends an interrupt to the
driver on the remote host, so that it can be caught, and
enter the debugger.

Normally, this is done using the "break" signal (250+ms of
RS232-C line silence).

This is enabled via:

options ALT_BREAK_TO_DEBUGGER
options BREAK_TO_DEBUGGER

See /usr/src/sys/i386/conf/LINT for details.

Note that your gdb client program is, AFAIK, too stupid to be
able to send this break.  But if you can get it to do it, then
FreeBSD will do the right thing.

Most likely, you will need to hack gdb to make it able to send
the break signal in response to a ^C or whatever you define as
your "remote break" character.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



interrupting target kernel using single sio

2002-09-09 Thread Hanspeter Roth

Hello,

using a single serial cable I can pass control to the remote kgdb
pressing ctl-alt-del at the target host.
I'm looking for a means to interrupt the target kernel from the
remote host.
I got suggestions using a second serial cable or using ipgdb
instead.
Setting remotechat didn't help me.

Is it intended to be able to interrupt the target kernel from the
remote kgdb by some means at all? Or is this a wrong expectation?

-Hanspeter

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message