From: Zack Rusin Date: Tue, 19 Apr 2011 20:44:46 +0000 (-0400) Subject: Output all warnings in the : : format. X-Git-Tag: 2.0_alpha^2~1044 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20bc32d0686a17df0d655738a7a0516dbedadde7;p=tools%2Fapitrace.git Output all warnings in the : : format. --- diff --git a/glretrace.hpp b/glretrace.hpp index a579d58..9fa7ae7 100644 --- a/glretrace.hpp +++ b/glretrace.hpp @@ -57,7 +57,7 @@ extern const char *snapshot_prefix; extern unsigned dump_state; void -checkGlError(void); +checkGlError(int callIdx = -1); void state_dump(std::ostream &os); diff --git a/glretrace.py b/glretrace.py index 0040d58..345e154 100644 --- a/glretrace.py +++ b/glretrace.py @@ -149,7 +149,7 @@ class GlRetracer(Retracer): print ' glretrace::insideGlBeginEnd = true;' else: # glGetError is not allowed inside glBegin/glEnd - print ' glretrace::checkGlError();' + print ' glretrace::checkGlError(call.no);' def extract_arg(self, function, arg, arg_type, lvalue, rvalue): if function.name in self.array_pointer_function_names and arg.name == 'pointer': diff --git a/glretrace_main.cpp b/glretrace_main.cpp index d0fb578..6d42cb5 100644 --- a/glretrace_main.cpp +++ b/glretrace_main.cpp @@ -55,7 +55,7 @@ const char *snapshot_prefix = NULL; unsigned dump_state = ~0; void -checkGlError(void) { +checkGlError(int callIdx) { if (benchmark || insideGlBeginEnd) { return; } @@ -65,6 +65,10 @@ checkGlError(void) { return; } + if (callIdx >= 0) { + std::cerr << callIdx << ": "; + } + std::cerr << "warning: glGetError() = "; switch (error) { case GL_INVALID_ENUM: diff --git a/retrace.py b/retrace.py index 3a6c0f9..4f45055 100644 --- a/retrace.py +++ b/retrace.py @@ -269,7 +269,7 @@ class Retracer: string_switch('name', func_dict.keys(), handle_case) print ' if (retrace::verbosity >= 0)' - print ' std::cerr << "warning: unknown call " << call.name() << "\\n";' + print ' std::cerr << call.no << ": warning: unknown call " << call.name() << "\\n";' print ' return false;' print '}' print