Can I connect to a currently running program without debug information with gdb and connect to it the debug information?

Can I connect to a currently running program without debug information with gdb and connect to it the debugging information with the binary with debug information without interrupting program execution.
objcopy --only-keep-debug prior to running the program have not been made.
July 8th 19 at 11:23
3 answers
July 8th 19 at 11:25
No.
July 8th 19 at 11:27
Can. Run gdb like this:
gdb program-image-with-debug-symbols
and to run command line gdb
attach pid
where pid is the number for the process you want to connect to.

Well, of course, for this to work correctly, program-image-with-debug-symbols should be different from the running program only by the presence of debug information.
I tried to do as you said, but did not. View attached log. - marlon.Kuhic commented on July 8th 19 at 11:30
July 8th 19 at 11:29
Can. Run gdb like this:
gdb program-image-with-debug-symbols
and to run command line gdb
attach pid
where pid is the number for the process you want to connect to.

Well, of course, for this to work correctly, program-image-with-debug-symbols should be different from the running program only by the presence of debug information.

gdb /tmp/telemetry 
GNU gdb (GDB) 7.5.1
Copyright (C) 2012 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 "arm-buildroot-linux-gnueabi".
For bug reporting instructions, please see:
<http: www.gnu.org software gdb bugs>...
Reading symbols from /tmp/telemetry...done.
(gdb) attach 6986
Attaching to program: /tmp/telemetry, process 6986
Reading symbols from /lib/ld-linux-armhf.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib/ld-linux-armhf.so.3
0x403eb276 in ?? ()
(gdb) bt
#0 0x403eb276 in ?? ()
#1 0x4045a488 in ?? ()
#2 0x4045a488 in ?? ()
gdb /tmp/telemetry
b InfoListener::saveValue
Breakpoint 1 at 0x241e8: file InfoListener.cpp line 949.
(gdb) c
Continuing.</http:></http:>

After starting sootvetstvuyushie see the log from the function, but the program does not stop at the prescribed breakpoint.
If directly under gdb to run a binary with debugging symbols and to put the same stopping point, then everything works correctly. If you connect to the process running a binary with debug symbols too, everything works correctly.
and can Shacharit two binary: with debug information or without? - marlon.Kuhic commented on July 8th 19 at 11:32
give mail, but the binary is based on - demetrius.Bedn commented on July 8th 19 at 11:35
have tried now to make a simple app, all worked as you wrote. Apparently the problem is that he delanoy information for the application is not enough probably still need debana information for the used lib - marlon.Kuhic commented on July 8th 19 at 11:38
But the question still remains why it doesn't work your option to the desired application. If you connect to a running application without debanich characters, but harvested using objcopy --only-keep-debug. But after attach using symbol-file loading only debaene symbols, dots are placed and work - marlon.Kuhic commented on July 8th 19 at 11:41
e-mail : jcmvbkbc@gmail.com. - marlon.Kuhic commented on July 8th 19 at 11:44
Another question: what displays the info files immediately after the attach? - demetrius.Bedn commented on July 8th 19 at 11:47

Find more questions by tags DebuggingGDBARMLinux