Author Topic: assembly view  (Read 5693 times)

Offline reverser

  • Multiple posting newcomer
  • *
  • Posts: 17
assembly view
« on: October 22, 2020, 10:44:03 am »
hi all
i googled the issue and went by the book as much as i could but still can't see the asm
i put a bp run then open asm sub-window and its empty
any leads on this?!
i reinstalled but nothing changed

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: assembly view
« Reply #1 on: October 22, 2020, 01:47:47 pm »
enable the full debug log in Settings->Debugger->Common
then post the debug log, found in the debug log tab in the logger pane here in code tags (# symbol in the forum editor)

Probably you have a broken gdb... 

Offline reverser

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: assembly view
« Reply #2 on: October 22, 2020, 03:14:55 pm »
well, so far I discovered this feature is breaking the debugging process
here is the full log. I put a bp - debugger stoped - I opened asm view - debbugger terminated after a second or so

Code
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Users\Shetal\Desktop\zzz\
Adding source dir: C:\Users\Shetal\Desktop\zzz\
Adding file: C:\Users\Shetal\Desktop\zzz\bin\Debug\zzz.exe
Changing directory to: C:/Users/Shetal/Desktop/zzz/.
Set variable: PATH=.;F:\main programs\Programming_compiler\CodeBlocks\MinGW\bin;F:\main programs\Programming_compiler\CodeBlocks\MinGW;D:\PROGRAM\crack tool\packers\.net packers\Eazfuscator.NET;D:\PROGRAM\crack tool\packers\.net packers\.NET Reactor;D:\PROGRAM\crack tool\packers\.net packers\IntelliLock;C:\ProgramData\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;F:\Program Files (x86)\IncrediBuild;C:\Program Files (x86)\Payesh\gm;C:\Program Files (x86)\Java\jdk1.8.0_72\bin;\;F:\main programs\Programming_compiler\UEStudio;C:\Users\Shetal\AppData\Local\Microsoft\WindowsApps;F:\main programs\Programming_compiler\IntelliJ IDEA 2020.2.3\bin;F:\main programs\Programming_compiler\PyCharm 2020.1\bin

[debug]Command-line: F:\main programs\Programming_compiler\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname -quiet  -args C:/Users/Shetal/Desktop/zzz/bin/Debug/zzz.exe
[debug]Working dir : C:\Users\Shetal\Desktop\zzz

Starting debugger: F:\main programs\Programming_compiler\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname -quiet  -args C:/Users/Shetal/Desktop/zzz/bin/Debug/zzz.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Setting breakpoints

[debug]Reading symbols from C:/Users/Shetal/Desktop/zzz/bin/Debug/zzz.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 8.1
[debug]Copyright (C) 2018 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "x86_64-w64-mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 8.1

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 200
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory C:/Users/Shetal/Desktop/zzz/
[debug]Source directories searched: C:/Users/Shetal/Desktop/zzz;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Users/Shetal/Desktop/zzz/main.cpp:8"
[debug]Breakpoint 2 at 0x40157f: file C:\Users\Shetal\Desktop\zzz\main.cpp, line 8.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: C:\Users\Shetal\Desktop\zzz\bin\Debug\zzz.exe

Child process PID: 10020

[debug][New Thread 10020.0x3aa4]
[debug][New Thread 10020.0x688]
[debug][New Thread 10020.0x23cc]
[debug][New Thread 10020.0x2178]
[debug]Thread 1 hit Breakpoint 2, main () at C:\Users\Shetal\Desktop\zzz\main.cpp:8
[debug]C:\Users\Shetal\Desktop\zzz\main.cpp:8:99:beg:0x40157f
[debug]>>>>>>cb_gdb:

At C:\Users\Shetal\Desktop\zzz\main.cpp:8

[debug]> if 1
disassemble 0x40157f
info frame
end

[debug] > > >Dump of assembler code for function main():
[debug]   0x0000000000401550 <+0>: push   %rbp
[debug]   0x0000000000401551 <+1>: mov    %rsp,%rbp
[debug]   0x0000000000401554 <+4>: sub    $0x20,%rsp
[debug]   0x0000000000401558 <+8>: callq  0x401750 <__main>
[debug]   0x000000000040155d <+13>: lea    0x2a9d(%rip),%rdx        # 0x404001 <std::piecewise_construct+1>
[debug]   0x0000000000401564 <+20>: mov    0x2da5(%rip),%rcx        # 0x404310 <__fu0__ZSt4cout>
[debug]   0x000000000040156b <+27>: callq  0x401670 <std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)>
[debug]   0x0000000000401570 <+32>: mov    0x2da9(%rip),%rdx        # 0x404320 <.refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_>
[debug]   0x0000000000401577 <+39>: mov    %rax,%rcx
[debug]   0x000000000040157a <+42>: callq  0x401690 <std::ostream::operator<<(std::ostream& (*)(std::ostream&))>
[debug]=> 0x000000000040157f <+47>: lea    0x2a7b(%rip),%rdx        # 0x404001 <std::piecewise_construct+1>
[debug]   0x0000000000401586 <+54>: mov    0x2d83(%rip),%rcx        # 0x404310 <__fu0__ZSt4cout>
[debug]   0x000000000040158d <+61>: callq  0x401670 <std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)>
[debug]   0x0000000000401592 <+66>: mov    0x2d87(%rip),%rdx        # 0x404320 <.refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_>
[debug]   0x0000000000401599 <+73>: mov    %rax,%rcx
[debug]   0x000000000040159c <+76>: callq  0x401690 <std::ostream::operator<<(std::ostream& (*)(std::ostream&))>
[debug]   0x00000000004015a1 <+81>: lea    0x2a59(%rip),%rdx        # 0x404001 <std::piecewise_construct+1>
[debug]   0x00000000004015a8 <+88>: mov    0x2d61(%rip),%rcx        # 0x404310 <__fu0__ZSt4cout>
[debug]   0x00000000004015af <+95>: callq  0x401670 <std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)>
[debug]   0x00000000004015b4 <+100>: mov    0x2d65(%rip),%rdx        # 0x404320 <.refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_>
[debug]   0x00000000004015bb <+107>: mov    %rax,%rcx
[debug]   0x00000000004015be <+110>: callq  0x401690 <std::ostream::operator<<(std::ostream& (*)(std::ostream&))>
[debug]   0x00000000004015c3 <+115>: lea    0x2a37(%rip),%rdx        # 0x404001 <std::piecewise_construct+1>
[debug]   0x00000000004015ca <+122>: mov    0x2d3f(%rip),%rcx        # 0x404310 <__fu0__ZSt4cout>
[debug]   0x00000000004015d1 <+129>: callq  0x401670 <std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)>
[debug]   0x00000000004015d6 <+134>: mov    0x2d43(%rip),%rdx        # 0x404320 <.refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_>
[debug]   0x00000000004015dd <+141>: mov    %rax,%rcx
[debug]   0x00000000004015e0 <+144>: callq  0x401690 <std::ostream::operator<<(std::ostream& (*)(std::ostream&))>
[debug]   0x00000000004015e5 <+149>: mov    $0x0,%eax
[debug]   0x00000000004015ea <+154>: add    $0x20,%rsp
[debug]   0x00000000004015ee <+158>: pop    %rbp
[debug]   0x00000000004015ef <+159>: retq   
[debug]End of assembler dump.

