Re: kgdb debugging

2008-10-08 Thread Jeremy Chadwick
On Wed, Oct 08, 2008 at 09:43:38PM -0700, alan yang wrote:
> thank you all, device.hints solved it!
> 
> On Tue, Oct 7, 2008 at 11:14 AM, Julian Elischer <[EMAIL PROTECTED]> wrote:
> > alan yang wrote:
> >>
> >> Could people shed some light how to get remote debugging going, must
> >> be something that i overlooked, really appreciate.
> >>
> >> Two FreeBSD7 systems, target and development, connected with null
> >> modem cable on each's COM1.
> >>
> >> step 1)
> >>-  rebuild kernel with following options:
> >>options DDB
> >>options KDB
> >>options GDB
> >>
> >>makeoptions DEBUG=-g
> >
> > add hints.dev.uart.0.flags=0xc0
> > (or whatever it is) (see man uart or man sio)
> > to /boot/device.hints

This is a bad recommendation.  *DO NOT* modify device.hints!!!

You can override device.hints entries, or add your own, by using
loader.conf.  Example, taken from our loader.conf on production
systems:

# There is no COM2 on this system.
hint.sio.1.disabled="1"

Thus, in your case, this should suffice (note "hint", not "hints"
like the above paragraph says):

hint.dev.uart.0.flags="0xc0"

-- 
| Jeremy Chadwickjdc at parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: kgdb debugging

2008-10-08 Thread alan yang
thank you all, device.hints solved it!

On Tue, Oct 7, 2008 at 11:14 AM, Julian Elischer <[EMAIL PROTECTED]> wrote:
> alan yang wrote:
>>
>> Could people shed some light how to get remote debugging going, must
>> be something that i overlooked, really appreciate.
>>
>> Two FreeBSD7 systems, target and development, connected with null
>> modem cable on each's COM1.
>>
>> step 1)
>>-  rebuild kernel with following options:
>>options DDB
>>options KDB
>>options GDB
>>
>>makeoptions DEBUG=-g
>
> add hints.dev.uart.0.flags=0xc0
> (or whatever it is) (see man uart or man sio)
> to /boot/device.hints
>
>>
>> step 2)
>>-  from development system
>>cd to /usr/src/sys/i386/comiple/MYKERNEL
>>kgdb -r /dev/cuad0 kernel.debug
>>
>>it displays the following:
>>Switching to remote protocol
>>Ignoring packet error, continuing
>>.
>>Couldn't establish connection to remote target
>>Malformed response to offset query, timeout
>>
>> step 3)
>>-  from targetsystem:
>>1.  Ctrl + Alt + Esc to go into db
>>2.  from db> type gdb
>>3.  it displays: "The remote GDB backend could not be
>> selected"
>>
>>
>>
>> On Mon, Oct 6, 2008 at 5:12 PM, alan yang <[EMAIL PROTECTED]> wrote:
>>>
>>> the problem is, when entering gdb from db as described in the following:
>>> --
>>> Enter ing gdb from ddb
>>> In FreeBSD you can build a kernel with support for both ddb and gdb.
>>> You can then
>>> change backwards and forwards between them. For example, if you're in
>>> ddb, you can
>>> go to gdb like this:
>>> db> gdb
>>> Next trap will enter GDB remote protocol mode
>>> db> si step a single instruction to reenter ddb
>>> --
>>> after typing gdb command, it says: "The remote GDB backend could not
>>> be selected"
>>> that i am not sure what this indicates; looking at subr_kdb.c, wonder
>>> maybe kdb_dbbe_set is not set?  seems kdb_dbbe_set is not referenced
>>> anywhere, not sure how to get it right.
>>>
>>> thanks for shed some light ...
>>>
>>> On Mon, Oct 6, 2008 at 4:26 PM, Pietro Cerutti <[EMAIL PROTECTED]> wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA512

 alan yang wrote:
 | hi, there,
 |
 | wonder people can shed some lights on remote debugging.  i have
 | freebsd7 configured with option DDB / KDB / GDB but after entering the
 | db on the target system the command gdb gives "the remote GDB backend
 | could not be selected".
 |
 | i browsed through the mailing list, and do find 1 similar post but
 | without answer.
 |
 | thanks in advance & apology if i overlooked things ...

 I suggest the following tutorial:
 http://www.lemis.com/grog/Papers/Debug-tutorial/tutorial.pdf

 Have fun :)

 |
 | cheers,
 | alan
 | ___
 | [EMAIL PROTECTED] mailing list
 | http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
 | To unsubscribe, send any mail to
 "[EMAIL PROTECTED]"


 - --
 Pietro Cerutti
 [EMAIL PROTECTED]

 PGP Public Key:
 http://gahr.ch/pgp

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v2.0.9 (FreeBSD)

 iEYEAREKAAYFAkjqnpQACgkQwMJqmJVx945RSwCgoDb0JTr8LSFDB1vpAbGUjb76
 ZH0An19HpFVJJTUB5/XnyZc0pIDzgxc3
 =6Pdm
 -END PGP SIGNATURE-

