Reputation: 3654
I am developing an application similar to GDB in interactivity and appearance, and I was wondering what GDB currently does.
Does all GDB do (in terms of appearance and usability) is merely clear the screen, show a prompt and position the cursor after it, and wait for user input? Is there anything else I should be aware of?
Upvotes: 0
Views: 104
Reputation: 49463
GDB is opensource, so they hide nothing and anything you want to know can be found out on the internet. Most anything you want to discover can be gotten from the GDB documentation or directly from the source.
Note the link to the technical details of the interworkings of GDB.
From the documentation:
GDB has several user interfaces, of which the traditional command-line interface is perhaps the most familiar
So you can launch it with just gdb
and get an interactive mode
VirtualBox:~$ gdb
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
...
(gdb)
or add your program to it:
VirtualBox:~$ gdb
./example
...same stuff...
(gdb)
So as far as appearnce for these normal use cases, it doesn't clear the screen, it just starts outputting data. But there are piles of ways of using it and arguements you can pass. You should run gdb -help
to give you some ideas.
Upvotes: 2
Reputation: 35580
if you use the 'layout' commands to get multiple windows, it is using curses for screen management. See the source. The simpler command line mode is likely doing exactly what you describe.
Upvotes: 1