Eclipse gdb error while Stepping Over - c

I'm new to C and while debugging a simple file IO code snippet, the Eclipse debugger (using gdb) gave the following error:
Can't find a source file at "/build/buildd/eglibc-2.19/libio/iofgets.c"
Locate the file or edit the source lookup path to include its location.
THe line where the debugger crashes is
while (NULL!=fgets(line, SIZE, fp))
It looks like the debugger is looking for the source code for fgets in the folder build/buildd/.../libio/, but I'm not trying to step into this line, I'm stepping over it.
I'm using eclipse version 3.8 with Ubuntu 14.04 LTS

Related

Apache NetBeans C Debugger Error - Not in executable format

I have written, compiled and ran my C program with Apache NetBeans 13 just fine, but when I try to run the debugger I get the following error:
"C:\\Users\\username\\ ... \\ProblemaBombeiros\\dist\\Debug\\MinGW_1-Windows\\problemabombeiros.exe\":
not in executable format: File format not recognized
But the file it found is indeed a executable format .exe .
Here are the configurations for the C/C++ build tools:
Am I doing something wrong or do I need to do something else to start debugging?

Building and debugging ARMV8 assembler applications on Windows

I'm trying to learn ARMV8 assembler, and am trying to build a test application on Windows. I've installed ARM DS-5 Community Edition, version 5.26.2. After much hair pulling trying to install toolchains, I finally installed the "mingw32" toolchain here: here. This seems to work - I am now able to compile and link my application (which consists of a single c file and a .s assembly file. The target created is a ".axf" file.
But I am unable to debug. I have my debugger set to "\gcc-linaro-6.3.1-2017.02-i686-mingw32_aarch64-linux-gnu\bin\aarch64-linux-gnu-gdb.exe", out of the directory where I downloaded the toolchain. gdb starts up, but I get the error below:
Error in final launch sequence
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Don't know how to run. Try "help target".
Don't know how to run. Try "help target".
Any suggestions? Frankly, I don't really know what I'm doing here. I'm not sure I set up the toolchain properly. The problem is I can't find any documentation on how to do this in windows.
Thanks in advance!

Eclipse - "Launching 'KeyInPlaintext' Debug has encountered a problem. Error starting process."

I am currently attempting to compile and run a C program in eclipse. The problem is, every time I attempt to run a program, the same error shows up.
The image shows the error that is displayed. I am not sure what to get out of that error.
I currently have cygwin installed, and am able to run gcc and g++ on the command prompt. I also have PE Windows Parser and Cygwin PE parser enabled under Binary Parsers. I have also cleaned and built the project many times over.

Debugging cross-compiled code: Linux->Windows

I'm cross-compiling a project from Linux to target Windows (using mingw). The output is a DLL and p-invoking into it from C# works, but debugging is very difficult. The build outputs a .o file, which can provide symbols to gdb, but basically all I can do there is break on exceptions and find the name of the function that was executing when the exception happened; not even the full stack trace. I can't debug with WinDbg because I don't have .pdb files.
This is an open source project set up to build on Linux; I believe their build process relies on several installed Linux packages to work.
Do I have any options here? Is there a utility that can convert .o files into .pdb? Or some program that can give me more information than gdb when debugging?
Try a IDE that support mingw. For example the open source Code::blocks.
Another possibility is to do it manually: compile it with debug symbols, start you application and attach the GDB debugger to it. It is also part of the MingW32 distribution. Then you can set your breakpoints and debug your application
But I guess using Code::Block is more comfortable
By the way, the GCC compiler does not generate pdb files because it is a propietary format
What xpol means is maybe: if you have a complete mingw installation then Code::blocks can use gdb to visualize a debugging session like it is done in Visual Studio or Eclipse. See chapter "Debugger" at http://www.codeblocks.org/features
You can generate a .pdb file using cv2pdb.exe from Visual D. This works even for programs not written in D if they were compiled with mingw. Once you've downloaded and installed Visual D cv2pdb.exe can be found at C:\Program Files (x86)\VisualD\cv2pdb\cv2pdb.exe.
You can run cv2pdb.exe against an executable like this:
cv2pdb.exe -n target.exe
This will produce a file called target.pdb. Assuming both target.pdb and target.exe are in the current director, you can then use windbg like this:
windbg -sflags 0x80030377 -y . -z target.dmp
In this case I'm also passing a minidump file as target.dmp. This can be omitted. The -sflags 0x80030377 option tells windbg to load target.pdb even though it thinks it doesn't match target.exe.
Note, that it can take windbg a very long time to load target.pdb. Just wait until it no longer says *BUSY* to the left of the command entry box.
Alternatively you can try DrMinGW.

Can't find a source file at "printf.c" error in eclipse

Can't find a source file at "printf.c"
Locate the file or edit the source lookup path to include its location.
i get this error when i try debugging the program but when i compile the program i get proper output i am working on C and i am using eclipse Galileo installed in ubuntu. How to remove this?
You're trying to debug a library function, printf(). Symbolic debugging of a function is only available when you have it's symbols, or it's source code. So, the solutions are as follows: (1) if you don't need to debug the library function, don't dive into it while debugging, i.e. use step over instead of step into style of the breakpoint advancement, (2) if you need to debug the library function, get it's source code, or it's symbols, and make them available to the IDE debugger.

Resources