简体   繁体   中英

What does GDB use for interactivity?

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?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM