Disassemble view - feature request

Discussion about CodeLite development process and patches
gaspode
CodeLite Curious
Posts: 8
Joined: Fri Aug 03, 2012 10:39 am
Genuine User: Yes
IDE Question: C++
Contact:

Disassemble view - feature request

Post by gaspode » Sat Dec 13, 2014 4:08 pm

Hi,
It is possible to ask for mix mode for disassemble view that will show c++ code mixed with assembler code?
It seems that registers view window doesn't has horizontal scroll bar and some registers values like xmm registers do not fit fully into the window.

Thanks,

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Disassemble view - feature request

Post by eranif » Sat Dec 13, 2014 7:20 pm

gaspode wrote:It is possible to ask for mix mode for disassemble view that will show c++ code mixed with assembler code?
It is always possible to ask, but its unlikely to get implemented unless there is a bug demand for this feature.
In any case, your requests should go to github issue tracker and not here
gaspode wrote:It seems that registers view window doesn't has horizontal scroll bar and some registers values like xmm registers do not fit fully into the window.
Please report this on github with sample code for reproduction, also, make sure you read and follow the HOW TO POST

Eran
Make sure you have read the HOW TO POST thread

gaspode
CodeLite Curious
Posts: 8
Joined: Fri Aug 03, 2012 10:39 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Disassemble view - feature request

Post by gaspode » Sun Dec 21, 2014 5:49 pm

Hi,
I tried to implement this feature myself but I found an issue releated to gdbParser code that blocked me.
The gdbParser code is very strange and very hard to understand. :(

To enable mixed mode in disassemble, the "-- 0" parameter should be changed to "-- 3" inside the DbgGdb::Disassemble
function. This will change the debugger output to the following:

asm_insns=[
src_and_asm_line={line="18",file="main.cpp",fullname="/home/abc/main.cpp",
line_asm_insn=[
{address="0x00000000004005e1",func-name="main()",offset="8",opcodes="64 48 8b 04 25 28 00 00 00",inst="mov %fs:0x28,%rax"},
{address="0x00000000004005ea",func-name="main()",offset="17",opcodes="48 89 45 f8",inst="mov %rax,-0x8(%rbp)"},
{address="0x00000000004005ee",func-name="main()",offset="21",opcodes="31 c0",inst="xor %eax,%eax"}]},
src_and_asm_line={line="19",file="main.cpp",fullname="/home/abc/main.cpp",
line_asm_insn=[^M
{address="0x00000000004005f0",func-name="main()",offset="23",opcodes="8b 05 de 00 00 00",inst="mov 0xde(%rip),%eax # 0x4006d4"},
{address="0x00000000004005f6",func-name="main()",offset="29",opcodes="89 45 e0",inst="mov %eax,-0x20(%rbp)"}^M

But gdbParser cannot parse this message inside the bool DbgCmdHandlerDisasseble::ProcessOutput(const wxString& line)
function:

GdbChildrenInfo info; // vector of std::map
::gdbParseListChildren(line.mb_str(wxConvUTF8).data(), info);

The gdbParseListChildren returns empty vector for above message. I tried to understand the gdbParser code but I gave up. :)
Do you know how to parse new message by using gdbParser? It can be easy done by writing own parser for this message but
this is not good idea.

Thank you.

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Disassemble view - feature request

Post by eranif » Sun Dec 21, 2014 11:04 pm

gaspode wrote:he gdbParser code is very strange and very hard to understand.
This is because the gdbParser code is auto-generated from a yacc grammar, so it not really "readable"

The gdbParser has its own workspace:

Code: Select all

/path/to/codelite/sources/gdbparser/GdbResultParser.workspace
Open this workspace and edit the file gdb_result.y
Then rebuild the project

Eran
Make sure you have read the HOW TO POST thread

gaspode
CodeLite Curious
Posts: 8
Joined: Fri Aug 03, 2012 10:39 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Disassemble view - feature request

Post by gaspode » Thu Dec 25, 2014 8:45 pm

eranif wrote:
gaspode wrote:he gdbParser code is very strange and very hard to understand.
This is because the gdbParser code is auto-generated from a yacc grammar, so it not really "readable"
Thanks. :) I haven't work with lex/yacc so far.
eranif wrote: The gdbParser has its own workspace:

Code: Select all

/path/to/codelite/sources/gdbparser/GdbResultParser.workspace
Open this workspace and edit the file gdb_result.y
Then rebuild the project
I tried to do that but there are two issues with gdbResultParser project.

1) The Release build configuration doesn't generate new version of the following files:

Code: Select all

gdb_result.cpp
gdb_result_parser.cpp
gdb_result_parser.h


So, any changes done in gdb_result.l and gdb_result.y files are ignored. Due to there is no Custom Makefiles rules that generates new versions of files.

2) The test application (register parsing test) built with above files that are commited into the repository works properly. When Linux build configuration is used and new version of gdb_result.cpp. gdb_result_parser.cpp, gdb_result_parser.h are generated. The test application crashes! Do you have the same result?

Thanks,

3) The following commands extracted from GdbResultParser project:

Code: Select all

flex -L  -Pgdb_result_ gdb_result.l
yacc -dl  -t -v -pgdb_result_ gdb_result.y
generate diffrent files than you have in the repository. I used flex 2.5.39, yacc - 1.9 20140422 to generate them. I also could not find any options or skeletion file that will
generate the same files as you have. :( Could you please add small comment somewhere in the gdb_result.y or gdb_result how to generate thes files propertly? Anyway,
why do you keep auto generated file in the repository? It looks to me that you have modified auto generated files by hand and without of your modification the example
application will crash. Could you just confirm?

Post Reply