>> ___
>> [EMAIL PROTECTED] mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
>> To unsubscribe, send any mail to "[EMAIL PROTECTED]"
>
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: kgdb debugging

2008-10-07 Thread Navdeep Parhar
On Tue, Oct 7, 2008 at 10:53 AM, alan yang <[EMAIL PROTECTED]> wrote:
> Could people shed some light how to get remote debugging going, must
> be something that i overlooked, really appreciate.
>

Do you have the right flags for sio or uart in /boot/device.hints?  I
have this (for a recent HEAD)::
hint.uart.0.flags="0x90"

You are probably using sio as it is a FreeBSD7 system.  From the man
page of sio (the part that talks about flags)::
...
0x00080   use this port for remote kernel debugging
...

Make sure you have this bit set.

Regards,
Navdeep


> Two FreeBSD7 systems, target and development, connected with null
> modem cable on each's COM1.
>
> step 1)
>-  rebuild kernel with following options:
>options DDB
>options KDB
>options GDB
>
>makeoptions DEBUG=-g
>
> step 2)
>-  from development system
>cd to /usr/src/sys/i386/comiple/MYKERNEL
>kgdb -r /dev/cuad0 kernel.debug
>
>it displays the following:
>Switching to remote protocol
>Ignoring packet error, continuing
>.
>Couldn't establish connection to remote target
>Malformed response to offset query, timeout
>
> step 3)
>-  from targetsystem:
>1.  Ctrl + Alt + Esc to go into db
>2.  from db> type gdb
>3.  it displays: "The remote GDB backend could not be selected"
>
>
>
> On Mon, Oct 6, 2008 at 5:12 PM, alan yang <[EMAIL PROTECTED]> wrote:
>> the problem is, when entering gdb from db as described in the following:
>> --
>> Enter ing gdb from ddb
>> In FreeBSD you can build a kernel with support for both ddb and gdb.
>> You can then
>> change backwards and forwards between them. For example, if you're in
>> ddb, you can
>> go to gdb like this:
>> db> gdb
>> Next trap will enter GDB remote protocol mode
>> db> si step a single instruction to reenter ddb
>> --
>> after typing gdb command, it says: "The remote GDB backend could not
>> be selected"
>> that i am not sure what this indicates; looking at subr_kdb.c, wonder
>> maybe kdb_dbbe_set is not set?  seems kdb_dbbe_set is not referenced
>> anywhere, not sure how to get it right.
>>
>> thanks for shed some light ...
>>
>> On Mon, Oct 6, 2008 at 4:26 PM, Pietro Cerutti <[EMAIL PROTECTED]> wrote:
>>> -BEGIN PGP SIGNED MESSAGE-
>>> Hash: SHA512
>>>
>>> alan yang wrote:
>>> | hi, there,
>>> |
>>> | wonder people can shed some lights on remote debugging.  i have
>>> | freebsd7 configured with option DDB / KDB / GDB but after entering the
>>> | db on the target system the command gdb gives "the remote GDB backend
>>> | could not be selected".
>>> |
>>> | i browsed through the mailing list, and do find 1 similar post but
>>> | without answer.
>>> |
>>> | thanks in advance & apology if i overlooked things ...
>>>
>>> I suggest the following tutorial:
>>> http://www.lemis.com/grog/Papers/Debug-tutorial/tutorial.pdf
>>>
>>> Have fun :)
>>>
>>> |
>>> | cheers,
>>> | alan
>>> | ___
>>> | [EMAIL PROTECTED] mailing list
>>> | http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
>>> | To unsubscribe, send any mail to "[EMAIL PROTECTED]"
>>>
>>>
>>> - --
>>> Pietro Cerutti
>>> [EMAIL PROTECTED]
>>>
>>> PGP Public Key:
>>> http://gahr.ch/pgp
>>>
>>> -BEGIN PGP SIGNATURE-
>>> Version: GnuPG v2.0.9 (FreeBSD)
>>>
>>> iEYEAREKAAYFAkjqnpQACgkQwMJqmJVx945RSwCgoDb0JTr8LSFDB1vpAbGUjb76
>>> ZH0An19HpFVJJTUB5/XnyZc0pIDzgxc3
>>> =6Pdm
>>> -END PGP SIGNATURE-
>>>
>>
> ___
> [EMAIL PROTECTED] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: kgdb debugging

