You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See `https://github.com/cs01/gdbgui/tree/master/examples <https://github.com/cs01/gdbgui/tree/master/examples>`_
77
77
78
-
Options
78
+
Arguments
79
79
~~~~~~~
80
-
optional positional arguments:
81
-
``command``: (Optional) The binary and arguments to run in gdb. This is a way to script the intial loading of the inferior binary you wish to debug. For example ``gdbgui ./mybinary -myarg -flag1 -flag2``
80
+
Positional arguments:
81
+
``command``: (Optional) The binary and arguments to run in gdb. This is a way to script the intial loading of the inferior binary you wish to debug. For example ``gdbgui ./mybinary -myarg -flag1 -flag2``. Binaries and arguments can also be input through the browser interface after launching.
82
82
83
-
optional arguments:
83
+
Flags (all are optional):
84
84
-h, --help show this help message and exit
85
85
-p PORT, --port PORT The port on which gdbgui will be hosted
86
86
--host HOST The host ip address on which gdbgui serve.
@@ -89,15 +89,12 @@ optional arguments:
89
89
--debug The debug flag of this Flask application. Pass this
90
90
flag when debugging gdbgui itself to automatically
91
91
reload the server when changes are detected
92
-
--no_browser By default, the browser will open with gdb gui. Pass
92
+
-n, --no_browser By default, the browser will open with gdb gui. Pass
93
93
this flag so the browser does not open.
94
94
95
95
Compatibility
96
96
-------------
97
97
98
-
``gdbgui`` has been tested to work in these environments. It may work in
@@ -106,31 +103,41 @@ Browsers: Chrome, Firefox, Ubuntu Web Browser
106
103
107
104
Gdb: 7.7.1 (tested), 7.12 (tested), likely works with intermediate versions
108
105
109
-
Development
110
-
-----------
111
-
Contributions and bug fixes are welcome. Before creating an issue, make sure you are using the latest version of gdbgui
112
-
since it is under active development.
106
+
Contributing
107
+
------------
108
+
Creating and voting on issues in github will help me prioritize what to work on.
113
109
114
-
To get started with development, set up a new virtual environment, then
110
+
Documentation, spelling fixes, bug fixes, features, etc. are of course welcome too. To get started with development, set up a new virtual environment, then
115
111
run
116
112
117
113
::
118
114
119
115
git clone https://github.com/cs01/gdbgui
120
116
cd gdbgui
121
117
pip install -r requirements.txt
122
-
python -m gdbgui/backend.py --debug
118
+
gdbgui/backend.py --debug
119
+
120
+
If you are modifying gdbgui.js, make sure you have the developer console open so the browser doesn't cache the file and miss your changes. When ``--debug`` is passed, there is a new component at the bottom of the right sidebar that displays the raw gdb mi output to help you debug.
121
+
122
+
123
+
Testing
124
+
~~~~~~~
125
+
126
+
``make test`` runs unit tests and verifies README.rst is properly formatted.
127
+
``gdbgui/tests/test_app.py``. Add new tests there as necessary.
128
+
123
129
124
130
License
125
131
-------
126
132
This software licensed under Creative Commons Attribution-NonCommercial 3.0 for personal use. `Click here <http://grassfedcode.com/gdbguicommercial>`_ for commercial license.
127
133
134
+
pyPI and this github page are the only official sources of gdbgui. Any other sites serving gdbgui in any way should be avoided not only due to licensing issues, but due to security concerns as well.
128
135
129
136
How Does it Work?
130
137
-----------------
131
138
It uses Python to manage gdb as a subprocess. Specifically, the `pygdbmi library <https://github.com/cs01/pygdbmi>`__, which returns key/value pairs (dictionaries) that can be used to create a frontend. To make a usable frontend, first a server must made to interface with gdb. In this case, the Flask server is used, which does three things: creates a managed gdb subprocess with pygdbmi, spawns a separate thread to constantly check for output from the gdb subprocess, and creates endpoints for the browser including http requests and websocket connections.
132
139
133
-
As output is parsed in the reader thread, it is immediately sent to the frontend through the websocket. As the browser receives these websocket messages, it maintains the state of gdb (whether it's running, paused, or exited, where breakpoints are, what the stack is, etc.) and updates the DOM as appropriate. Of course, the browser also sends commands to gdb through the Flask server, which it does as needed when various buttons are pressed, or when the user enters a command-line command. The server also has access to the filesystem, so the client can show source code of any file.
140
+
As output is parsed in the reader thread, it is immediately sent to the frontend through the websocket. As the browser receives these websocket messages, it maintains the state of gdb (whether it's running, paused, or exited, where breakpoints are, what the stack is, etc.) and updates the DOM as appropriate. The browser also sends commands to gdb through a websocket to Flask server, which then passes the command to gdb. Gdb writes new output, which is picked up by the reader thread.
134
141
135
142
``gdbgui`` was designed to be easily hackable and extendable. There is
136
143
no build system necessary to run or develop this app.
@@ -145,27 +152,11 @@ The main components of gdbgui are
145
152
146
153
2. ``gdbgui.pug``: HTML file that defines the frontend
147
154
148
-
3. ``gdbgui.js``: The majority of the application is contained in this file. If dynamically updates the page, and maintains gdb state. It sends AJAX requests and uses websockets to interact with gdb through the server, then gets the response and updates the DOM as necessary.
155
+
3. ``gdbgui.js``: The majority of the application is contained in this file. It dynamically updates the page, and maintains gdb state. It sends AJAX requests and uses websockets to interact with gdb through the server, then gets the response and updates the DOM as necessary.
149
156
150
157
4. ``gdbgui.css``: css stylesheet
151
158
152
159
153
-
Testing
154
-
~~~~~~~
155
-
156
-
``python setup.py test`` runs unit tests located in
157
-
``gdbgui/tests/test_app.py``. Add new tests there as necessary.
158
-
159
-
160
-
Future Improvements
161
-
-------------------
162
-
163
-
- Hover over a variable in source code to see its value
164
-
- Embed plotting tools to plot a variable's value over time
165
-
- Assign values to variables / memory addresses
166
-
- Embed a binary/decimal/hex calculator
167
-
168
-
169
160
Screenshots
170
161
-----------
171
162
Enter the binary and args just as you'd call them on the command line. Binary is restored when gdbgui is opened at a later time.
@@ -199,16 +190,24 @@ With assembly. Note the bold line is the current instruction that gdb is stopped
199
190
200
191
201
192
Variables and Expressions
202
-
------------------------------------------------
193
+
-------------------------
194
+
195
+
All local variables are automatically displayed, and are clickable to explore their fields.
0 commit comments