Debugger finished with status 1

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: assembly view
« Reply #3 on: October 22, 2020, 03:27:57 pm »
Yes, gdb 8.3 shipped with codeblocks is broken... You probably need a newer version of gdb,
for example:
http://www.winlibs.com/

Offline reverser

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: assembly view
« Reply #4 on: October 22, 2020, 04:08:59 pm »
uh...so i have to download gcc and mingw and extract both in the folder where the current gdb.exe is located?!?!?


edit:
downloaded win64 version without LLVM/Clang/LLD/LLDB and extracted it into CodeBlocks\MinGW and replaced any conflicting file. hope I've done correctly


edit 2 :
YOU ARE AWESOME. fixed man. works like a charm.thx for the uber support

anyway, shouldn't the 20.3 package be updated?!
« Last Edit: October 22, 2020, 04:27:50 pm by reverser »

Offline reverser

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: assembly view
« Reply #5 on: April 27, 2022, 01:22:58 pm »
so, i didn't want to start a new thread as every thing is explained here already.

i started using Linux just today and i don't know anything about Linux.
i debugged a sample compiled app and received a warning "GDB: failed to set controlling terminal: operation not permitted."

now, i want to know if its connected to the issue above and i have to update Mingw in Linux too? if yes, how?!

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: assembly view
« Reply #6 on: April 27, 2022, 01:47:51 pm »
What linux distribution are you using?

I think you can ignore this warning. Does debugging work?

if not:
Can you look what terminal you are using and post it here
Settings->Environment->Shell to run command in
and
Settings->Environment->Terminal to launch console programs

If in "Terminal to launch console programs" is set X-Therm, make sure you have xterm installed by typing
Code
sudo apt install xterm
in a console window
then try again.


Offline reverser

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: assembly view
« Reply #7 on: April 30, 2022, 05:59:42 am »
i can debug my code. so far no problem other than that warning. will drop by if anything shows up.