2008-10-07 Thread Julian Elischer

alan yang wrote:

Could people shed some light how to get remote debugging going, must
be something that i overlooked, really appreciate.

Two FreeBSD7 systems, target and development, connected with null
modem cable on each's COM1.

step 1)
-  rebuild kernel with following options:
options DDB
options KDB
options GDB

makeoptions DEBUG=-g


add hints.dev.uart.0.flags=0xc0
(or whatever it is) (see man uart or man sio)
to /boot/device.hints



step 2)
-  from development system
cd to /usr/src/sys/i386/comiple/MYKERNEL
kgdb -r /dev/cuad0 kernel.debug

it displays the following:
Switching to remote protocol
Ignoring packet error, continuing
.
Couldn't establish connection to remote target
Malformed response to offset query, timeout

step 3)
-  from targetsystem:
1.  Ctrl + Alt + Esc to go into db
2.  from db> type gdb
3.  it displays: "The remote GDB backend could not be selected"



On Mon, Oct 6, 2008 at 5:12 PM, alan yang <[EMAIL PROTECTED]> wrote:

the problem is, when entering gdb from db as described in the following:
--
Enter ing gdb from ddb
In FreeBSD you can build a kernel with support for both ddb and gdb.
You can then
change backwards and forwards between them. For example, if you're in
ddb, you can
go to gdb like this:
db> gdb
Next trap will enter GDB remote protocol mode
db> si step a single instruction to reenter ddb
--
after typing gdb command, it says: "The remote GDB backend could not
be selected"
that i am not sure what this indicates; looking at subr_kdb.c, wonder
maybe kdb_dbbe_set is not set?  seems kdb_dbbe_set is not referenced
anywhere, not sure how to get it right.

thanks for shed some light ...

On Mon, Oct 6, 2008 at 4:26 PM, Pietro Cerutti <[EMAIL PROTECTED]> wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

alan yang wrote:
| hi, there,
|
| wonder people can shed some lights on remote debugging.  i have
| freebsd7 configured with option DDB / KDB / GDB but after entering the
| db on the target system the command gdb gives "the remote GDB backend
| could not be selected".
|
| i browsed through the mailing list, and do find 1 similar post but
| without answer.
|
| thanks in advance & apology if i overlooked things ...

I suggest the following tutorial:
http://www.lemis.com/grog/Papers/Debug-tutorial/tutorial.pdf

Have fun :)

|
| cheers,
| alan
| ___
| [EMAIL PROTECTED] mailing list
| http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
| To unsubscribe, send any mail to "[EMAIL PROTECTED]"


- --
Pietro Cerutti
[EMAIL PROTECTED]

PGP Public Key:
http://gahr.ch/pgp

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (FreeBSD)

iEYEAREKAAYFAkjqnpQACgkQwMJqmJVx945RSwCgoDb0JTr8LSFDB1vpAbGUjb76
ZH0An19HpFVJJTUB5/XnyZc0pIDzgxc3
=6Pdm
-END PGP SIGNATURE-


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: kgdb debugging

2008-10-07 Thread alan yang
Could people shed some light how to get remote debugging going, must
be something that i overlooked, really appreciate.

Two FreeBSD7 systems, target and development, connected with null
modem cable on each's COM1.

step 1)
-  rebuild kernel with following options:
options DDB
options KDB
options GDB

makeoptions DEBUG=-g

step 2)
-  from development system
cd to /usr/src/sys/i386/comiple/MYKERNEL
kgdb -r /dev/cuad0 kernel.debug

