mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
More diagnostic improvements.
This commit is contained in:
parent
71b3d30aa1
commit
668896aa82
2 changed files with 11 additions and 6 deletions
|
@ -55,10 +55,13 @@ struct expr_s *warning (struct expr_s *e, const char *fmt, ...)
|
|||
__attribute__ ((format (printf, 2, 3)));
|
||||
struct expr_s *notice (struct expr_s *e, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
void debug (struct expr_s *e, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
void bug (struct expr_s *e, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
void _debug (struct expr_s *e, const char *file, int line,
|
||||
const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 4, 5)));
|
||||
#define debug(e, fmt...) _debug(e, __FILE__, __LINE__, fmt)
|
||||
void _bug (struct expr_s *e, const char *file, int line, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 4, 5)));
|
||||
#define bug(e, fmt...) _bug(e, __FILE__, __LINE__, fmt)
|
||||
|
||||
//@}
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ _warning (expr_t *e, const char *fmt, va_list args)
|
|||
}
|
||||
|
||||
void
|
||||
debug (expr_t *e, const char *fmt, ...)
|
||||
_debug (expr_t *e, const char *file, int line, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
|
@ -131,6 +131,7 @@ debug (expr_t *e, const char *fmt, ...)
|
|||
dstring_t *message = dstring_new ();
|
||||
|
||||
format_message (message, "debug", e, fmt, args);
|
||||
dasprintf (message, " (%s:%d)", file, line);
|
||||
fprintf (stderr, "%s\n", message->str);
|
||||
dstring_delete (message);
|
||||
}
|
||||
|
@ -138,7 +139,7 @@ debug (expr_t *e, const char *fmt, ...)
|
|||
}
|
||||
|
||||
void
|
||||
bug (expr_t *e, const char *fmt, ...)
|
||||
_bug (expr_t *e, const char *file, int line, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
|
@ -149,6 +150,7 @@ bug (expr_t *e, const char *fmt, ...)
|
|||
dstring_t *message = dstring_new ();
|
||||
|
||||
format_message (message, "BUG", e, fmt, args);
|
||||
dasprintf (message, " (%s:%d)", file, line);
|
||||
if (bug_hook) {
|
||||
bug_hook (message->str);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue