gdb set disassembly-flavor intel on armv7 - gdb

im debugging on armv7 platform and i need to see the disass of a function ( in C ).
i'm using gdb 7.3 but there isn't disass-flavor option.
how i can see the disassembled code in intel flavor?
thanks in advance.

Related

Debugger with Eclipse on a macOS Catalina

I've macOS Catalina and Eclipse IDE for C/C++ Developer, Version: 2021-03 (4.19.0) and I need to use EclipseCDT debugger. Following the steps at macOS 10.15 Catalina gdb problem for C++ Debugging in Eclipse I still have problems. Namely, the Debug window doesn't show up.
The only difference between my steps and the ones from the tutorial is the gdb version: mine is 10.1, while the other is 8.3.
I've found this FAQ link: https://wiki.eclipse.org/CDT/User/FAQ, where seems to be possible to use LLDB debugger, but I can't find the detailed instructions. Any approach is fine to me, I just need a working debugger

How to Debug MIPS Interactively

I'm taking a course on Computer Organization and Assembly.
In class, we're learning MIPS. This is for the purpose of introducing basic concepts, like pipelining. We're writing a handful of simple MIPS programs for class.
I'm used to gdb for debugging and learning, and the debugger we use in class is SPIM. SPIM sucks. It allows me to step through a program, but it doesn't allow me to interactively execute MIPS instructions at an arbitrary point of execution. I am immediately tired of having to exit SPIM, edit the source, and run SPIM again, navigating to the desired point of execution, only to see I have to do it again because I made yet another mistake.
Or perhaps I am mistaken and SPIM does allow this. My instructor said that this feature is not supported, so I'm going off what he said. I googled around a bit and didn't find a workaround.
I have tried googling for interactive MIPS debuggers like gdb but I haven't found any. I'm aware that gdb can debug MIPS programs, but I don't have a MIPS machine to run MIPS programs on.
I run Ubuntu in VMware. How can I interactively debug MIPS programs, using gdb or otherwise?
Edit: found some reference material on Mips.com on their recommended Linux Toolchain.
You can use qemu as an emulator, gdb as a debugger and gcc as a compiler. It's universal tool-set to investigate different architectures.
For Ubuntu you can install dependencies with followed command (probably, list is not full for your system - it's up to you there):
sudo apt install gdb-multiarch qemu qemu-user gcc-multilib gcc-multilib-mips64-linux-gnuabi64
Now you can use gcc as a compiler.
$ cat code.c
#include<stdio.h>
int main()
{
printf("Hello world!\n");
return 0;
}
$ mips64-linux-gnuabi64-gcc code.c -static -g3
And start emulation in qemu with debug session:
$ qemu-mips64 -g 1234 ./a.out
In gdb-multiarch use the following routine:
symbol-file a.out
set arch mips:isa64
target remote :1234
b main
c
And here is your goal:
(gdb) x/5i main
0x120003850 <main>: daddiu sp,sp,-32
0x120003854 <main+4>: sd ra,24(sp)
0x120003858 <main+8>: sd s8,16(sp)
0x12000385c <main+12>: sd gp,8(sp)
0x120003860 <main+16>: move s8,sp
I believe, you can adapt it for your tasks. And MIPS arch is so various, as you can see in gdb set arch command.

Codeblocks can't find Intel C++ compiler (Linux Mint)

Codeblocks (v13.12) can't find my installation of the Intel C++ compiler.
I have the bundled version of icc that comes with Composer XE, which I believe is the only way to currently get it. When I go into Codeblocks' toolchain settings I see that it is looking for it in "/opt/intel/cc/9.0" which is wrong. When I try to change this to the actual path to my icc ("/opt/intel/composer_xe_2013_sp1.3.174/bin/intel64") it says that it still can't find it.
Has anyone gotten the current icc to work with the current Codeblocks?
I am not an expert. I will provide my settings so that hopefully it will work for you:
settings-->compiler debugger-->toolchain executables-->Compiler's installation directory:
/opt/intel/composer_xe_2013/sp1
C: compiler icc
C++ compiler icpc
Linker for dyn icpc
linker for static ar
debugger: idb
settings-->compiler debugger-->search directories
/opt/intel/composer_xe_2013_sp1.3.174
I have code:blocks 10.05 on ubuntu 12.04. Hopefully this helps/works for you or someone else!

gdb in Netbeans-7.4 for C++ debugging

I'm trying to debug my project using the "step-into" function, but each of the debug options (other than Debug Project, Attach Debugger, and Debug Core File) is grayed out. I've checked on both my Linux and Windows machines, and they both have the same problem.
I'm running Netbeans 7.4 with gdb 7.6, seemingly properly loaded under tools->options->C++. Is there possibly a compatibility issue with newer versions of gdb? If so, how can I revert to an older version?
Thanks!
Here are some things you can try:
Remove all breakpoints of your project and try again with a new one
(If possible) test version:
a earlier version of GDB
and newer version of NetBeans (current stable: NB 7.4 SP2 -- testing: NB 8.0 RC1)
Are there any error messages? Please also keep an eye on NetBeans's logfile - on IDE start and debugging
Check your paths, e.g, to compiled binaries / libs
Maybe this Bug can help you: Bug 233683 - Gdb doesn't work with NetBeans 7.3.1
It's posted for 7.3, but maybe it's still in 7.4.

Cannot find new threads: generic error 64bit Ubuntu

I know that there are a few topics around this subject, however none of them helped me.
I am trying to debug my application using GDB and I am obtaining the error
[debug]Cannot find new threads: generic error
[debug][Thread debugging using libthread_db enabled]
in the function dlopen("my_lib.so", RTLD_LAZY);
The strange fact about this is that it used to work before, when I was compiling under Ubuntu of 32bit architecture. Now, I have moved to a new machine, with 64bit ubuntu installed, HOWEVER, I am giving the compile option -m32 so that the application is still compiled under 32bits. Please don't tell me to try to compile it under 64bit because there are several reasons not to do so.
I have followed the instructions of this topic and still nothing.
Does anybody have a different suggestion?
EDIT: The version of GCC on 32bit machine is 4.4.4 and GDB is 7.2
On the 64bit machine the version of GCC is 4.6.1 and GDB is 7.3
May this have any influence?
Please setup this
LD_PRELOAD=/lib/x86_64-linux-gnu/libpthread.so.0 gdb --args ./app