Skip to content

Commit

Permalink
Added terminal toggle button
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanrhu committed Jan 21, 2020
1 parent 578212a commit fecd441
Show file tree
Hide file tree
Showing 16 changed files with 119 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
*.sublime-project
*.sublime-workspace
*.code-workspace
.vscode
__pycache__
*.pyc
2 changes: 2 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[MASTER]
init-hook='import sys; sys.path.append("python-libs")'
Binary file added .swo
Binary file not shown.
Binary file added .swp
Binary file not shown.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GDBFrontend is an easy, flexible and extensionable gui debugger.
[![Donate](http://img.shields.io/liberapay/receives/EvrenselKisilik.svg?logo=liberapay&style=flat-square)](https://liberapay.com/EvrenselKisilik/donate)
[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Foguzhaneroglu.com%2Fprojects%2Fgdb-frontend%2F)](https://twitter.com/intent/tweet?text=&url=https%3A%2F%2Fgithub.com%2Frohanrhu%2Fgdb-frontend)

![gdb-frontend](https://oguzhaneroglu.com/static/images/gdbfrontend-ss.png "gdb-frontend")
![gdb-frontend](https://oguzhaneroglu.com/static/images/gdbfrontend-ss2.png "gdb-frontend")

## Installing

Expand Down Expand Up @@ -118,7 +118,10 @@ tmux kill-session -t gdb-frontend
You can add break point a line and step it once, then you will see sources from linked object hereafter during the session.

## Windows
In fact, gdb-frontend is able to run on Windows but there are some serious issues in the GDB's Windows version those avoid using gdb-frontend on Windows.
In fact, gdb-frontend is able to run on Windows but there are some serious issues in the GDB's Windows version those avoid using gdb-frontend on Windows. Of course you can use gdb-frontend on WSL if you are using Windows 10.

## WSL
You can use gdb-frontend on WSL (Windows Subsystem for Linux).

### Issues about Windows-GDB

Expand All @@ -135,6 +138,9 @@ API Documentation is TODO yet.
## Plugin Development
There is an example plugin `hello` in `plugins/` directory.

## Contributing
You can contribute with commiting to project or developing a plugin. All commits are welcome.

## Donate
You can donate to support the project.

Expand Down
6 changes: 3 additions & 3 deletions api/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def threadSafe(callback):
otherwise it appends callback to gdb's event-loop
and blocks caller thread until callback finish.
Usage:
@api.debug.threadSafe
def threadSafeFunction():
Usage:\n
@api.debug.threadSafe\n
def threadSafeFunction():\n
pass
"""

Expand Down
2 changes: 1 addition & 1 deletion frontend/components/FileBrowser/css/FileBrowser.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}

.FileBrowser_window_box_header_line {
background: #3465a4;
background: rgb(0, 27, 61);
position: relative;
height: 40px;
color: white;
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/FileTabs/css/FileTabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
display: flex;
flex: 0;
min-height: 20px;
border: 1px solid rgba(255,255,255,0.05);
border: 1px solid rgba(163, 163, 163, 0.05);
border-bottom: 0px;
border-top: 0px;
cursor: pointer;
Expand Down Expand Up @@ -70,7 +70,7 @@
}

.FileTabs_tabs_items_item.FileTabs_tabs_items_item__current {
background: rgb(0, 36, 81);
background: rgba(255, 255, 255, 0.1);
}

.FileTabs_tabs_items_item.FileTabs_tabs_items_item__current .FileTabs_tabs_items_closeBtn {
Expand Down
1 change: 1 addition & 0 deletions frontend/components/FuzzyFinder/js/FuzzyFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
data.onSelected = parameters.onSelected;
}

data.clear();
$fuzzyFinder.show();
data.$fuzzyFinder_box_input_rI.focus();
};
Expand Down
54 changes: 42 additions & 12 deletions frontend/components/GDBFrontend/css/GDBFrontend.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,45 @@
top: 0px;
height: 100%;
width: 100%;
background: #00295c;
}

.GDBFrontend_terminal {
position: relative;
height: 200px;
}

.GDBFrontend_terminal_terminal {
position: relative;
height: 100%;
}

.GDBFrontend_terminalOpenBtn {
position: absolute;
right: 0px;
bottom: 0px;
background: white;
color: rgba(0,0,0,0.7);
text-align: center;
padding: 5px 10px;
display: none;
cursor: pointer;
z-index: 2000;
}

.GDBFrontend_terminalCloseBtn {
position: absolute;
right: 17px;
top: 0px;
background: white;
color: rgba(0,0,0,0.7);
text-align: center;
padding: 5px 10px;
display: none;
cursor: pointer;
z-index: 2000;
}

.GDBFrontend_terminal_iframe {
border: 0px;
width: 100%;
Expand Down Expand Up @@ -104,7 +137,7 @@
user-select: none;
flex-shrink: 0;
height: 50px;
background: #3465a4;
background: rgba(0, 0, 0, 0.5);
position: relative;
z-index: 2500;
}
Expand Down Expand Up @@ -155,19 +188,16 @@

.GDBFrontend_layout_middle_left {
font-size: 14px;

width: 210px;
overflow: hidden;
border-right: 1px solid rgba(0,0,0,0.1);
background: rgba(0,0,0,0.1);
background: rgba(0,0,0,0.3);
}

.GDBFrontend_layout_middle_right {
font-size: 14px;
width: 250px;
width: 300px;
overflow: hidden;
border-left: 1px solid rgba(0,0,0,0.1);
background: rgba(0,0,0,0.1);
background: rgba(0,0,0,0.3);
position: relative;
}

Expand All @@ -181,8 +211,8 @@
}

.GDBFrontend_layout_bottom {
position: relative;
flex-shrink: 0;
height: 200px;
overflow: hidden;
}

Expand Down Expand Up @@ -212,7 +242,7 @@
top: 50px;
right: 0px;
width: 200px;
background: #3465a4;
background: #25324c;
display: none;
}

Expand All @@ -230,16 +260,16 @@ a.GDBFrontend_layout_top_menuBtn_openable_items_item:visited {
display: block;
color: white;
padding: 10px 10px;
border-bottom: 1px solid rgba(255,255,255,0.2);
border-bottom: 1px solid rgba(255,255,255,0.05);
cursor: pointer;
}

.GDBFrontend_layout_top_menuBtn_openable_items_item:hover {
background: rgba(255,255,255,0.2);
}

.GDBFrontend_layout_top_menuBtn_label:hover {
background: rgba(0,0,0,0.1);
.GDBFrontend_layout_top_menuBtn:hover .GDBFrontend_layout_top_menuBtn_label {
background: rgba(255,255,255,0.1);
}

.GDBFrontend_layout_top_exitBtn {
Expand Down
45 changes: 44 additions & 1 deletion frontend/components/GDBFrontend/js/GDBFrontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
data.$GDBFrontend_load_connectBtn_openable_connectBtn = data.$GDBFrontend_load_connectBtn_openable.find('.GDBFrontend_load_connectBtn_openable_connectBtn');

data.$GDBFrontend_terminal = $gdbFrontend.find('.GDBFrontend_terminal');
data.$GDBFrontend_terminal_terminal = data.$GDBFrontend_terminal.find('.GDBFrontend_terminal_terminal');
data.$GDBFrontend_terminalOpenBtn = $gdbFrontend.find('.GDBFrontend_terminalOpenBtn');
data.$GDBFrontend_terminalCloseBtn = $gdbFrontend.find('.GDBFrontend_terminalCloseBtn');

data.$GDBFrontend_runtimeControls = $gdbFrontend.find('.GDBFrontend_runtimeControls');
data.$GDBFrontend_runtimeControls_btn__run = data.$GDBFrontend_runtimeControls.find('.GDBFrontend_runtimeControls_btn__run');
Expand Down Expand Up @@ -99,6 +102,8 @@

data.qWebChannel = false;

data.is_terminal_opened = false;

data.debug.getBreakpoint = function (parameters) {
var bp = false;
var bp_i = false;
Expand Down Expand Up @@ -358,11 +363,13 @@
if (GDBFrontend.gui_mode == GDBFrontend.GUI_MODE_WEB_TMUX) {
var $iframe = $('<iframe></iframe>');
$iframe.addClass('GDBFrontend_terminal_iframe');
$iframe.appendTo(data.$GDBFrontend_terminal);
$iframe.appendTo(data.$GDBFrontend_terminal_terminal);
$iframe.attr('src', 'http://'+GDBFrontend.config.host_address+':'+GDBFrontend.config.gotty_port);
$gdbFrontend_layout_bottom.show();
data.is_terminal_opened = true;
} else {
$gdbFrontend_layout_bottom.hide();
data.is_terminal_opened = false;
}

data.$gdbFrontend_watches.Watches();
Expand Down Expand Up @@ -1267,6 +1274,42 @@
});
});

$gdbFrontend_layout_bottom.on('mouseover.GDBFrontend', function (event) {
data.$GDBFrontend_terminalCloseBtn.show();
});

data.$GDBFrontend_terminal.on('mouseout.GDBFrontend', function (event) {
data.$GDBFrontend_terminalCloseBtn.hide();
});

data.$GDBFrontend_terminalOpenBtn.on('click.GDBFrontend', function (event) {
data.openTerminal();
});

data.$GDBFrontend_terminalCloseBtn.on('click.GDBFrontend', function (event) {
data.closeTerminal();
});

data.openTerminal = function (parameters) {
data.is_terminal_opened = true;
data.$GDBFrontend_terminal.show();
data.$GDBFrontend_terminalOpenBtn.hide();

data.components.fileTabs.files.every(function (_file, _file_i) {
_file.ace.resize();
});
};

data.closeTerminal = function (parameters) {
data.is_terminal_opened = false;
data.$GDBFrontend_terminal.hide();
data.$GDBFrontend_terminalOpenBtn.show();

data.components.fileTabs.files.every(function (_file, _file_i) {
_file.ace.resize();
});
};

data.comply = function (parameters) {
if (parameters === undefined) {
parameters = {};
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/StackTrace/css/StackTrace.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
}

.StackTrace_items_item.StackTrace__current {
background: rgba(58, 195, 48, 0.5);
background: rgba(0, 45, 170, 0.5);
}

.StackTrace_items_item_num_val {
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/ThreadsEditor/css/ThreadsEditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
}

.ThreadsEditor_items_item.ThreadsEditor__current {
background: rgba(58, 195, 48, 0.5);
background: rgba(0, 45, 170, 0.5);
}

.ThreadsEditor_items_item_num_val {
Expand Down
3 changes: 1 addition & 2 deletions frontend/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ body {
color: white;
text-align: left;
line-height: 100%;
background: #142648;
font-family: 'SourceSansPro Regular';
font-size: 16px;
}
Expand Down Expand Up @@ -114,7 +113,7 @@ img {
.button1 {
height: 34px;
padding: 0px 10px;
background: rgba(0,0,0,0.5);
background: rgba(255,255,255,0.1);
display: inline-flex;
border-radius: 2px;
cursor: pointer;
Expand Down
10 changes: 10 additions & 0 deletions frontend/templates/modules/main/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,18 @@
</div>
<div class="GDBFrontend_layout_bottom">
<div class="GDBFrontend_terminal">
<div class="GDBFrontend_terminal_terminal">
</div>
</div>
<div class="GDBFrontend_terminalCloseBtn">
<i class="icofont-simple-down"></i>
Hide Terminal
</div>
</div>
<div class="GDBFrontend_terminalOpenBtn">
<i class="icofont-simple-up"></i>
Show Terminal
</div>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion statics.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Licensed under GNU/GPLv3
# Copyright (C) 2019, Oğuzhan Eroğlu (https://oguzhaneroglu.com/) <[email protected]>

VERSION = [0, 0, 11, "alpha"]
VERSION = [0, 0, 12, "alpha"]

"""
GDB-Frontend GUI modes.
Expand Down

0 comments on commit fecd441

Please sign in to comment.