Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jul 2014 14:06:39 -0700
From:      Nidal Khalil <nedmath@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: freebsd-hackers Digest, Vol 588, Issue 1
Message-ID:  <CADoY-6jDa-nD9w6jLUuUttjNgEbV0eJAu2Hm9AvFvAWm6Y9ASg@mail.gmail.com>
In-Reply-To: <mailman.7.1406030400.87390.freebsd-hackers@freebsd.org>
References:  <mailman.7.1406030400.87390.freebsd-hackers@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Still no go


On Tue, Jul 22, 2014 at 5:00 AM, <freebsd-hackers-request@freebsd.org>
wrote:

> Send freebsd-hackers mailing list submissions to
>         freebsd-hackers@freebsd.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> or, via email, send a message with subject or body 'help' to
>         freebsd-hackers-request@freebsd.org
>
> You can reach the person managing the list at
>         freebsd-hackers-owner@freebsd.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of freebsd-hackers digest..."
>
>
> Today's Topics:
>
>    1. Remote kernel debugging question (Nidal Khalil)
>    2. Re: Remote kernel debugging question (Benjamin Kaduk)
>    3. Re: Remote kernel debugging question (Nidal Khalil)
>    4. Re: Remote kernel debugging question (Navdeep Parhar)
>    5. Re: Remote kernel debugging question (Nidal Khalil)
>    6. Re: Remote kernel debugging question (Navdeep Parhar)
>    7. Re: Remote kernel debugging question (Nidal Khalil)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 21 Jul 2014 12:22:59 -0700
> From: Nidal Khalil <nedmath@gmail.com>
> To: freebsd-hackers@freebsd.org
> Subject: Remote kernel debugging question
> Message-ID:
>         <
> CADoY-6j0d9pBn-TDoMf5gysE8QiGz42DCFGLDWASig-wqLiMbg@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Hello All,
> I am somewhat new to BSD kernel but I am trying to debug a kernel module
> using remote debugging.
> I am using 9.2 RELEASE.
> I setup and compiled the kernel with the following:
>
> makeoptions DEBUG=-g
> options          KDB
> options          KDB_TRACE
> options          DDB_CTF
> options          DDB
> options          GDB
> options          ALT_BREAK_TO_DEBUGGER
>
> I setup the uart for serial1 flags to 0x90 and I can read and write to the
> serial from either machine
> Both machines have the same kernel booted.
> I can enter ddb but I can not launch gdb
> The remote GDB backend could not be selected.
> sysctl -a | grep debug.kdb
>
> debug.kdb.available: ddb
> Is that correct or it should be:
> debug.kdb.available: ddb gdb
> How do I enable gdb backend. I appreciate the help.
>
> Nidal
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 21 Jul 2014 17:55:51 -0400 (EDT)
> From: Benjamin Kaduk <bjk@freebsd.org>
> To: Nidal Khalil <nedmath@gmail.com>
> Cc: freebsd-hackers@freebsd.org
> Subject: Re: Remote kernel debugging question
> Message-ID: <alpine.GSO.1.10.1407211754470.21571@multics.mit.edu>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Mon, 21 Jul 2014, Nidal Khalil wrote:
>
> > Hello All,
> > I am somewhat new to BSD kernel but I am trying to debug a kernel module
> > using remote debugging.
> > I am using 9.2 RELEASE.
> > I setup and compiled the kernel with the following:
> >
> > makeoptions DEBUG=-g
> > options          KDB
> > options          KDB_TRACE
> > options          DDB_CTF
> > options          DDB
> > options          GDB
> > options          ALT_BREAK_TO_DEBUGGER
> >
> > I setup the uart for serial1 flags to 0x90 and I can read and write to
> the
> > serial from either machine
> > Both machines have the same kernel booted.
> > I can enter ddb but I can not launch gdb
> > The remote GDB backend could not be selected.
> > sysctl -a | grep debug.kdb
> >
> > debug.kdb.available: ddb
> > Is that correct or it should be:
> > debug.kdb.available: ddb gdb
> > How do I enable gdb backend. I appreciate the help.
>
> I do not think I have actually used remote GDB kernel debugging on my own
> machines, but I wanted to make sure that you had seen the documentation
> for doing so, available at
>
> http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug-online-gdb.html
> .  If it is incorrect, we should update it to be correct.
>
> Thanks,
>
> Ben Kaduk
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 21 Jul 2014 14:58:24 -0700
> From: Nidal Khalil <nedmath@gmail.com>
> To: Benjamin Kaduk <bjk@freebsd.org>
> Cc: freebsd-hackers@freebsd.org
> Subject: Re: Remote kernel debugging question
> Message-ID:
>         <
> CADoY-6hcD6ACwFVgX-LJ2cXHL35-bO+F8NYZ69vf3VDpg0DAAA@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Hi Ben,
> Yes I am familiar with the doc. As
>
>
> On Mon, Jul 21, 2014 at 2:55 PM, Benjamin Kaduk <bjk@freebsd.org> wrote:
>
> > On Mon, 21 Jul 2014, Nidal Khalil wrote:
> >
> >  Hello All,
> >> I am somewhat new to BSD kernel but I am trying to debug a kernel module
> >> using remote debugging.
> >> I am using 9.2 RELEASE.
> >> I setup and compiled the kernel with the following:
> >>
> >> makeoptions DEBUG=-g
> >> options          KDB
> >> options          KDB_TRACE
> >> options          DDB_CTF
> >> options          DDB
> >> options          GDB
> >> options          ALT_BREAK_TO_DEBUGGER
> >>
> >> I setup the uart for serial1 flags to 0x90 and I can read and write to
> the
> >> serial from either machine
> >> Both machines have the same kernel booted.
> >> I can enter ddb but I can not launch gdb
> >> The remote GDB backend could not be selected.
> >> sysctl -a | grep debug.kdb
> >>
> >> debug.kdb.available: ddb
> >> Is that correct or it should be:
> >> debug.kdb.available: ddb gdb
> >> How do I enable gdb backend. I appreciate the help.
> >>
> >
> > I do not think I have actually used remote GDB kernel debugging on my own
> > machines, but I wanted to make sure that you had seen the documentation
> for
> > doing so, available at http://www.freebsd.org/doc/en/
> > books/developers-handbook/kerneldebug-online-gdb.html .  If it is
> > incorrect, we should update it to be correct.
> >
> > Thanks,
> >
> > Ben Kaduk
> >
>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 21 Jul 2014 15:22:32 -0700
> From: Navdeep Parhar <nparhar@gmail.com>
> To: Nidal Khalil <nedmath@gmail.com>, freebsd-hackers@freebsd.org
> Subject: Re: Remote kernel debugging question
> Message-ID: <53CD92A8.5000201@gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On 07/21/14 12:22, Nidal Khalil wrote:
> > Hello All,
> > I am somewhat new to BSD kernel but I am trying to debug a kernel module
> > using remote debugging.
> > I am using 9.2 RELEASE.
> > I setup and compiled the kernel with the following:
> >
> > makeoptions DEBUG=-g
> > options          KDB
> > options          KDB_TRACE
> > options          DDB_CTF
> > options          DDB
> > options          GDB
> > options          ALT_BREAK_TO_DEBUGGER
> >
> > I setup the uart for serial1 flags to 0x90 and I can read and write to
> the
> > serial from either machine
> > Both machines have the same kernel booted.
> > I can enter ddb but I can not launch gdb
> > The remote GDB backend could not be selected.
> > sysctl -a | grep debug.kdb
> >
> > debug.kdb.available: ddb
> > Is that correct or it should be:
> > debug.kdb.available: ddb gdb
>
> The latter.
>
> > How do I enable gdb backend. I appreciate the help.
>
> All this on a recent HEAD.  If your problem is 9.2 specific then this
> may not help, but at least we can compare notes.  You did say you set
> flags to 0x90 for your serial port but it's not clear how.  I have this
> in /boot/loader.conf:
> hint.uart.0.flags="0x90"
>
> When the system boots I see this right around when loader hands off to
> the kernel.
>
> GDB: debug ports: uart
> GDB: current port: uart
> KDB: debugger backends: ddb gdb
> KDB: current backend: ddb
> Copyright (c) 1992-2014 The FreeBSD Project.
> ...
>
> After the system boots I see both ddb and gdb in the available debug
> backends and all is well.
>
> # sysctl debug.kdb.available
> debug.kdb.available: ddb gdb
> # sysctl debug.kdb.current
> debug.kdb.current: ddb
> # sysctl debug.kdb.current=gdb
> debug.kdb.current: ddb -> gdb
> # sysctl debug.kdb.current
> debug.kdb.current: gdb
>
> Regards,
> Navdeep
>
>
> ------------------------------
>
> Message: 5
> Date: Mon, 21 Jul 2014 15:35:01 -0700
> From: Nidal Khalil <nedmath@gmail.com>
> To: Navdeep Parhar <nparhar@gmail.com>
> Cc: freebsd-hackers@freebsd.org
> Subject: Re: Remote kernel debugging question
> Message-ID:
>         <
> CADoY-6hPgy8e7ETt2bFM27P--PJTjSTX0e9+bo3aVE4UyweYEw@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> The documentation states to put hint.uart.0.flags="0x90" in
> /boot/device.hits
> However you hit on a good point. I see some parameters in boot/loader.conf.
> Can you please email this file
> I think that I need to do more configuration to this file. I will do it by
> comparison. Thanks
>
> Nidal
>
>
> On Mon, Jul 21, 2014 at 3:22 PM, Navdeep Parhar <nparhar@gmail.com> wrote:
>
> > On 07/21/14 12:22, Nidal Khalil wrote:
> > > Hello All,
> > > I am somewhat new to BSD kernel but I am trying to debug a kernel
> module
> > > using remote debugging.
> > > I am using 9.2 RELEASE.
> > > I setup and compiled the kernel with the following:
> > >
> > > makeoptions DEBUG=-g
> > > options          KDB
> > > options          KDB_TRACE
> > > options          DDB_CTF
> > > options          DDB
> > > options          GDB
> > > options          ALT_BREAK_TO_DEBUGGER
> > >
> > > I setup the uart for serial1 flags to 0x90 and I can read and write to
> > the
> > > serial from either machine
> > > Both machines have the same kernel booted.
> > > I can enter ddb but I can not launch gdb
> > > The remote GDB backend could not be selected.
> > > sysctl -a | grep debug.kdb
> > >
> > > debug.kdb.available: ddb
> > > Is that correct or it should be:
> > > debug.kdb.available: ddb gdb
> >
> > The latter.
> >
> > > How do I enable gdb backend. I appreciate the help.
> >
> > All this on a recent HEAD.  If your problem is 9.2 specific then this
> > may not help, but at least we can compare notes.  You did say you set
> > flags to 0x90 for your serial port but it's not clear how.  I have this
> > in /boot/loader.conf:
> > hint.uart.0.flags="0x90"
> >
> > When the system boots I see this right around when loader hands off to
> > the kernel.
> >
> > GDB: debug ports: uart
> > GDB: current port: uart
> > KDB: debugger backends: ddb gdb
> > KDB: current backend: ddb
> > Copyright (c) 1992-2014 The FreeBSD Project.
> > ...
> >
> > After the system boots I see both ddb and gdb in the available debug
> > backends and all is well.
> >
> > # sysctl debug.kdb.available
> > debug.kdb.available: ddb gdb
> > # sysctl debug.kdb.current
> > debug.kdb.current: ddb
> > # sysctl debug.kdb.current=gdb
> > debug.kdb.current: ddb -> gdb
> > # sysctl debug.kdb.current
> > debug.kdb.current: gdb
> >
> > Regards,
> > Navdeep
> >
>
>
> ------------------------------
>
> Message: 6
> Date: Mon, 21 Jul 2014 15:40:09 -0700
> From: Navdeep Parhar <nparhar@gmail.com>
> To: Nidal Khalil <nedmath@gmail.com>
> Cc: freebsd-hackers@freebsd.org
> Subject: Re: Remote kernel debugging question
> Message-ID: <53CD96C9.2010600@gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On 07/21/14 15:35, Nidal Khalil wrote:
> > The documentation states to put hint.uart.0.flags="0x90" in
> > /boot/device.hits
>
> Putting it in device.hints should have worked too.  In fact, that's
> where uart(4) has it.  You haven't spelled it "hits" on your filesystem
> like you did here, have you?
>
> > However you hit on a good point. I see some parameters in
> > boot/loader.conf. Can you please email this file
> > I think that I need to do more configuration to this file. I will do it
> > by comparison. Thanks
>
> That's all there was in the file.
>
> Regards,
> Navdeep
>
> >
> > Nidal
> >
> >
> > On Mon, Jul 21, 2014 at 3:22 PM, Navdeep Parhar <nparhar@gmail.com
> > <mailto:nparhar@gmail.com>> wrote:
> >
> >     On 07/21/14 12:22, Nidal Khalil wrote:
> >     > Hello All,
> >     > I am somewhat new to BSD kernel but I am trying to debug a kernel
> >     module
> >     > using remote debugging.
> >     > I am using 9.2 RELEASE.
> >     > I setup and compiled the kernel with the following:
> >     >
> >     > makeoptions DEBUG=-g
> >     > options          KDB
> >     > options          KDB_TRACE
> >     > options          DDB_CTF
> >     > options          DDB
> >     > options          GDB
> >     > options          ALT_BREAK_TO_DEBUGGER
> >     >
> >     > I setup the uart for serial1 flags to 0x90 and I can read and
> >     write to the
> >     > serial from either machine
> >     > Both machines have the same kernel booted.
> >     > I can enter ddb but I can not launch gdb
> >     > The remote GDB backend could not be selected.
> >     > sysctl -a | grep debug.kdb
> >     >
> >     > debug.kdb.available: ddb
> >     > Is that correct or it should be:
> >     > debug.kdb.available: ddb gdb
> >
> >     The latter.
> >
> >     > How do I enable gdb backend. I appreciate the help.
> >
> >     All this on a recent HEAD.  If your problem is 9.2 specific then this
> >     may not help, but at least we can compare notes.  You did say you set
> >     flags to 0x90 for your serial port but it's not clear how.  I have
> this
> >     in /boot/loader.conf:
> >     hint.uart.0.flags="0x90"
> >
> >     When the system boots I see this right around when loader hands off
> to
> >     the kernel.
> >
> >     GDB: debug ports: uart
> >     GDB: current port: uart
> >     KDB: debugger backends: ddb gdb
> >     KDB: current backend: ddb
> >     Copyright (c) 1992-2014 The FreeBSD Project.
> >     ...
> >
> >     After the system boots I see both ddb and gdb in the available debug
> >     backends and all is well.
> >
> >     # sysctl debug.kdb.available
> >     debug.kdb.available: ddb gdb
> >     # sysctl debug.kdb.current
> >     debug.kdb.current: ddb
> >     # sysctl debug.kdb.current=gdb
> >     debug.kdb.current: ddb -> gdb
> >     # sysctl debug.kdb.current
> >     debug.kdb.current: gdb
> >
> >     Regards,
> >     Navdeep
> >
> >
>
>
>
> ------------------------------
>
> Message: 7
> Date: Mon, 21 Jul 2014 15:44:23 -0700
> From: Nidal Khalil <nedmath@gmail.com>
> To: Navdeep Parhar <nparhar@gmail.com>
> Cc: freebsd-hackers@freebsd.org
> Subject: Re: Remote kernel debugging question
> Message-ID:
>         <
> CADoY-6hJUGOvhQ6qoeP1aYLZ737dgYQGSsik_QF1+qXqcPH1Nw@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> No, I have not .
> It is hint.uart.0.flags="0x90"
> Thanks
> My question is how do I get gdb to show up as part of available debuggers
> in this node:
> debug.kdb.available: ddb
> Thanks
>
> Nidal
>
>
> On Mon, Jul 21, 2014 at 3:40 PM, Navdeep Parhar <nparhar@gmail.com> wrote:
>
> > On 07/21/14 15:35, Nidal Khalil wrote:
> > > The documentation states to put hint.uart.0.flags="0x90" in
> > > /boot/device.hits
> >
> > Putting it in device.hints should have worked too.  In fact, that's
> > where uart(4) has it.  You haven't spelled it "hits" on your filesystem
> > like you did here, have you?
> >
> > > However you hit on a good point. I see some parameters in
> > > boot/loader.conf. Can you please email this file
> > > I think that I need to do more configuration to this file. I will do it
> > > by comparison. Thanks
> >
> > That's all there was in the file.
> >
> > Regards,
> > Navdeep
> >
> > >
> > > Nidal
> > >
> > >
> > > On Mon, Jul 21, 2014 at 3:22 PM, Navdeep Parhar <nparhar@gmail.com
> > > <mailto:nparhar@gmail.com>> wrote:
> > >
> > >     On 07/21/14 12:22, Nidal Khalil wrote:
> > >     > Hello All,
> > >     > I am somewhat new to BSD kernel but I am trying to debug a kernel
> > >     module
> > >     > using remote debugging.
> > >     > I am using 9.2 RELEASE.
> > >     > I setup and compiled the kernel with the following:
> > >     >
> > >     > makeoptions DEBUG=-g
> > >     > options          KDB
> > >     > options          KDB_TRACE
> > >     > options          DDB_CTF
> > >     > options          DDB
> > >     > options          GDB
> > >     > options          ALT_BREAK_TO_DEBUGGER
> > >     >
> > >     > I setup the uart for serial1 flags to 0x90 and I can read and
> > >     write to the
> > >     > serial from either machine
> > >     > Both machines have the same kernel booted.
> > >     > I can enter ddb but I can not launch gdb
> > >     > The remote GDB backend could not be selected.
> > >     > sysctl -a | grep debug.kdb
> > >     >
> > >     > debug.kdb.available: ddb
> > >     > Is that correct or it should be:
> > >     > debug.kdb.available: ddb gdb
> > >
> > >     The latter.
> > >
> > >     > How do I enable gdb backend. I appreciate the help.
> > >
> > >     All this on a recent HEAD.  If your problem is 9.2 specific then
> this
> > >     may not help, but at least we can compare notes.  You did say you
> set
> > >     flags to 0x90 for your serial port but it's not clear how.  I have
> > this
> > >     in /boot/loader.conf:
> > >     hint.uart.0.flags="0x90"
> > >
> > >     When the system boots I see this right around when loader hands off
> > to
> > >     the kernel.
> > >
> > >     GDB: debug ports: uart
> > >     GDB: current port: uart
> > >     KDB: debugger backends: ddb gdb
> > >     KDB: current backend: ddb
> > >     Copyright (c) 1992-2014 The FreeBSD Project.
> > >     ...
> > >
> > >     After the system boots I see both ddb and gdb in the available
> debug
> > >     backends and all is well.
> > >
> > >     # sysctl debug.kdb.available
> > >     debug.kdb.available: ddb gdb
> > >     # sysctl debug.kdb.current
> > >     debug.kdb.current: ddb
> > >     # sysctl debug.kdb.current=gdb
> > >     debug.kdb.current: ddb -> gdb
> > >     # sysctl debug.kdb.current
> > >     debug.kdb.current: gdb
> > >
> > >     Regards,
> > >     Navdeep
> > >
> > >
> >
> >
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
>
> ------------------------------
>
> End of freebsd-hackers Digest, Vol 588, Issue 1
> ***********************************************
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADoY-6jDa-nD9w6jLUuUttjNgEbV0eJAu2Hm9AvFvAWm6Y9ASg>