Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging USBCDCEthernet Driver



Hello Kapil,

On Oct 13, 2003, at 1:56 AM, Kapil Bharati Langer wrote:

Received: from blr-ec-msg02.wipro.com ([10.200.51.99]) by
blr-ec-bh2.wipro.com with Microsoft SMTPSVC(5.0.2195.5329); Mon, 13
Oct 2003 14:19:33 +0530
Received: from wipro.com ([192.151.103.207]) by blr-ec-msg02.wipro.com
with Microsoft SMTPSVC(5.0.2195.5329); Mon, 13 Oct 2003 14:19:33 +0530
Date: Mon, 13 Oct 2003 14:26:49 +0530
Mime-Version: 1.0 (Apple Message framework v552)
Content-Type: text/plain; charset="us-ascii"
Subject: Debugging USBCDCEthernet Driver
From: Kapil Bharati Langer <email@hidden>
To: email@hidden
Message-Id: <email@hidden>
X-Mailer: Apple Mail (2.552)
Return-Path: email@hidden
X-OriginalArrivalTime: 13 Oct 2003 08:49:33.0251 (UTC)
FILETIME=[EC3B5930:01C39166]
X-Converted-To-Plain-Text: from multipart/alternative by demime 0.98b
X-Converted-To-Plain-Text: Alternative section used was text/plain


Hi all ,

I am working with the sample code provided by apple USBCDCEthernet

This driver is available at the developer site with apple.
http://developer.apple.com/samplecode/Sample_Code/Networking/
USBCDCEthernet.htm

  I need to work on this driver and get a trace of it soon. I tried
debugging the driver using two machine set up ...
the debugger is running fine .. but when i set a breakpoint in the gdb
... by giving the function name ..

(gdb)  break ' com_apple_driver_dts_USBCDCEthernet::start(IOService *)'

the command given in the two machine debugging guide on the apple site
.. the driver does not stop at the debugger ...
i suspect that the flow does not reach the point where i have set the
break point

That's a fair guess. If that's true, that means that the driver's matching personality may not be correct for your device.


You can refer to the Debugging Matching and Loading Problems section of "Writing an I/O Kit Driver" for tips:

<http://developer.apple.com/documentation/DeviceDrivers/Conceptual/ WritingDeviceDriver/DebuggingDrivers/index.html>.

Your matching criteria have to follow the USB Common Class spec, which is summarized in Technical Q&A 1076:

<http://developer.apple.com/qa/qa2001/qa1076.html>.

Other combinations of matching criteria beyond those in the spec will cause your driver not to match and ::start will not be called.


what i need to know is ... 1) is there a specific entry point function that is present in all drivers written on mac ... something apple specified

::start is called for every driver that has claimed via its .plist that it knows how to drive a particular device.


2)  is there any one who has debugged this code .. casue i need to know
the flow real fast .

This is a sample driver, which has been tested somewhat because there are very few CDC Ethernet devices out there, and even fewer that truly follow the specification.


3) apart from debugging it using two machines .. is there any other way
with which i can get a trace for this kext

See the above documentation for some tips. Just putting IOLog calls in the code and watching the system log using Console.app is the simplest technique.


4) Can i set the breakpoints in the Project builder and then try
debugging t using the two machine set up will it work.. that way.

No, it won't.


the hard way to know the entry point is to set the breakpoints at all the functions using gdb ... one of it is sure to click but it is a crude way .. any suggestions in this regard would also be encouraged.

or if anyone could suggest what could be the entry point for this
driver code .. .by having a look at it ..
I am providing the link again.

http://developer.apple.com/samplecode/Sample_Code/Networking/
USBCDCEthernet.htm

thanks in advance ..
Hope to hear from someone
regards
Kapil Bharati

Thanks, --gc _______________________________________________ usb mailing list | email@hidden Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/usb Do not post admin requests to the list. They will be ignored.

References: 
 >Debugging USBCDCEthernet Driver (From: Kapil Bharati Langer <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.