Messages in this thread | | | Subject | Re: Ugh in 2.1.60 | Date | Fri, 31 Oct 1997 17:30:09 +0100 (MET) | From | (Rogier Wolff) |
| |
Bill Hawes wrote: > > David Woodhouse wrote: > > Isn't it a bit difficult to get "file and line number" information? > > Personally, I liked the approach that I saw in a recent 2.1 kernel: > > > > if (code has done somthing wrong) > > *(int *)0=0; > > > > I've forgotten where it was now, but it definitely made sure the offending > > code was fixed :) > > The copy_xx_user functions are actually macros, so you can have the > compiler embed the source file name and line (__FILE__, __LINE__, I > think.) > > In this case generating an oops would be too draconian -- the code works > _most_ of the time, we just want to find it and make it 100%.
And in case they aren't macros, you can make the header file define a macro that calls the "debugging" function. For example:
#ifdef CONFIG_DEBUG_KMALLOC #define kmalloc(s,p) debug_kmalloc (__FILE__, __LINE__, s, p) #endif
Regards,
Roger.
-- ** R.E.Wolff@BitWizard.nl ** +31-15-2137555 ** http://www.BitWizard.nl/ ** Florida -- A 39 year old construction worker woke up this morning when a 109-car freight train drove over him. According to the police the man was drunk. The man himself claims he slipped while walking the dog. 080897
| |