Subject: Debugging a device driver (How to?)
To: None <tech-kern@netbsd.org>
From: Riaz Randeree <RiazR@cat.co.za>
List: tech-kern
Date: 04/15/1999 10:23:59
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------ =_NextPart_001_01BE8719.50501DD0
Content-Type: text/plain


Hello

I have tried serial debugging:
On the target machine:

        options         DEBUG="-g"
        options         KGDB
        options         KGDBRATE=9600
        options         KGDBADDR=0x3f8             # yes I
am using the 1st serial port
       #options        DDB                         # needed
to be left out?

I build the kernel and netbsd & netbsd.dbg are created

I start debugging by booting the kernel with 
 

        boot netbsd.dbg -d

Then on the other machine, using 2nd serial port 

        (gdb) set remotebaud 9600
        (gdb) target remote /dev/tty01

Nothing happens. What am I missing?

Is there another way to debug a device driver?

Please help..

Thanks in Advance
Riaz


------ =_NextPart_001_01BE8719.50501DD0
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.0.1460.9">
<TITLE>Debugging a device driver (How to?)</TITLE>
</HEAD>
<BODY>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Arial">Hello</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">I have tried serial debugging:</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">On the target machine:</FONT>
</P>

<P><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
options&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
DEBUG=3D&quot;-g&quot;</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
options&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KGDB</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
options&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
KGDBRATE=3D9600</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
options&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
KGDBADDR=3D0x3f8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp; # yes I am using the 1st serial port</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
#options&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
DDB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; # needed to be left out?</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">I build the kernel and netbsd &amp; =
netbsd.dbg are created</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">I start debugging by booting the =
kernel with </FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boot =
netbsd.dbg -d</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Then on the other machine, using 2nd =
serial port </FONT>
</P>

<P><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (gdb) set =
remotebaud 9600</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (gdb) target =
remote /dev/tty01</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Nothing happens. What am I =
missing?</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Is there another way to debug a device =
driver?</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Please help..</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Thanks in Advance</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Riaz</FONT>
</P>

</BODY>
</HTML>
------ =_NextPart_001_01BE8719.50501DD0--