diff --git a/.gitignore b/.gitignore index 7164e20..30a3084 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ *.sublime-project *.sublime-workspace +*.code-workspace +.vscode __pycache__ *.pyc \ No newline at end of file diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 0000000..8352f5e --- /dev/null +++ b/.pylintrc @@ -0,0 +1,2 @@ +[MASTER] +init-hook='import sys; sys.path.append("python-libs")' \ No newline at end of file diff --git a/.swo b/.swo new file mode 100644 index 0000000..bd8fad2 Binary files /dev/null and b/.swo differ diff --git a/.swp b/.swp new file mode 100644 index 0000000..82ec2f3 Binary files /dev/null and b/.swp differ diff --git a/README.md b/README.md index b117f0f..2fff6b0 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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. diff --git a/api/debug.py b/api/debug.py index 67c283b..c6860ae 100644 --- a/api/debug.py +++ b/api/debug.py @@ -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 """ diff --git a/frontend/components/FileBrowser/css/FileBrowser.css b/frontend/components/FileBrowser/css/FileBrowser.css index 6a67d53..b91c5ef 100644 --- a/frontend/components/FileBrowser/css/FileBrowser.css +++ b/frontend/components/FileBrowser/css/FileBrowser.css @@ -48,7 +48,7 @@ } .FileBrowser_window_box_header_line { - background: #3465a4; + background: rgb(0, 27, 61); position: relative; height: 40px; color: white; diff --git a/frontend/components/FileTabs/css/FileTabs.css b/frontend/components/FileTabs/css/FileTabs.css index ec1ce22..21df134 100644 --- a/frontend/components/FileTabs/css/FileTabs.css +++ b/frontend/components/FileTabs/css/FileTabs.css @@ -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; @@ -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 { diff --git a/frontend/components/FuzzyFinder/js/FuzzyFinder.js b/frontend/components/FuzzyFinder/js/FuzzyFinder.js index de67e16..90aa190 100644 --- a/frontend/components/FuzzyFinder/js/FuzzyFinder.js +++ b/frontend/components/FuzzyFinder/js/FuzzyFinder.js @@ -63,6 +63,7 @@ data.onSelected = parameters.onSelected; } + data.clear(); $fuzzyFinder.show(); data.$fuzzyFinder_box_input_rI.focus(); }; diff --git a/frontend/components/GDBFrontend/css/GDBFrontend.css b/frontend/components/GDBFrontend/css/GDBFrontend.css index 941acff..030e2cc 100644 --- a/frontend/components/GDBFrontend/css/GDBFrontend.css +++ b/frontend/components/GDBFrontend/css/GDBFrontend.css @@ -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%; @@ -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; } @@ -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; } @@ -181,8 +211,8 @@ } .GDBFrontend_layout_bottom { + position: relative; flex-shrink: 0; - height: 200px; overflow: hidden; } @@ -212,7 +242,7 @@ top: 50px; right: 0px; width: 200px; - background: #3465a4; + background: #25324c; display: none; } @@ -230,7 +260,7 @@ 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; } @@ -238,8 +268,8 @@ a.GDBFrontend_layout_top_menuBtn_openable_items_item:visited { 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 { diff --git a/frontend/components/GDBFrontend/js/GDBFrontend.js b/frontend/components/GDBFrontend/js/GDBFrontend.js index b1ce698..f5a4208 100644 --- a/frontend/components/GDBFrontend/js/GDBFrontend.js +++ b/frontend/components/GDBFrontend/js/GDBFrontend.js @@ -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'); @@ -99,6 +102,8 @@ data.qWebChannel = false; + data.is_terminal_opened = false; + data.debug.getBreakpoint = function (parameters) { var bp = false; var bp_i = false; @@ -358,11 +363,13 @@ if (GDBFrontend.gui_mode == GDBFrontend.GUI_MODE_WEB_TMUX) { var $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(); @@ -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 = {}; diff --git a/frontend/components/StackTrace/css/StackTrace.css b/frontend/components/StackTrace/css/StackTrace.css index 1870829..5e905e7 100644 --- a/frontend/components/StackTrace/css/StackTrace.css +++ b/frontend/components/StackTrace/css/StackTrace.css @@ -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 { diff --git a/frontend/components/ThreadsEditor/css/ThreadsEditor.css b/frontend/components/ThreadsEditor/css/ThreadsEditor.css index 6074c11..9216c27 100644 --- a/frontend/components/ThreadsEditor/css/ThreadsEditor.css +++ b/frontend/components/ThreadsEditor/css/ThreadsEditor.css @@ -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 { diff --git a/frontend/css/main.css b/frontend/css/main.css index 7718b29..bfff475 100644 --- a/frontend/css/main.css +++ b/frontend/css/main.css @@ -32,7 +32,6 @@ body { color: white; text-align: left; line-height: 100%; - background: #142648; font-family: 'SourceSansPro Regular'; font-size: 16px; } @@ -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; diff --git a/frontend/templates/modules/main/main.html b/frontend/templates/modules/main/main.html index 1a8c67a..d269fe1 100644 --- a/frontend/templates/modules/main/main.html +++ b/frontend/templates/modules/main/main.html @@ -212,8 +212,18 @@
+
+
+
+
+ + Hide Terminal
+
+ + Show Terminal +
diff --git a/statics.py b/statics.py index f9de006..c8313d4 100644 --- a/statics.py +++ b/statics.py @@ -8,7 +8,7 @@ # Licensed under GNU/GPLv3 # Copyright (C) 2019, Oğuzhan Eroğlu (https://oguzhaneroglu.com/) -VERSION = [0, 0, 11, "alpha"] +VERSION = [0, 0, 12, "alpha"] """ GDB-Frontend GUI modes.