Skip to content

Commit

Permalink
fix empty frame causes the ui to crash/black screen cs01#216
Browse files Browse the repository at this point in the history
  • Loading branch information
cs01 committed Jul 15, 2018
1 parent 1b67692 commit 4099fa3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions gdbgui/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def get_ssl_context(private_key, certificate): # noqa


class ColorFormatter(logging.Formatter):

def format(self, record):
color = "\033[1;0m"
if not USING_WINDOWS and sys.stdout.isatty():
Expand Down Expand Up @@ -499,7 +498,6 @@ def credentials_are_valid(username, password):


def authenticate(f):

@wraps(f)
def wrapper(*args, **kwargs):
if app.config.get("gdbgui_auth_user_credentials") is not None:
Expand Down Expand Up @@ -531,6 +529,7 @@ def gdbgui():
add_csrf_token_to_session()

THEMES = ["monokai", "light"]
# fmt: off
initial_data = {
"gdbgui_version": __version__,
"interpreter": interpreter,
Expand All @@ -546,6 +545,7 @@ def gdbgui():
"csrf_token": session["csrf_token"],
"using_windows": USING_WINDOWS,
}
# fmt: on

return render_template(
"gdbgui.html",
Expand Down
6 changes: 2 additions & 4 deletions gdbgui/src/js/Threads.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class Threads extends React.Component {
row_data = Threads.get_row_data_for_stack(
stack,
this.state.selected_frame_num,
thread.frame.addr,
thread.id,
is_current_thread_being_rendered
);
Expand Down Expand Up @@ -96,7 +95,7 @@ class Threads extends React.Component {
// is the full stack of the selected thread
if (is_current_thread_being_rendered) {
for (let frame of stack_data) {
if (frame.addr === cur_frame.addr) {
if (frame && cur_frame && frame.addr === cur_frame.addr) {
return stack_data;
}
}
Expand Down Expand Up @@ -191,7 +190,6 @@ class Threads extends React.Component {
static get_row_data_for_stack(
stack,
selected_frame_num,
paused_addr,
thread_id,
is_current_thread_being_rendered
) {
Expand All @@ -202,7 +200,7 @@ class Threads extends React.Component {
selected_frame_num === frame_num && is_current_thread_being_rendered;
row_data.push(
Threads.get_frame_row(
frame,
frame || {},
is_selected_frame,
thread_id,
is_current_thread_being_rendered,
Expand Down
1 change: 0 additions & 1 deletion gdbgui/statemanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@


class StateManager(object):

def __init__(self, config):
self.controller_to_client_ids = defaultdict(
list
Expand Down

0 comments on commit 4099fa3

Please sign in to comment.