Skip to content

Commit

Permalink
Passing initialization command via URL to be executed when opening gd…
Browse files Browse the repository at this point in the history
…bgui (cs01#254)

* Add support for passing initial command via URL to be executed when opening gdbgui
  • Loading branch information
lifanxi authored and Chad Smith committed Dec 28, 2018
1 parent e7064e8 commit f7b2303
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gdbgui/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ 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()

Expand All @@ -535,6 +536,7 @@ def gdbgui():
"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"],
"p": pbkdf2_hex(str(app.config.get("l")), "Feo8CJol")
Expand Down
3 changes: 3 additions & 0 deletions gdbgui/src/js/GdbApi.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ const GdbApi = {
const dst = initial_data.remap_sources[src];
cmds.push(`set substitute-path "${src}" "${dst}"`);
}
if (initial_data.initial_gdb_user_command) {
cmds.push(initial_data.initial_gdb_user_command);
}
GdbApi.run_gdb_command(cmds);
},
inferior_is_paused: function() {
Expand Down

0 comments on commit f7b2303

Please sign in to comment.