Debugging dll's from eclipse/gluon with gdb | developer.brewmp.com Debugging dll's from eclipse/gluon with gdb | developer.brewmp.com

Developer

Debugging dll's from eclipse/gluon with gdb

Guys, I've build a simulator helloworld application with gnu compiler
and want to debug it with gdb. However, every time I invoke the debugger I get
a notification message that no symbols were loaded.
Does anobody know how to solve this issue?

This is an output I get when building the application

gcc -DAEE_SIMULATOR -DDYNAMIC_APP -I"C:\Program Files\BREW SDK v2.1.3\inc" -I"C:\gnude\lib\gcc-lib\arm-elf\3.3.1" -O0 -g -Wall -c -ggdb -ffixed-ip -MMD -MP -MF"AEEAppGen.d" -MT"AEEAppGen.d" -o"AEEAppGen.o" "../AEEAppGen.c"
cc1: warning: unknown register name: ip
Finished building: ../AEEAppGen.c

Building file: ../GCCResolver.c
Invoking: GCC C Compiler
gcc -DAEE_SIMULATOR -DDYNAMIC_APP -I"C:\Program Files\BREW SDK v2.1.3\inc" -I"C:\gnude\lib\gcc-lib\arm-elf\3.3.1" -O0 -g -Wall -c -ggdb -ffixed-ip -MMD -MP -MF"GCCResolver.d" -MT"GCCResolver.d" -o"GCCResolver.o" "../GCCResolver.c"
cc1: warning: unknown register name: ip
Finished building: ../GCCResolver.c

Building file: ../gnude.c
Invoking: GCC C Compiler
gcc -DAEE_SIMULATOR -DDYNAMIC_APP -I"C:\Program Files\BREW SDK v2.1.3\inc" -I"C:\gnude\lib\gcc-lib\arm-elf\3.3.1" -O0 -g -Wall -c -ggdb -ffixed-ip -MMD -MP -MF"gnude.d" -MT"gnude.d" -o"gnude.o" "../gnude.c"
cc1: warning: unknown register name: ip
Finished building: ../gnude.c

Building target: gnude.dll
Invoking: GCC C++ Linker
g++ -nostdlib -LC:\gnude\lib\gcc-lib\arm-elf\3.3.1\inc -shared -o"gnude.dll" ./AEEModGen.o ./AEEAppGen.o ./GCCResolver.o ./gnude.o
Finished building target: gnude.dll

Build complete for project gnude

Thank you!

