diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 03:01:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 03:01:46 +0000 |
commit | f8fe689a81f906d1b91bb3220acde2a4ecb14c5b (patch) | |
tree | 26484e9d7e2c67806c2d1760196ff01aaa858e8c /src/VBox/GuestHost/OpenGL/util/debug_opcodes.py | |
parent | Initial commit. (diff) | |
download | virtualbox-upstream.tar.xz virtualbox-upstream.zip |
Adding upstream version 6.0.4-dfsg.upstream/6.0.4-dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/GuestHost/OpenGL/util/debug_opcodes.py')
-rwxr-xr-x | src/VBox/GuestHost/OpenGL/util/debug_opcodes.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/VBox/GuestHost/OpenGL/util/debug_opcodes.py b/src/VBox/GuestHost/OpenGL/util/debug_opcodes.py new file mode 100755 index 00000000..cf07424a --- /dev/null +++ b/src/VBox/GuestHost/OpenGL/util/debug_opcodes.py @@ -0,0 +1,42 @@ +# Copyright (c) 2001, Stanford University +# All rights reserved. +# +# See the file LICENSE.txt for information on redistributing this software. + +from __future__ import print_function +import sys; +import string; +import re; + +import apiutil + +apiutil.CopyrightC() + +print(""" +#include "cr_debugopcodes.h" +#include <stdio.h> +""") + +print("""void crDebugOpcodes( FILE *fp, unsigned char *ptr, unsigned int num_opcodes ) +{ +\tunsigned int i; +\tfor (i = 0; i < num_opcodes; i++) +\t{ +\t\tswitch(*(ptr--)) +\t\t{ +""") + +keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") +keys.sort() + +for func_name in keys: + if "pack" in apiutil.ChromiumProps(func_name): + print('\t\tcase %s:' % apiutil.OpcodeName( func_name )) + print('\t\t\tfprintf(fp, "%s\\n"); ' % apiutil.OpcodeName( func_name )) + print( '\t\t\tbreak;') + +print(""" +\t\t} +\t} +} +""") |