Re: Using the same serial port for both serial console and kgdb debugging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Paul,

On Sat, 2010-05-29 at 00:52 +0300, Paul Fisher wrote:
> Hello list,
> 
> I'm trying to get kgdb setup working. I have two PCs but unfortunately only one
> serial port in each of those. So far everything worked great, but several days
> ago the monitor of the second machine was taken away from my desk, and now one
> of the machines is headless.
> 
> As I already said, I got only one serial port, and now I use it to provide a
> serial console. Obviously, kgdb now doesn't work.. I've read somewhere that it
> is practically impossible to use one serial link for both a serial console and
> kgdb, but I think that's wrong, because kgdb documentation (
> http://kernel.org/pub/linux/kernel/people/jwessel/kdb/ch03.html#kgdboc) says:
> 
> For kgdb/gdb, kgdboc is designed to work with a single serial port. It is
> intended to cover the circumstance where you want to use a serial console as
> your primary console as well as using it to perform kernel debugging. It is also
> possible to use kgdb on a serial port which is not designated as a system
> console.
> 
> So that should be possible. I googled a bit and found a kdmx (kgdb demux)
> script, and in fact it works, but in a very limited and weird way. For one, you
> can't send a BRK (break) from minicom (Ctrl-A f) because it operates on the
> library level (read, write, select system calls) and the BRK is sent by means of
> ioctl(). Sending a break is essential, because that's the way to stop kernel
> execution and break into the debugger. Also detach gdb command freezes the whole
> serial communication because of the way this script is written.
> 
> So, is there any reliable way to do this? Any help, hint, etc is appreciated.
> 
> Thank you,
> 
> --paul
> 
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ
> 

I ploughed and struggled with similar issues some time ago, albeit on an
embedded target.
I certainly never got multiplexing going, I don't know what black art is
required there..... but I do plan to revisit all this again in near
future, as it's essential when I want to start (remote) kernel module
debugging again.

Perhaps this tip might help though (?) - 
If you have problems breaking into the debugger, you can type ASCII :
"echo g > /proc/sysrq-trigger"

HTH
B rgds
Kris


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux