Comments (20)
You should be able to hit and then type ":set dis" to get disassembly now...
from cgdb.
+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.
+1 for an essential debugging feature. When you get a crash in an empty destructor, source is no help!
from cgdb.
+1 Disassembly and registers windows!
from cgdb.
+1 ...it was looking like a good frontend until I went looking for this feature
from cgdb.
+1 I discovered cgdb recently, and it's awesome. But with disassembly window instead of source it would be even better ;)
from cgdb.
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.
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.
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.
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.
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.
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.
@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.
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.
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.
Hm.. after keep using it. It doesn't seem to be stable. I found two problems.
- The arrow is not properly updated as I executed a single instruction.
- 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.
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.
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.
Can gdb-dashboard be helpful?
from cgdb.
Similar issue: #162
from cgdb.
Related Issues (20)
- how to change gdb program that cgdb use? HOT 1
- Cygwin BUG: [commit: 2022-06-12 208d038] fdopen was not declared in this scope
- Question: How to clear search highlights HOT 5
- cannot stat 'cgdb.htp': No such file or directory HOT 2
- file dialog freezing terminal in msys2/WSL HOT 2
- Cannot Display Color Properly HOT 2
- cgdb bug: remote connect to kdb cannot do twice HOT 3
- ESCape key mixup with readline HOT 2
- how to disable source code display in cgdb windows HOT 3
- utf support HOT 2
- [bug] Assertion in signal_handler on SIG_CHLD HOT 1
- It should be possible to disable makeinfo with configure flags HOT 1
- cgdb doesn't handle different langage path-to-file HOT 1
- REG 7bbd997: Multi-character input sequences are broken HOT 4
- Suggestion: Host release artifacts on Github
- cgdb doesn't support remote debug (gdbserver) HOT 1
- [bug] valgrind cannot display message HOT 3
- Mouse pasting is broken HOT 1
- Compilation from git is broken on fedora 49 HOT 1
- cgdb interprets arguments after -- in certain cases
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cgdb.