BUG() places console in sync mode.
Quoted 8 lines · Xen patchbot-unstable
# HG changeset patch
# User [email protected]
# Node ID1d17ddd9e45d25e1b5fc21e558a4973b70572334# Parent25c6ea6d4024c86c2dfd54ef9f44c793e7346ee8[XEN]BUG()places console in sync mode.
Also move the BUG code out of line.
Original patch from Jimi Xenidis.
diff -r25c6ea6d4024-r1d17ddd9e45dxen/include/xen/lib.h
[...]
Quoted 1 line
+extern void
__bug(char *file, int line)__attribute__((noreturn));
I can understand panic() being "noreturn", which it isn't, but __bug() should not, since It should result in some debugging logic (gdb, xmon, whatever) that could potentially continue.
-JX
Quoted 8 lines · Jimi Xenidis
Quoted 4 lines
[XEN]
BUG()places console in sync mode.
Also move the BUG code out of line.
Original patch from Jimi Xenidis.
diff -r25c6ea6d4024-r1d17ddd9e45dxen/include/xen/lib.h[...]
Quoted 1 line
+extern void
__bug(char *file, int line)__attribute__((noreturn));I can understand
panic()being "noreturn", which it isn't, but__bug()should not, since It should result in some debugging logic (gdb, xmon, whatever) that could potentially continue.
Is it used in any contexts other than where some pretty serious error has occurred and all you want to do is postmortem? I don't think continuing would ever be be helpful or sane.
-- Keir
Quoted 6 lines · Keir Fraser
Quoted 2 lines · Jimi Xenidis
I can understand
panic()being "noreturn", which it isn't, but__bug()should not, since It should result in some debugging logic (gdb, xmon, whatever) that could potentially continue.Is it used in any contexts other than where some pretty serious error has occurred and all you want to do is postmortem? I don't think continuing would ever be be helpful or sane.
So:
panic(): STOP but eventually reboot
__bug(): STOP and loop forever for postmortem/debugging cannot be
suppressed
ASSERT(): STOP but can be suppressed (!NDEBUG )
Panic is very serious, but BUG and ASSERT, to me, are used to indicate some error in programming logic, if that error can be "fixed" during a debugging session then the ability to continue is quite valuable, especially if it takes a long time ot get to the BUG().
if it is not BUG, then perhaps we can introduce something like BREAKPOINT() that can be used for this purpose?
-JX
Quoted 1 line · Jimi Xenidis
Panic is very serious, but BUG and ASSERT, to me, are used to indicate some error in programming logic, if that error can be "fixed" during a debugging session then the ability to continue is quite valuable, especially if it takes a long time ot get to the
BUG().
I really can't conceive a situation where it would be handy to be able to rectify a bug from within a debugger in order to carry on executing. I've never wanted to do that.
Quoted 1 line
if it is not BUG, then perhaps we can introduce something like
BREAKPOINT()that can be used for this purpose?
Sure.
-- Keir