How to make cgdb show build code?

I cannot find a way for cgdb to disassemble the binary and show the assembly code with the current instruction in the code window. Is it possible, and which command to use? I am using Mac OS X and getting cgdb from the homebrew repository.

+6
source share
3 answers

display/i $pc always shows disassembly for the current command in the console window.

To show disassembly for additional instructions, the prefix i with the number of instructions.

For instance,

 display/5i $pc 

always shows disassembly for the next 5 instructions.

+4
source

The latest update (February 2017) in cgdb allows you to do this. You will need cgdb version 0.7.0 or later. (At the time of writing, this is the latest release). You may need to compile this from the original source, given how recent it is.

More information about adding disassembly support can be found here: https://github.com/cgdb/cgdb/issues/44

To view the disassembly in cgdb, press esc and type :set dis enter .

To return to the original (if available), repeat this, except for the type :set nodis .

+2
source

I am working on MacOS to defuse a binary bomb and find "gdb-tui" . What I find "cgdb" , you can make the code bright. But what we want to see is the disassembled disassembled code in the code window, the answer above shows only the code of the line by line or only unchanged lines.

Unfortunately, I found a message that " cgdb does not support showing the assembly (yet). Https://groups.google.com/forum/#!topic/cgdb-users/E-jZCJiBAQQ

  Sorry guys, cgdb does not support assembly display (yet). It a frequently requested feature, and when we get a little more time to work on cgdb we will probably add this. Starting cgdb with the -tui option is a bad idea -- the TUI (text user interface) is an alternative curses interface to gdb, not a part of cgdb. It will not play nice with cgdb. Mike -- Mike Mueller 

Well, this is 12/11/15, but it seems that so far it has not been possible to show the assembly code in the code window, for example gdb in tui mode.

0
source

Source: https://habr.com/ru/post/907654/


All Articles