'GDB does not allow me to run after setting a break point on a binary file

Image of warning here

I'm trying to debug this 32-bit file. I'm on a 64-bit windows OS and I've already installed the necessary libraries and multi-arch support to be able to run such a program on ubuntu. I'm getting the warning selected architecture i386 is not compatible with reported target architecture i386:x86-64. Also it says architecture rejected target-supplied description. I printed my architectures and it shows i386. Anyone know how I can fix this?

Edit: After setting the architecture to i386:x86-64 in gdb I have a new warning: `/lib/ld-linux.so.2': Shared library architecture i386 is not compatible with target architecture i386:x86-64



Solution 1:[1]

The usual way is to have targets that don't duplicate each others files. E.g. some targets are libraries that are used by some others, and eventually there's an app or a unit test target that uses them. In this case there's no need to have the same file in multiple targets.

So consider refactoring the common files to a common library target that you can reference from the other targets. In this case when you add a file, you can add it to just that library, and it will be automatically resolved (linked) in the other targets.

Note also that in this case the file you add is only compiled once, and the compilation result is reused in various dependant targets, as opposed to compiling a separate version of that file for each target.

If that's not an option for you, an alternative is to generate the Xcode project file using some tool like CMake, GN, or a custom script that can write xcodeproj files (there are libraries to do that in various languages).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 battlmonstr