Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Cannot debug application on ubuntu linux
Re: Cannot debug application on ubuntu linux [message #57405 is a reply to message #57400] Thu, 05 August 2021 10:51 Go to previous messageGo to previous message
alex-t is currently offline  alex-t
Messages: 12
Registered: August 2021
Promising Member
Seems gdb works from console.

I'm created program with 3 lines of source code, compiled clang++ -g ./TheMain.cpp

Then gdb ./a.out.

Output:

GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./a.out...
(gdb) b main
Breakpoint 1 at 0x4011df: file ./TheMain.cpp, line 5.
(gdb) r
Starting program: /data/3/soft/devel/IDEs/cb/cb_test/a.out 

Breakpoint 1, main () at ./TheMain.cpp:5
5           std::cout << "Preved" << std::endl;
(gdb) s
Preved
6           std::cout << "Preved2" << std::endl;
(gdb) s
Preved2
7           return 0;
(gdb) s
__libc_start_main (main=0x4011d0 <main()>, argc=1, argv=0x7fffffffdac8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7fffffffdab8) at ../csu/libc-start.c:342
342     ../csu/libc-start.c: No such file or directory.
(gdb) s
__GI_exit (status=0) at exit.c:138
138     exit.c: No such file or directory.
(gdb) s
139     in exit.c


Seems after exiting my main some strange occured - it tries to find files that not exists. But I can debug my application itself.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Linux Executable
Next Topic: Build with no preset comper/linker switches
Goto Forum:
  


Current Time: Fri Oct 17 06:06:06 CEST 2025

Total time taken to generate the page: 0.10439 seconds