Hi Brewee,
GDB can't run a DLL directly.
You have to start the BREW_Simulator.exe with GDB and then load your DLL.
First :
Create a text file "gdbInit" which contains :
dll-symbols .dll
b main.cpp:
Second:
With Eclipse, menu Run --> debug...
On your configuration :
- tab "Main" : fill the field "C/C++ Application:" with "\BREW_Simulator.exe".
- tab "Debugger" : fill the field "GDB command file" with your "gdbInit" text file.
This make GDB launch the Simulator.exe, load symbols from your dll and set a breakpoint in your code.
But this is not sufficient :(. I'm stuck at this point.
GDB don't trigger the breakpoint.
I've just posted about this question yesterday:
http://brewforums.qualcomm.com/showthread.php?t=15384
Maybe you can go further than me...
--
Philippe

Hi Brewee,
GDB can't run a DLL directly.
You have to start the BREW_Simulator.exe with GDB and then load your DLL.
First :
Create a text file "gdbInit" which contains :
dll-symbols .dll
b main.cpp:
Second:
With Eclipse, menu Run --> debug...
On your configuration :
- tab "Main" : fill the field "C/C++ Application:" with "\BREW_Simulator.exe".
- tab "Debugger" : fill the field "GDB command file" with your "gdbInit" text file.
This make GDB launch the Simulator.exe, load symbols from your dll and set a breakpoint in your code.
But this is not sufficient :(. I'm stuck at this point.
GDB don't trigger the breakpoint.
I've just posted about this question yesterday:
http://brewforums.qualcomm.com/showthread.php?t=15384
Maybe you can go further than me...
--
Philippe

Thank you Ph_Zenops,
I've done what you've said.
But faced the same problem as you. My breakpoints are ignored.
Perhaps, somebody knows how to invoke gdb with brew_simulator.exe and myapp.dll
Please, give a hint!

Thank you Ph_Zenops,
I've done what you've said.
But faced the same problem as you. My breakpoints are ignored.
Perhaps, somebody knows how to invoke gdb with brew_simulator.exe and myapp.dll
Please, give a hint!

Hi,
I've made a small step ahead.
What I have make :
. use "g++" to link instead of "ld",
. add the "-Wl,--export-all-symbols" command to the g++ linker,
. install MinGW-5.1.3,
. install the gcc-g++-3.4.5-20060117-1 update form the MinGW Candidate release,
. install gdb-5.2.1-1 version form the MinGW Current release.
Now, from the command line, I can set breakpoints with line numbers or with symbols, and gdb stop when a breakpoint is reached !
I can step forward line by line... etc...
But, I have to dig more. This is not working with Eclipse :(
Eclipse don't enable the step/into/over buttons...
--
Philippe

Hi,
I've made a small step ahead.
What I have make :
. use "g++" to link instead of "ld",
. add the "-Wl,--export-all-symbols" command to the g++ linker,
. install MinGW-5.1.3,
. install the gcc-g++-3.4.5-20060117-1 update form the MinGW Candidate release,
. install gdb-5.2.1-1 version form the MinGW Current release.
Now, from the command line, I can set breakpoints with line numbers or with symbols, and gdb stop when a breakpoint is reached !
I can step forward line by line... etc...
But, I have to dig more. This is not working with Eclipse :(
Eclipse don't enable the step/into/over buttons...
--
Philippe

Thanks a lot, Ph_Zenops!
I managed to debug brew dll when I installed Gluon and tried gdb-6.3-2.exe. Breakpoints are triggered :)
Gluon is Eclipse adjusted for BREW
Here is a link to a thread about GLUON
http://brewforums.qualcomm.com/showthread.php?t=15160&highlight=gluon
or just download it from here:
gluon home page

Thanks a lot, Ph_Zenops!
I managed to debug brew dll when I installed Gluon and tried gdb-6.3-2.exe. Breakpoints are triggered :)
Gluon is Eclipse adjusted for BREW
Here is a link to a thread about GLUON
http://brewforums.qualcomm.com/showthread.php?t=15160&highlight=gluon
or just download it from here:
gluon home page

brewee wrote:I managed to debug brew dll when I installed Gluon and tried gdb-6.3-2.exe. Breakpoints are triggered :)
Great !
Can you describe your settings ?
GDB 6.3.2 doesn't work for me....
--
Philippe
PS: I did not know the existance of Gluon. BTW, I can't use it due to technical & commercial reasons.

brewee wrote:I managed to debug brew dll when I installed Gluon and tried gdb-6.3-2.exe. Breakpoints are triggered :)
Great !
Can you describe your settings ?
GDB 6.3.2 doesn't work for me....
--
Philippe
PS: I did not know the existance of Gluon. BTW, I can't use it due to technical & commercial reasons.

hi all,
Just to finish the thread,
I finally succeeded in tracing my code under eclipse/gdb.
I installed all the last versions:
jdk6u1,
eclipse 3.3M6,
cdt 4.0.0M6,
gdb 6.3.2.
My company did not want to update its tools suite.
They will not have any more the choice... :)
--
Philippe

hi all,
Just to finish the thread,
I finally succeeded in tracing my code under eclipse/gdb.
I installed all the last versions:
jdk6u1,
eclipse 3.3M6,
cdt 4.0.0M6,
gdb 6.3.2.
My company did not want to update its tools suite.
They will not have any more the choice... :)
--
Philippe