it displays the following:
Switching to remote protocol
Ignoring packet error, continuing
.
Couldn't establish connection to remote target
Malformed response to offset query, timeout

step 3)
-  from targetsystem:
1.  Ctrl + Alt + Esc to go into db
2.  from db> type gdb
3.  it displays: "The remote GDB backend could not be selected"



On Mon, Oct 6, 2008 at 5:12 PM, alan yang <[EMAIL PROTECTED]> wrote:
> the problem is, when entering gdb from db as described in the following:
> --
> Enter ing gdb from ddb
> In FreeBSD you can build a kernel with support for both ddb and gdb.
> You can then
> change backwards and forwards between them. For example, if you're in
> ddb, you can
> go to gdb like this:
> db> gdb
> Next trap will enter GDB remote protocol mode
> db> si step a single instruction to reenter ddb
> --
> after typing gdb command, it says: "The remote GDB backend could not
> be selected"
> that i am not sure what this indicates; looking at subr_kdb.c, wonder
> maybe kdb_dbbe_set is not set?  seems kdb_dbbe_set is not referenced
> anywhere, not sure how to get it right.
>
> thanks for shed some light ...
>
> On Mon, Oct 6, 2008 at 4:26 PM, Pietro Cerutti <[EMAIL PROTECTED]> wrote:
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA512
>>
>> alan yang wrote:
>> | hi, there,
>> |
>> | wonder people can shed some lights on remote debugging.  i have
>> | freebsd7 configured with option DDB / KDB / GDB but after entering the
>> | db on the target system the command gdb gives "the remote GDB backend
>> | could not be selected".
>> |
>> | i browsed through the mailing list, and do find 1 similar post but
>> | without answer.
>> |
>> | thanks in advance & apology if i overlooked things ...
>>
>> I suggest the following tutorial:
>> http://www.lemis.com/grog/Papers/Debug-tutorial/tutorial.pdf
>>
>> Have fun :)
>>
>> |
>> | cheers,
>> | alan
>> | ___
>> | [EMAIL PROTECTED] mailing list
>> | http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
>> | To unsubscribe, send any mail to "[EMAIL PROTECTED]"
>>
>>
>> - --
>> Pietro Cerutti
>> [EMAIL PROTECTED]
>>
>> PGP Public Key:
>> http://gahr.ch/pgp
>>
>> -BEGIN PGP SIGNATURE-
>> Version: GnuPG v2.0.9 (FreeBSD)
>>
>> iEYEAREKAAYFAkjqnpQACgkQwMJqmJVx945RSwCgoDb0JTr8LSFDB1vpAbGUjb76
>> ZH0An19HpFVJJTUB5/XnyZc0pIDzgxc3
>> =6Pdm
>> -END PGP SIGNATURE-
>>
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: kgdb debugging

2008-10-06 Thread Pietro Cerutti

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

alan yang wrote:
| hi, there,
|
| wonder people can shed some lights on remote debugging.  i have
| freebsd7 configured with option DDB / KDB / GDB but after entering the
| db on the target system the command gdb gives "the remote GDB backend
| could not be selected".
|
| i browsed through the mailing list, and do find 1 similar post but
| without answer.
|
| thanks in advance & apology if i overlooked things ...

I suggest the following tutorial:
http://www.lemis.com/grog/Papers/Debug-tutorial/tutorial.pdf

Have fun :)

|
| cheers,
| alan
| ___
| [EMAIL PROTECTED] mailing list
| http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
| To unsubscribe, send any mail to "[EMAIL PROTECTED]"


- --
Pietro Cerutti
[EMAIL PROTECTED]

PGP Public Key:
http://gahr.ch/pgp

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (FreeBSD)

iEYEAREKAAYFAkjqnpQACgkQwMJqmJVx945RSwCgoDb0JTr8LSFDB1vpAbGUjb76
ZH0An19HpFVJJTUB5/XnyZc0pIDzgxc3
=6Pdm
-END PGP SIGNATURE-
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


kgdb debugging

2008-10-06 Thread alan yang
hi, there,

wonder people can shed some lights on remote debugging.  i have
freebsd7 configured with option DDB / KDB / GDB but after entering the
db on the target system the command gdb gives "the remote GDB backend
could not be selected".

i browsed through the mailing list, and do find 1 similar post but
without answer.

thanks in advance & apology if i overlooked things ...

cheers,
alan
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"