Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def main():
"""Entry point from command line"""
parser = get_parser()
args = parser.parse_args()
if args.debug:
logger.setLevel(logging.NOTSET)
if args.version:
print(__version__)
return
cmd = args.cmd or args.args
if args.no_browser and args.browser:
print("Cannot specify no-browser and browser. Must specify one or the other.")
exit(1)
app.config["initial_binary_and_args"] = cmd
app.config["gdb_args"] = shlex.split(args.gdb_args)
app.config["rr"] = args.rr
app.config["gdb_path"] = args.gdb
app.config["gdbgui_auth_user_credentials"] = get_gdbgui_auth_user_credentials(
args.auth_file, args.user, args.password
)
app.config["project_home"] = args.project
def gdbgui():
"""Render the main gdbgui interface"""
interpreter = "lldb" if app.config["LLDB"] else "gdb"
gdbpid = request.args.get("gdbpid", 0)
initial_gdb_user_command = request.args.get("initial_gdb_user_command", "")
add_csrf_token_to_session()
THEMES = ["monokai", "light"]
# fmt: off
initial_data = {
"csrf_token": session["csrf_token"],
"gdbgui_version": __version__,
"gdbpid": gdbpid,
"initial_gdb_user_command": initial_gdb_user_command,
"interpreter": interpreter,
"initial_binary_and_args": app.config["initial_binary_and_args"],
"project_home": app.config["project_home"],
"remap_sources": app.config["remap_sources"],
"rr": app.config["rr"],
"themes": THEMES,
"signals": SIGNAL_NAME_TO_OBJ,
"using_windows": USING_WINDOWS,
}
# fmt: on
return render_template(
"gdbgui.html",
version=__version__,
def main():
binary_name = "gdbgui_%s" % __version__
spec_path = "gdbgui.spec"
write_spec_with_gdbgui_version_in_name(spec_path, binary_name)
subprocess.call(
[
"pyinstaller",
spec_path,
"--distpath",
os.path.join("executable", platform_dir),
"--key",
"a5s1fe65aw41f54sa64v6b4ds98fhea98rhg4etj4et78ku4yu87mn",
]