[Crash-utility] Problem with disassembling functions that use BUG()

Kurtis D. Rader kdrader at us.ibm.com
Mon Mar 6 19:23:15 UTC 2006


On Mon, 2006-03-06 14:05:38, Dave Anderson wrote:
> 
> >> #define BUG()                           \
> >>  __asm__ __volatile__(  "ud2\n"         \
> >>                         "\t.word %c0\n" \
> >>                         "\t.long %c1\n" \
> >>                          : : "i" (__LINE__), "i" (__FILE__))
> >>
> 
> > Ideally it should be handled in the gdb code, which is what's screwing it up.
> 
> Actually, I can't really blame it on gdb either.  How can gdb be expected
> to recognize this kind of asm-generated code sequence?

Exactly.  It can't. 

This is a huge annoyance for myself since I regularly find myself looking
at the disassembly of functions with BUG() calls.  I've talked about this
with my team and members of the IBM Linux Technology Center. Everyone
agrees that the current mechanism is a neat hack but causes more pain
than it's worth with respect to the space saved.  Unfortunately, no one
has been willing to take up this battle on LKML.

So I've simply thrown up my hands in defeat and resort to hacking the
source to replace the __LINE__ and __FILE__ data with noops then building
a custom kernel to use for debugging.

-- 
Kurtis D. Rader, Level 3 Linux Support
ABC Service Center, Linux Change Team
T/L 775-3714, DID +1 503-578-3714




More information about the Crash-utility mailing list