Giter Site home page Giter Site logo

Disassembly window/mode about cgdb HOT 20 CLOSED

cgdb avatar cgdb commented on September 23, 2024 3
Disassembly window/mode

from cgdb.

Comments (20)

mikesart avatar mikesart commented on September 23, 2024 1

You should be able to hit and then type ":set dis" to get disassembly now...

from cgdb.

mikesart avatar mikesart commented on September 23, 2024

+1 on this. I've been using disassemble-next-line as workaround, but it'd sure be fantastic to have a full disassemble window... Thanks!

from cgdb.

ScoreUnder avatar ScoreUnder commented on September 23, 2024

+1 for an essential debugging feature. When you get a crash in an empty destructor, source is no help!

from cgdb.

ashwin avatar ashwin commented on September 23, 2024

+1 Disassembly and registers windows!

from cgdb.

stevenhoneyman avatar stevenhoneyman commented on September 23, 2024

+1 ...it was looking like a good frontend until I went looking for this feature

from cgdb.

akrasuski1 avatar akrasuski1 commented on September 23, 2024

+1 I discovered cgdb recently, and it's awesome. But with disassembly window instead of source it would be even better ;)

from cgdb.

oblitum avatar oblitum commented on September 23, 2024

I've been using https://github.com/cyrus-and/gdb-dashboard instead of cgdb which I used for a long time. I prefer now the dashboard, it doesn't have the nice keybindings, etc, but also, it's nearer to GDB itself and provides nice visuals.

from cgdb.

mikesart avatar mikesart commented on September 23, 2024

We've been doing some work on cgdb on this fork: https://github.com/scottlu/cgdb
One of our primary goals is to add a disassembly window. Going to take a month or two as we need to switch over to gdb/mi first.
But yeah, I've been using cgdb for several years now and I love it. Can't wait to get a disassembly window - that is the main feature I really miss.

from cgdb.

 avatar commented on September 23, 2024

Hi @mikesart, have you completed the work or are you still working on this issue? If it works now, could you please share it? I also would like to use disassembly window and register windows in the long term. I have checkout your source and run it but couldn't see if it is supported or not.

from cgdb.

mikesart avatar mikesart commented on September 23, 2024

We have to switch over to gdb/mi, and get a full window manager in. These are decently large work items, so it's going to take a bit of time. Talking with Bob and Mike (cgdb authors) about getting some of our fixes in and doing this work right now, so hopefully our work will merge here sometime fairly soon and we'll start on the disassembly window. Thanks nexus226.

from cgdb.

honggyukim avatar honggyukim commented on September 23, 2024

Hi @mikesart,

I put :set dis but it doesn't show the source window and disassembly window at the same time. The source window is switched to disassembly window. Is there any way to see both?

from cgdb.

brasko avatar brasko commented on September 23, 2024

Here is the disasm expected behavior from the docs:

This option is used to enable or disable showing assembly code in cgdb.
The default value is off. When off, CGDB will display the source code
to the user. When no source code is available, CGDB will display the
assembly code.

When this option is enabled, CGDB will display the mixed
source and assembly when the source code is enabled and assembly code
when the source code is not available. Please note that when assembly
mode is displayed, it's displayed per function instead of per file.

Is this helpful?

from cgdb.

honggyukim avatar honggyukim commented on September 23, 2024

@brasko Thanks for the comment. But it seems that it doesn't mean that :set dis shows the source code and assembly at the same time with separate windows. Please correct me if I'm wrong.

from cgdb.

mikesart avatar mikesart commented on September 23, 2024

This version added the ability to show disassembly in the source window and mixed mode source + disassembly if you're running gdb v7.11 or higher. You are correct in that it isn't in a separate window, but I believe this new functionality is extremely useful (I've been using it a lot) and I think it addresses the original bug entry, at least if you've got gdb v7.11+. When we get a full window manager in we'll be able to add separate source / disassembly / register / watch windows - some of those features are requested in bug #43. Thanks honggyukim.

from cgdb.

honggyukim avatar honggyukim commented on September 23, 2024

Ah.. I see. I've just upgraded gdb to v7.12 and found what you meant. I would love to use this feature although it doesn't have separate windows. I just put the screen so that other people can see the actual output.

 1| Dump of assembler code for function main:
 2| /home/honggyu/hello.c:
 3| 4       {
 4|    0x00000000004005bd <+0>:     push   %rbp
 5|    0x00000000004005be <+1>:     mov    %rsp,%rbp
 6|
 7| 5         printf("Hello World!
 8|    0x00000000004005c1 <+4>:     mov    $0x400674,%edi
 9|    0x00000000004005c6 <+9>:     callq  0x400490 <puts@plt>
10|
11| 6         fflush(stdout);
12+--> 0x00000000004005cb <+14>:    mov    0x200a7e(%rip),%rax        # 0x601050 <stdout@@GLIBC_2.2.5>
13|    0x00000000004005d2 <+21>:    mov    %rax,%rdi
14|    0x00000000004005d5 <+24>:    callq  0x4004c0 <fflush@plt>
15|
16| 7         return 0;
17|    0x00000000004005da <+29>:    mov    $0x0,%eax
18|
19| 8       }
20|    0x00000000004005df <+34>:    pop    %rbp
21|    0x00000000004005e0 <+35>:    retq
22| End of assembler dump.

Thanks a lot for this work!

from cgdb.

honggyukim avatar honggyukim commented on September 23, 2024

Hm.. after keep using it. It doesn't seem to be stable. I found two problems.

  1. The arrow is not properly updated as I executed a single instruction.
  2. source and assembly mixed window is not always shown when I do :set disasm. Sometimes it just shows assembly window only.

I will see if the problem is shown all the time.

from cgdb.

mikesart avatar mikesart commented on September 23, 2024

For 2, can you check that source is available using the "disasm /s $pc" gdb command? If it is, please enter a bug about it.

And 1 just sounds like a bug. Please enter a new one with whatever repro instructions you can on it.

Thanks Honggyukim.

from cgdb.

honggyukim avatar honggyukim commented on September 23, 2024

For 2, can you check that source is available using the "disasm /s $pc" gdb command? If it is, please enter a bug about it.

The source code is available but the source window randomly shows "source and assembly mixed" or "assembly only". I just compiled the source with -g option. Please see #117.

And 1 just sounds like a bug. Please enter a new one with whatever repro instructions you can on it.

To reproduce it, just set a breakpoint at main function and run it. Then just give si commands. But it doesn't update the arrow one by one for each instruction. The sequence is simple but I will create a new issue for it. Please see #118.

from cgdb.

Freed-Wu avatar Freed-Wu commented on September 23, 2024

Can gdb-dashboard be helpful?

gdb-dashboard

from cgdb.

Freed-Wu avatar Freed-Wu commented on September 23, 2024

Similar issue: #162

from cgdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.