Hello,
I'm trying to set up a comfortable development environment using Qt-Creator for the openLTE Project. I'm especially interested in the enb-implementation.
I was able to import the CMake-Project and compile it (initiated by Qt-Creator) with debug Symbols using the CMake Arguments "-DCMAKE_BUILD_TYPE=Debug"
So far so good...
But during debugging (within Qt-Creator) gdb does not find the source files. A breakpoint at the beginning of main() shows me the assembly - even though it includes references to the source, e.g.:
...
63 in LTE_fdd_enb_main.cc
0x418b35 <+0x000f> callq 0x418ea0 <LTE_fdd_enb_interface::get_instance()>
...
Launching gdb manually with "gdb LTE_fdd_enodeb" and setting a breakpoint "break LTE_fdd_enb_main.cc:63" succeeds, but when the breakpoint is reached I get
"Breakpoint 1, main (argc=1, argv=0x7fffffffdd68) at LTE_fdd_enb_main.cc:63
63 LTE_fdd_enb_main.cc: Datei oder Verzeichnis nicht gefunden."
(German for "File not found".)
This can be fixed by typing "directory /path/to/the/source/folder/src" before debug is started by "run".
Obviously GDB does not find the source files in his default configuration. Is there any more comfortable way to make GDB find the source files, so that I can setup Qt-Creator to find the sources, too?
Maybe some CMake flag to use absolute source-paths? I have no experience with CMake yet.
Thank you in advance
Edit: or how are you debugging the code, bwojtowi?
Last edit: Rob 2015-02-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The only advice I can give in the short term is to add "-g -pg" to the
CMake arguments. Similar to you, I don't have the best CMake experience.
So if this doesn't work, I'll need to dig a bit.
Hello,
I'm trying to set up a comfortable development environment using
Qt-Creator for the openLTE Project. I'm especially interested in the
enb-implementation.
I was able to import the CMake-Project and compile it (initiated by
Qt-Creator) with debug Symbols using the CMake Arguments
"-DCMAKE_BUILD_TYPE=Debug"
So far so good...
But during debugging (within Qt-Creator) gdb does not find the source
files. A breakpoint at the beginning of main() shows me the assembly - even
though it includes references to the source, e.g.:
...
63 in LTE_fdd_enb_main.cc
0x418b35 <+0x000f> callq 0x418ea0 <LTE_fdd_enb_interface::get_instance()>
...
Launching gdb manually with "gdb LTE_fdd_enodeb" and setting a breakpoint
"break LTE_fdd_enb_main.cc:63" succeeds, but when the breakpoint is reached
I get
"Breakpoint 1, main (argc=1, argv=0x7fffffffdd68) at LTE_fdd_enb_main.cc:63
63 LTE_fdd_enb_main.cc: Datei oder Verzeichnis nicht gefunden."
(German for "File not found".)
This can be fixed by typing "directory /path/to/the/source/folder/src"
before debug is started by "run".
Obviously GDB does not find the source files in his default configuration.
Is there any more comfortable way to make GDB find the source files, so
that I can setup Qt-Creator to find the sources, too?
Maybe some CMake flag to use absolute source-paths? I have no experience
with CMake yet.
thank you for the reply. Might you tell me, how you launch debugging for the lte-enb (commandline and working directory), or tell me which development IDE you are using?
I would like to keep maximum compatibility to the your git-repository for being able to merge newest changes, instead of rolling out an other build-system and directory-structure.
Thanks in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I currently use command line tools for debugging the enodeb application.
This includes:
- Building using cmake/make (follow the instructions in the README file)
- Capturing a debug log file using netcat (e.g. nc localhost 30001 >
log_file.txt)
- Capturing pcap files by setting the enable_pcap variable (e.g write
enable_pcap 1)
- Using gdb to debug crashes
thank you for the reply. Might you tell me, how you launch debugging for
the lte-enb (commandline and working directory), or tell me which
development IDE you are using?
I would like to keep maximum compatibility to the your git-repository for
being able to merge newest changes, instead of rolling out an other
build-system and directory-structure.
I solved the problem with missing sourcefiles during debugging (either pure gdb or encapsulated in QtCreator) of the Application LTE_fdd_enodeb:
For pure GDB: Start gdb from the directory, where the Sourcefiles lie. This is <checkout-dir>/LTE_fdd_enodeb/src/
OR
add this directory manually to gdb's search path after launching gdb:
gdb> directory <checkout-dir>/LTE_fdd_enodeb/src
For encapsuled in QtCreator:
Goto Projects > Build&Run > Desktop > Build
Set Build directory: build
Seet CMake arguments: -DCMAKE_BUILD_TYPE=Debug
Goto Projects > Build&Run > Desktop > Run
Add Run configuration
Set Executable: <checkout-dir>/build/LTE_fdd_enodeb/LTE_fdd_enodeb
Set Working directory: <checkout-dir>/LTE_fdd_enodeb/src
Reason:
After inspecting the binary with objdump I noticed that all paths to external librarys/heades outside the /src-Directory are referenced by absolute full path - except the sourcefiles in the /src-Directory. These are referenced by only the filename and gdb won't find them, if it is launched from an other working dir.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm trying to set up a comfortable development environment using Qt-Creator for the openLTE Project. I'm especially interested in the enb-implementation.
I was able to import the CMake-Project and compile it (initiated by Qt-Creator) with debug Symbols using the CMake Arguments "-DCMAKE_BUILD_TYPE=Debug"
So far so good...
But during debugging (within Qt-Creator) gdb does not find the source files. A breakpoint at the beginning of main() shows me the assembly - even though it includes references to the source, e.g.:
...
63 in LTE_fdd_enb_main.cc
0x418b35 <+0x000f> callq 0x418ea0 <LTE_fdd_enb_interface::get_instance()>
...
Launching gdb manually with "gdb LTE_fdd_enodeb" and setting a breakpoint "break LTE_fdd_enb_main.cc:63" succeeds, but when the breakpoint is reached I get
"Breakpoint 1, main (argc=1, argv=0x7fffffffdd68) at LTE_fdd_enb_main.cc:63
63 LTE_fdd_enb_main.cc: Datei oder Verzeichnis nicht gefunden."
(German for "File not found".)
This can be fixed by typing "directory /path/to/the/source/folder/src" before debug is started by "run".
Obviously GDB does not find the source files in his default configuration. Is there any more comfortable way to make GDB find the source files, so that I can setup Qt-Creator to find the sources, too?
Maybe some CMake flag to use absolute source-paths? I have no experience with CMake yet.
Thank you in advance
Edit: or how are you debugging the code, bwojtowi?
Last edit: Rob 2015-02-03
The only advice I can give in the short term is to add "-g -pg" to the
CMake arguments. Similar to you, I don't have the best CMake experience.
So if this doesn't work, I'll need to dig a bit.
Hope this helps,
Ben
On Thu, Jan 29, 2015 at 3:49 AM, Rob pforcht@users.sf.net wrote:
Dear bwojtowi,
thank you for the reply. Might you tell me, how you launch debugging for the lte-enb (commandline and working directory), or tell me which development IDE you are using?
I would like to keep maximum compatibility to the your git-repository for being able to merge newest changes, instead of rolling out an other build-system and directory-structure.
Thanks in advance.
Rob,
I currently use command line tools for debugging the enodeb application.
This includes:
- Building using cmake/make (follow the instructions in the README file)
- Capturing a debug log file using netcat (e.g. nc localhost 30001 >
log_file.txt)
- Capturing pcap files by setting the enable_pcap variable (e.g write
enable_pcap 1)
- Using gdb to debug crashes
Hope this helps,
Ben
On Mon, Feb 16, 2015 at 5:26 AM, Rob pforcht@users.sf.net wrote:
Hello,
I solved the problem with missing sourcefiles during debugging (either pure gdb or encapsulated in QtCreator) of the Application LTE_fdd_enodeb:
For pure GDB: Start gdb from the directory, where the Sourcefiles lie. This is <checkout-dir>/LTE_fdd_enodeb/src/
OR
add this directory manually to gdb's search path after launching gdb:
gdb> directory <checkout-dir>/LTE_fdd_enodeb/src
For encapsuled in QtCreator:
Goto Projects > Build&Run > Desktop > Build
Set Build directory: build
Seet CMake arguments: -DCMAKE_BUILD_TYPE=Debug
Goto Projects > Build&Run > Desktop > Run
Add Run configuration
Set Executable: <checkout-dir>/build/LTE_fdd_enodeb/LTE_fdd_enodeb
Set Working directory: <checkout-dir>/LTE_fdd_enodeb/src
Reason:
After inspecting the binary with objdump I noticed that all paths to external librarys/heades outside the /src-Directory are referenced by absolute full path - except the sourcefiles in the /src-Directory. These are referenced by only the filename and gdb won't find them, if it is launched from an other working dir.