[unios] Re: Priorities

Srikant Sharma (Chiku) srikants@wipinfo.soft.net
Sat, 5 Dec 1998 21:35:43 +0000 (GMT)


From: "Srikant Sharma (Chiku)" <srikants@wipinfo.soft.net>

On Fri, 4 Dec 1998, Pat Wendorf wrote:

> From: Pat Wendorf <beholder@ican.net>
> 
> > considering performance ....... c and c++ there is no difference ....
> > but from my personal experience i have learnt that it is VERY
> > difficult to 'debug' Kernel code written in C++ ...
> >
> 
> Why so?
> 
> Not a criticism, just an honest question.  I myself, have not programed a
> kernel from the ground up (unlike almost the entire rest of you :).  
> So I'm not sure on the specifics.
> 

The reasons are two fold ....
 In Kernel we can't do source level debugging. (At least I have not
 seen any source level debugger. If I can get one .. I will be too 
 happy to have it.)  So comparitively C code can be easily corelated
 with what ever assembly code we can see. (i.e auto variable declaration
 in kernel stack , loops execution flow etc.)

 Secondly all C++ method names get changed to some mangled kind of names

e.g.  Consider a class  "Example"  and a method "MyEx" in this class 

	this routine can be symbolically represented as something like this

	"asmgExampleQwdMyEx" . Now imagine debugging in the kernel and you 
	see that you are jumping to asmgExampleQwdMyEx . What can you make 
	out of it ?  May be if you have 10/15 classes you can make out the
	details but what do you do in case of 100s of classes ?

To give you some more examples I am doing some cut'n'paste from a portion of my 
driver which is partly written in C++ :

__0fISpinLockEInitv , __0oIArrayTOC76HChannel_d . This portion is written by 
some other developer. While doing the Kernel debugging when I encounter such
symbols tell me where should I look ? In this case we have to resort to crude
methods  like searching some sensible strings like "SpinLock" through the
entire code and then go thru all the maching methods ....

That's why me and my fellow developers get annoyed when we come across C++
portion of our kernel/driver code. 

Performance wise I repeat I have never seen any noticeable difference.

Hope I am clear.
--
Srikant




------------------------------------------------------------------------
Help support ONElist, while generating interest in your product or
service. ONElist has a variety of advertising packages. Visit
http://www.onelist.com/advert.html for more information.
------------------------------------------------------------------------
UniOS Group
http://members.xoom.com/unios