Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Missing Symbol Table ( newbie question )
Missing Symbol Table ( newbie question ) [message #66702] Fri, 11 April 2003 15:45 Go to next message
Eclipse UserFriend
Originally posted by: sandro_de_santis.it.ibm.com

Hello,
I am having great fun with Eclipse, CDT and CGYWIN on Win2K.
I downloaded the latest stable versions about 15 days ago.
Even though my experience is really limited I could compile and run a
simple project.
I wrote the following .mak
************************************************************
Prj1 : Prog1.o
gcc -O Prj1 Prog1.o

Prog1.o : Prog1.c
gcc -ggdb -O Prog1.c

all :
make -f prog1.mak

..PHONY : clean
clean :
-del Prj1.exe -del *.o
****************************************

the project is compiled and runs correctly in native mode.
When I try to debug it I can stop the execution at the main()
but when I look at the gdb console I get the following:
************************************************************ **
info threads
No stack.
No symbol table is loaded. Use the "file" command.
info threads
2 thread 1412.0x9d4 * 1 thread 1412.0x588
************************************************************ ***

I'd appreciate any help.
Thank in advance
Sandro
Re: Missing Symbol Table ( newbie question ) [message #66725 is a reply to message #66702] Fri, 11 April 2003 15:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sandro_de_santis.it.ibm.com

I forgot to say that in these conditions Breakpoints do not work, nor
the program runs step by step. It simply keeps running in the gdb window
up to the completion.
Thank you,
Ciao
Sandro

Sandro De Santis wrote:

> Hello,
> I am having great fun with Eclipse, CDT and CGYWIN on Win2K.
> I downloaded the latest stable versions about 15 days ago.
> Even though my experience is really limited I could compile and run a
> simple project.
> I wrote the following .mak
> ************************************************************
> Prj1 : Prog1.o
> gcc -O Prj1 Prog1.o
>
> Prog1.o : Prog1.c
> gcc -ggdb -O Prog1.c
>
> all :
> make -f prog1.mak
>
> .PHONY : clean
> clean :
> -del Prj1.exe -del *.o
> ****************************************
>
> the project is compiled and runs correctly in native mode.
> When I try to debug it I can stop the execution at the main()
> but when I look at the gdb console I get the following:
> ************************************************************ **
> info threads
> No stack.
> No symbol table is loaded. Use the "file" command.
> info threads
> 2 thread 1412.0x9d4 * 1 thread 1412.0x588
> ************************************************************ ***
>
> I'd appreciate any help.
> Thank in advance
> Sandro
>
>
Re: Missing Symbol Table ( newbie question ) [message #66744 is a reply to message #66725] Fri, 11 April 2003 16:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mikhailk.qnx.com

Use '-o' instead of '-O' in your make file.

"Sandro De Santis" <sandro_de_santis@it.ibm.com> wrote in message
news:3E96E646.3000008@it.ibm.com...
> I forgot to say that in these conditions Breakpoints do not work, nor
> the program runs step by step. It simply keeps running in the gdb window
> up to the completion.
> Thank you,
> Ciao
> Sandro
>
> Sandro De Santis wrote:
>
> > Hello,
> > I am having great fun with Eclipse, CDT and CGYWIN on Win2K.
> > I downloaded the latest stable versions about 15 days ago.
> > Even though my experience is really limited I could compile and run a
> > simple project.
> > I wrote the following .mak
> > ************************************************************
> > Prj1 : Prog1.o
> > gcc -O Prj1 Prog1.o
> >
> > Prog1.o : Prog1.c
> > gcc -ggdb -O Prog1.c
> >
> > all :
> > make -f prog1.mak
> >
> > .PHONY : clean
> > clean :
> > -del Prj1.exe -del *.o
> > ****************************************
> >
> > the project is compiled and runs correctly in native mode.
> > When I try to debug it I can stop the execution at the main()
> > but when I look at the gdb console I get the following:
> > ************************************************************ **
> > info threads
> > No stack.
> > No symbol table is loaded. Use the "file" command.
> > info threads
> > 2 thread 1412.0x9d4 * 1 thread 1412.0x588
> > ************************************************************ ***
> >
> > I'd appreciate any help.
> > Thank in advance
> > Sandro
> >
> >
>
Re: Missing Symbol Table ( newbie question ) [message #66762 is a reply to message #66744] Fri, 11 April 2003 19:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sandro_de_santis.it.ibm.com

Thank you Mikhail for the quick response!!
I did as suggested but unfortunately there are no changes.
Now the gdb console shows the following:
------------------------------------------------------------ ------
info threads
No stack.
No symbol table is loaded. Use the "file" command.
info threads
2 thread 2472.0x9bc * 1 thread 2472.0x8b4 No symbol table is
loaded. Use the "file" command.
Single stepping until exit from function main,
which has no line number information.
------------------------------------------------------------ ---------
while the program is still running in suspended mode.

Thank you for your patience!!
Ciao
Sandro




Mikhail Khodjaiants wrote:

> Use '-o' instead of '-O' in your make file.
>
> "Sandro De Santis" <sandro_de_santis@it.ibm.com> wrote in message
> news:3E96E646.3000008@it.ibm.com...
>
>>I forgot to say that in these conditions Breakpoints do not work, nor
>>the program runs step by step. It simply keeps running in the gdb window
>>up to the completion.
>>Thank you,
>>Ciao
>>Sandro
>>
>>Sandro De Santis wrote:
>>
>>
>>>Hello,
>>>I am having great fun with Eclipse, CDT and CGYWIN on Win2K.
>>>I downloaded the latest stable versions about 15 days ago.
>>>Even though my experience is really limited I could compile and run a
>>>simple project.
>>>I wrote the following .mak
>>> ************************************************************
>>>Prj1 : Prog1.o
>>> gcc -O Prj1 Prog1.o
>>>
>>>Prog1.o : Prog1.c
>>> gcc -ggdb -O Prog1.c
>>>
>>>all :
>>> make -f prog1.mak
>>>
>>>.PHONY : clean
>>>clean :
>>> -del Prj1.exe -del *.o
>>>****************************************
>>>
>>>the project is compiled and runs correctly in native mode.
>>>When I try to debug it I can stop the execution at the main()
>>>but when I look at the gdb console I get the following:
>>> ************************************************************ **
>>>info threads
>>>No stack.
>>>No symbol table is loaded. Use the "file" command.
>>>info threads
>>> 2 thread 1412.0x9d4 * 1 thread 1412.0x588
>>> ************************************************************ ***
>>>
>>>I'd appreciate any help.
>>>Thank in advance
>>>Sandro
>>>
>>>
>>>
>
>
Re: Missing Symbol Table ( newbie question ) [message #66865 is a reply to message #66762] Fri, 11 April 2003 21:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mikhailk.qnx.com

Check if the full path of your executable contains space characters. This is
a bug in this version of CDT but it has been fixed in the head branch.

"Sandro De Santis" <sandro_de_santis@it.ibm.com> wrote in message
news:3E971AC5.4070600@it.ibm.com...
> Thank you Mikhail for the quick response!!
> I did as suggested but unfortunately there are no changes.
> Now the gdb console shows the following:
> ------------------------------------------------------------ ------
> info threads
> No stack.
> No symbol table is loaded. Use the "file" command.
> info threads
> 2 thread 2472.0x9bc * 1 thread 2472.0x8b4 No symbol table is
> loaded. Use the "file" command.
> Single stepping until exit from function main,
> which has no line number information.
> ------------------------------------------------------------ ---------
> while the program is still running in suspended mode.
>
> Thank you for your patience!!
> Ciao
> Sandro
>
>
>
>
> Mikhail Khodjaiants wrote:
>
> > Use '-o' instead of '-O' in your make file.
> >
> > "Sandro De Santis" <sandro_de_santis@it.ibm.com> wrote in message
> > news:3E96E646.3000008@it.ibm.com...
> >
> >>I forgot to say that in these conditions Breakpoints do not work, nor
> >>the program runs step by step. It simply keeps running in the gdb window
> >>up to the completion.
> >>Thank you,
> >>Ciao
> >>Sandro
> >>
> >>Sandro De Santis wrote:
> >>
> >>
> >>>Hello,
> >>>I am having great fun with Eclipse, CDT and CGYWIN on Win2K.
> >>>I downloaded the latest stable versions about 15 days ago.
> >>>Even though my experience is really limited I could compile and run a
> >>>simple project.
> >>>I wrote the following .mak
> >>> ************************************************************
> >>>Prj1 : Prog1.o
> >>> gcc -O Prj1 Prog1.o
> >>>
> >>>Prog1.o : Prog1.c
> >>> gcc -ggdb -O Prog1.c
> >>>
> >>>all :
> >>> make -f prog1.mak
> >>>
> >>>.PHONY : clean
> >>>clean :
> >>> -del Prj1.exe -del *.o
> >>>****************************************
> >>>
> >>>the project is compiled and runs correctly in native mode.
> >>>When I try to debug it I can stop the execution at the main()
> >>>but when I look at the gdb console I get the following:
> >>> ************************************************************ **
> >>>info threads
> >>>No stack.
> >>>No symbol table is loaded. Use the "file" command.
> >>>info threads
> >>> 2 thread 1412.0x9d4 * 1 thread 1412.0x588
> >>> ************************************************************ ***
> >>>
> >>>I'd appreciate any help.
> >>>Thank in advance
> >>>Sandro
> >>>
> >>>
> >>>
> >
> >
>
Re: Missing Symbol Table ( newbie question ) [message #66868 is a reply to message #66865] Fri, 11 April 2003 21:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mikhailk.qnx.com

Sorry, disregard the previous message.
It seems like your executable doesn't contain debug information. Can you
send your makefile?

"Mikhail Khodjaiants" <mikhailk@qnx.com> wrote in message
news:b77ach$lrk$1@rogue.oti.com...
> Check if the full path of your executable contains space characters. This
is
> a bug in this version of CDT but it has been fixed in the head branch.
>
> "Sandro De Santis" <sandro_de_santis@it.ibm.com> wrote in message
> news:3E971AC5.4070600@it.ibm.com...
> > Thank you Mikhail for the quick response!!
> > I did as suggested but unfortunately there are no changes.
> > Now the gdb console shows the following:
> > ------------------------------------------------------------ ------
> > info threads
> > No stack.
> > No symbol table is loaded. Use the "file" command.
> > info threads
> > 2 thread 2472.0x9bc * 1 thread 2472.0x8b4 No symbol table is
> > loaded. Use the "file" command.
> > Single stepping until exit from function main,
> > which has no line number information.
> > ------------------------------------------------------------ ---------
> > while the program is still running in suspended mode.
> >
> > Thank you for your patience!!
> > Ciao
> > Sandro
> >
> >
> >
> >
> > Mikhail Khodjaiants wrote:
> >
> > > Use '-o' instead of '-O' in your make file.
> > >
> > > "Sandro De Santis" <sandro_de_santis@it.ibm.com> wrote in message
> > > news:3E96E646.3000008@it.ibm.com...
> > >
> > >>I forgot to say that in these conditions Breakpoints do not work, nor
> > >>the program runs step by step. It simply keeps running in the gdb
window
> > >>up to the completion.
> > >>Thank you,
> > >>Ciao
> > >>Sandro
> > >>
> > >>Sandro De Santis wrote:
> > >>
> > >>
> > >>>Hello,
> > >>>I am having great fun with Eclipse, CDT and CGYWIN on Win2K.
> > >>>I downloaded the latest stable versions about 15 days ago.
> > >>>Even though my experience is really limited I could compile and run a
> > >>>simple project.
> > >>>I wrote the following .mak
> > >>> ************************************************************
> > >>>Prj1 : Prog1.o
> > >>> gcc -O Prj1 Prog1.o
> > >>>
> > >>>Prog1.o : Prog1.c
> > >>> gcc -ggdb -O Prog1.c
> > >>>
> > >>>all :
> > >>> make -f prog1.mak
> > >>>
> > >>>.PHONY : clean
> > >>>clean :
> > >>> -del Prj1.exe -del *.o
> > >>>****************************************
> > >>>
> > >>>the project is compiled and runs correctly in native mode.
> > >>>When I try to debug it I can stop the execution at the main()
> > >>>but when I look at the gdb console I get the following:
> > >>> ************************************************************ **
> > >>>info threads
> > >>>No stack.
> > >>>No symbol table is loaded. Use the "file" command.
> > >>>info threads
> > >>> 2 thread 1412.0x9d4 * 1 thread 1412.0x588
> > >>> ************************************************************ ***
> > >>>
> > >>>I'd appreciate any help.
> > >>>Thank in advance
> > >>>Sandro
> > >>>
> > >>>
> > >>>
> > >
> > >
> >
>
>
Re: Missing Symbol Table ( newbie question ) [message #66875 is a reply to message #66868] Sat, 12 April 2003 11:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sandro_de_santis.it.ibm.com

Mikhail, please forgive me as I sent some misleading info.
First this is my current makefile:
------------------------------------------------------------ -----
Prj1 : Prog1.o
gcc -o Prj1 Prog1.o

Prog1.o : Prog1.c
gcc -ggdb -o Prog1.c

all :
make -f prog1.mak

..PHONY : clean
clean :
-del Prj1.exe -del *.o
------------------------------------------------------------ ----------
When I started this thread I used the -O and I could get a clean build
but I was missing debugging info.

Then you suggested to use -o I did it and I tried again, but I didn't
build correctly the project again, so in fact the second time I used the
very first build.
Whne I deleted .o and .exe and rebuilt with -o I didn't get a clean
build and the messages I get are as follows:
------------------------------------------------------------ ----------
***(all) Error 2
***(Prog1.o) Error 1
------------------------------------------------------------ ----------
Maybe the installation of CGYWIN is not correct but I don't know how to
go further.

Thank you again,
Ciao
Sandro


Mikhail Khodjaiants wrote:

> Sorry, disregard the previous message.
> It seems like your executable doesn't contain debug information. Can you
> send your makefile?
>
> "Mikhail Khodjaiants" <mikhailk@qnx.com> wrote in message
> news:b77ach$lrk$1@rogue.oti.com...
>
>>Check if the full path of your executable contains space characters. This
>>
> is
>
>>a bug in this version of CDT but it has been fixed in the head branch.
>>
>>"Sandro De Santis" <sandro_de_santis@it.ibm.com> wrote in message
>>news:3E971AC5.4070600@it.ibm.com...
>>
>>>Thank you Mikhail for the quick response!!
>>>I did as suggested but unfortunately there are no changes.
>>>Now the gdb console shows the following:
>>> ------------------------------------------------------------ ------
>>>info threads
>>>No stack.
>>>No symbol table is loaded. Use the "file" command.
>>>info threads
>>> 2 thread 2472.0x9bc * 1 thread 2472.0x8b4 No symbol table is
>>>loaded. Use the "file" command.
>>>Single stepping until exit from function main,
>>>which has no line number information.
>>> ------------------------------------------------------------ ---------
>>>while the program is still running in suspended mode.
>>>
>>>Thank you for your patience!!
>>>Ciao
>>>Sandro
>>>
>>>
>>>
>>>
>>>Mikhail Khodjaiants wrote:
>>>
>>>
>>>>Use '-o' instead of '-O' in your make file.
>>>>
>>>>"Sandro De Santis" <sandro_de_santis@it.ibm.com> wrote in message
>>>>news:3E96E646.3000008@it.ibm.com...
>>>>
>>>>
>>>>>I forgot to say that in these conditions Breakpoints do not work, nor
>>>>>the program runs step by step. It simply keeps running in the gdb
>>>>>
> window
>
>>>>>up to the completion.
>>>>>Thank you,
>>>>>Ciao
>>>>>Sandro
>>>>>
>>>>>Sandro De Santis wrote:
>>>>>
>>>>>
>>>>>
>>>>>>Hello,
>>>>>>I am having great fun with Eclipse, CDT and CGYWIN on Win2K.
>>>>>>I downloaded the latest stable versions about 15 days ago.
>>>>>>Even though my experience is really limited I could compile and run a
>>>>>>simple project.
>>>>>>I wrote the following .mak
>>>>>> ************************************************************
>>>>>>Prj1 : Prog1.o
>>>>>> gcc -O Prj1 Prog1.o
>>>>>>
>>>>>>Prog1.o : Prog1.c
>>>>>> gcc -ggdb -O Prog1.c
>>>>>>
>>>>>>all :
>>>>>> make -f prog1.mak
>>>>>>
>>>>>>.PHONY : clean
>>>>>>clean :
>>>>>> -del Prj1.exe -del *.o
>>>>>>****************************************
>>>>>>
>>>>>>the project is compiled and runs correctly in native mode.
>>>>>>When I try to debug it I can stop the execution at the main()
>>>>>>but when I look at the gdb console I get the following:
>>>>>> ************************************************************ **
>>>>>>info threads
>>>>>>No stack.
>>>>>>No symbol table is loaded. Use the "file" command.
>>>>>>info threads
>>>>>> 2 thread 1412.0x9d4 * 1 thread 1412.0x588
>>>>>> ************************************************************ ***
>>>>>>
>>>>>>I'd appreciate any help.
>>>>>>Thank in advance
>>>>>>Sandro
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>
>
>
Re: Missing Symbol Table ( newbie question ) [message #66880 is a reply to message #66702] Sun, 13 April 2003 02:33 Go to previous messageGo to next message
Henning Riedel is currently offline Henning RiedelFriend
Messages: 310
Registered: July 2009
Senior Member
Your Makefile is awefully filled with mistakes!

* -O is for optimizations --> -o <file> is for "output into <file>"
* your target Prj is missing an extension! in you clean rule you wrote
it right
* The first target in you Makefile is 'Prj1', and your 'all' rules is
way below and looks really useless, since Eclipse calls the build
process this way:
make clean
make

Here is a more proper Makefile:

############################################################ ################
# Makefile for compiling simple projects
# depends on GNU Make and other GNU Tools
# Henning Riedel
############################################################ ################
# set your programs here and add neccesary object-files here
TargetArch = Windows
ifeq ($(TargetArch),"Windows")
EXE_EXTENSION = .exe
LIB_EXTENSION = .lib
elsis ($(TargetArch),"Unix")
EXE_EXTENSION =
LIB_EXTENSION = .a
endif

PROG1 = myprog$(EXE_EXTENSION)
PROG1_OBJ = myprog.o extramodule.o
PROG2 = anotherprog$(EXE_EXTENSION)
PROG2_OBJ = anotherprog.o othermodule.o
LIB1 = mylibrary$(LIB_EXTENSION)
LIB1_OBJ = module.o module2.o module3.o

CLEANFILES = $(PROG1) $(PROG1_OBJ)
CLEANFILES += $(PROG2) $(PROG2_OBJ)
CLEANFILES += $(LIB1) $(LIB1_OBJ)

# setup some needed tools and their flags and some include/library-paths
CC = gcc
AR = ar
RM = -rm -f
# for windows you could use
#RM = -del
# actually gdb is most likely the default debugger
# though -g would be good too
C_DEBUG = -ggdb
CFLAGS = $(C_DEBUG) -I<extraincludedirs>
LDFLAGS = -L<extralibs_dirpath> -lc

# these targets are no real files!
..PHONY: all debug clean
# the default target, if make is being called _without_ target
..DEFAULT: all

# if target 'all' is set, clear C_DEBUG
all:
$(MAKE) "C_DEBUG=" $(PROG1) $(PROG2) $(LIB1)

debug:
$(MAKE) $(PROG1) $(PROG2) $(LIB1)

$(PROG1): $(PROG1_OBJ)
$(CC) -o $@ $< $(LDFLAGS)

# rule for building PROG2
$(PROG2): $(PROG2_OBJ)
$(CC) -o $@ $< $(LDFLAGS)

# rule for building a static library
# actually build all LIB1_OBJ-files before by calling the %o:-rule
# and then more or less copy them into the .a file
$(LIB1): $(LIB_OBJ)
$(AR) cr $@ $<

# general rule for compiling C-Files to objects
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $^

# general rule for compiling C++-Files to objects
%.o: %.cpp
$(CXX) $(CXXFLAGS) -o $@ -c $^

clean:
$(RM) $(CLEANFILES)
############################################################ ################
#### add dependencies below and if one of these file in the deps
#### is changed, compile the files again
myprog.o: myprog.c myprog.h extramodule.h
anotherprog.o: anothermodule.c anothermodule.h othermodule.h
extramodule.o: extramodule.c extramodule.h
othermodule.o: othermodule.c othermodule.h
module1.o: module1.c module1.h
module2.o: module2.c module2h
module3.o: module3.c module3.h

################### Makefile End #######################################
############################################################ ################

I have pasted a Makefile here before which also checks MAKECMDGLOBALS if
make is called with 'debug' to either set C_DEBUG or not.

kesselhaus

Sandro De Santis schrieb:
> Hello,
> I am having great fun with Eclipse, CDT and CGYWIN on Win2K.
> I downloaded the latest stable versions about 15 days ago.
> Even though my experience is really limited I could compile and run a
> simple project.
> I wrote the following .mak
> ************************************************************
> Prj1 : Prog1.o
> gcc -O Prj1 Prog1.o
>
> Prog1.o : Prog1.c
> gcc -ggdb -O Prog1.c
>
> all :
> make -f prog1.mak
>
> .PHONY : clean
> clean :
> -del Prj1.exe -del *.o
> ****************************************
>
> the project is compiled and runs correctly in native mode.
> When I try to debug it I can stop the execution at the main()
> but when I look at the gdb console I get the following:
> ************************************************************ **
> info threads
> No stack.
> No symbol table is loaded. Use the "file" command.
> info threads
> 2 thread 1412.0x9d4 * 1 thread 1412.0x588
> ************************************************************ ***
>
> I'd appreciate any help.
> Thank in advance
> Sandro
>
>
Re: Missing Symbol Table ( newbie question ) [message #66915 is a reply to message #66880] Mon, 14 April 2003 15:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sandro_de_santis.it.ibm.com

Thank you!!!
I modified your makefile and could consistently build my test program.

Unfortunately I still cannot run the program step by step nor
stop at breakpoints.
I did also the following:
- copied the files ( .c and .mak ) into the native cygwin environment
- built the program again
- compared the size of the .exes : they are the same.
- then I rebuilt ( in cygwin ) the program WITHOUT the -g or -ggdb
options and THE SIZE REMAINS THE SAME!!!
No Debugging info are added in either cases.

So, it looks like a problem in cygwin.
I subscribed to the cygwin@cygwin.com but I have problems because my
e-mails are rejected.

I'll try anyway to reach that mailing list.
Thanks to all for the helpful info.
ciao
Sandro



kesselhaus wrote:

> Your Makefile is awefully filled with mistakes!
>
> * -O is for optimizations --> -o <file> is for "output into <file>"
> * your target Prj is missing an extension! in you clean rule you wrote
> it right
> * The first target in you Makefile is 'Prj1', and your 'all' rules is
> way below and looks really useless, since Eclipse calls the build
> process this way:
> make clean
> make
>
> Here is a more proper Makefile:
>
> ############################################################ ################
>
> # Makefile for compiling simple projects
> # depends on GNU Make and other GNU Tools
> # Henning Riedel
> ############################################################ ################
>
> # set your programs here and add neccesary object-files here
> TargetArch = Windows
> ifeq ($(TargetArch),"Windows")
> EXE_EXTENSION = .exe
> LIB_EXTENSION = .lib
> elsis ($(TargetArch),"Unix")
> EXE_EXTENSION =
> LIB_EXTENSION = .a
> endif
>
> PROG1 = myprog$(EXE_EXTENSION)
> PROG1_OBJ = myprog.o extramodule.o
> PROG2 = anotherprog$(EXE_EXTENSION)
> PROG2_OBJ = anotherprog.o othermodule.o
> LIB1 = mylibrary$(LIB_EXTENSION)
> LIB1_OBJ = module.o module2.o module3.o
>
> CLEANFILES = $(PROG1) $(PROG1_OBJ)
> CLEANFILES += $(PROG2) $(PROG2_OBJ)
> CLEANFILES += $(LIB1) $(LIB1_OBJ)
>
> # setup some needed tools and their flags and some include/library-paths
> CC = gcc
> AR = ar
> RM = -rm -f
> # for windows you could use
> #RM = -del
> # actually gdb is most likely the default debugger
> # though -g would be good too
> C_DEBUG = -ggdb
> CFLAGS = $(C_DEBUG) -I<extraincludedirs>
> LDFLAGS = -L<extralibs_dirpath> -lc
>
> # these targets are no real files!
> .PHONY: all debug clean
> # the default target, if make is being called _without_ target
> .DEFAULT: all
>
> # if target 'all' is set, clear C_DEBUG
> all:
> $(MAKE) "C_DEBUG=" $(PROG1) $(PROG2) $(LIB1)
>
> debug:
> $(MAKE) $(PROG1) $(PROG2) $(LIB1)
>
> $(PROG1): $(PROG1_OBJ)
> $(CC) -o $@ $< $(LDFLAGS)
>
> # rule for building PROG2
> $(PROG2): $(PROG2_OBJ)
> $(CC) -o $@ $< $(LDFLAGS)
>
> # rule for building a static library
> # actually build all LIB1_OBJ-files before by calling the %o:-rule
> # and then more or less copy them into the .a file
> $(LIB1): $(LIB_OBJ)
> $(AR) cr $@ $<
>
> # general rule for compiling C-Files to objects
> %.o: %.c
> $(CC) $(CFLAGS) -o $@ -c $^
>
> # general rule for compiling C++-Files to objects
> %.o: %.cpp
> $(CXX) $(CXXFLAGS) -o $@ -c $^
>
> clean:
> $(RM) $(CLEANFILES)
> ############################################################ ################
>
> #### add dependencies below and if one of these file in the deps
> #### is changed, compile the files again
> myprog.o: myprog.c myprog.h extramodule.h
> anotherprog.o: anothermodule.c anothermodule.h othermodule.h
> extramodule.o: extramodule.c extramodule.h
> othermodule.o: othermodule.c othermodule.h
> module1.o: module1.c module1.h
> module2.o: module2.c module2h
> module3.o: module3.c module3.h
>
> ################### Makefile End #######################################
> ############################################################ ################
>
>
> I have pasted a Makefile here before which also checks MAKECMDGLOBALS if
> make is called with 'debug' to either set C_DEBUG or not.
>
> kesselhaus
>
> Sandro De Santis schrieb:
>
>> Hello,
>> I am having great fun with Eclipse, CDT and CGYWIN on Win2K.
>> I downloaded the latest stable versions about 15 days ago.
>> Even though my experience is really limited I could compile and run a
>> simple project.
>> I wrote the following .mak
>> ************************************************************
>> Prj1 : Prog1.o
>> gcc -O Prj1 Prog1.o
>>
>> Prog1.o : Prog1.c
>> gcc -ggdb -O Prog1.c
>>
>> all :
>> make -f prog1.mak
>>
>> .PHONY : clean
>> clean :
>> -del Prj1.exe -del *.o
>> ****************************************
>>
>> the project is compiled and runs correctly in native mode.
>> When I try to debug it I can stop the execution at the main()
>> but when I look at the gdb console I get the following:
>> ************************************************************ **
>> info threads
>> No stack.
>> No symbol table is loaded. Use the "file" command.
>> info threads
>> 2 thread 1412.0x9d4 * 1 thread 1412.0x588
>> ************************************************************ ***
>>
>> I'd appreciate any help.
>> Thank in advance
>> Sandro
>>
>>
>
Re: Missing Symbol Table ( newbie question ) [message #66942 is a reply to message #66915] Tue, 15 April 2003 16:37 Go to previous messageGo to next message
Henning Riedel is currently offline Henning RiedelFriend
Messages: 310
Registered: July 2009
Senior Member
The first is by myself :(

In the top ifeq... the elsis must be written as:
else
ifeq ($(TargetArch),"Unix")
....
endif
endif
since make does not recognize nested conditional statements.

The second mistake is yours.
In the debug: -rule, their is no "C_DEBUG=", since this would clear out
this variable!
Thats why I added it just in the 'all'-rule, where you dont want debug
infos usually.
The make command in the debug-rule should be:
<tab>$(MAKE) $(PROG1)

Also, if you set .DEFAULT: debug, you dont need to move the debug rule
above the all-rule.

kesselhaus

Sandro De Santis schrieb:
> Thank you!!!
> I modified your makefile and could consistently build my test program.
>
> Unfortunately I still cannot run the program step by step nor
> stop at breakpoints.
> I did also the following:
> - copied the files ( .c and .mak ) into the native cygwin environment
> - built the program again
> - compared the size of the .exes : they are the same.
> - then I rebuilt ( in cygwin ) the program WITHOUT the -g or -ggdb
> options and THE SIZE REMAINS THE SAME!!!
> No Debugging info are added in either cases.
>
> So, it looks like a problem in cygwin.
> I subscribed to the cygwin@cygwin.com but I have problems because my
> e-mails are rejected.
>
> I'll try anyway to reach that mailing list.
> Thanks to all for the helpful info.
> ciao
> Sandro
>
>
>
> kesselhaus wrote:
>
>> Your Makefile is awefully filled with mistakes!
>>
>> * -O is for optimizations --> -o <file> is for "output into <file>"
>> * your target Prj is missing an extension! in you clean rule you wrote
>> it right
>> * The first target in you Makefile is 'Prj1', and your 'all' rules is
>> way below and looks really useless, since Eclipse calls the build
>> process this way:
>> make clean
>> make
>>
>> Here is a more proper Makefile:
>>
>> ############################################################ ################
>>
>> # Makefile for compiling simple projects
>> # depends on GNU Make and other GNU Tools
>> # Henning Riedel
>> ############################################################ ################
>>
>> # set your programs here and add neccesary object-files here
>> TargetArch = Windows
>> ifeq ($(TargetArch),"Windows")
>> EXE_EXTENSION = .exe
>> LIB_EXTENSION = .lib
>> elsis ($(TargetArch),"Unix")
>> EXE_EXTENSION =
>> LIB_EXTENSION = .a
>> endif
>>
>> PROG1 = myprog$(EXE_EXTENSION)
>> PROG1_OBJ = myprog.o extramodule.o
>> PROG2 = anotherprog$(EXE_EXTENSION)
>> PROG2_OBJ = anotherprog.o othermodule.o
>> LIB1 = mylibrary$(LIB_EXTENSION)
>> LIB1_OBJ = module.o module2.o module3.o
>>
>> CLEANFILES = $(PROG1) $(PROG1_OBJ)
>> CLEANFILES += $(PROG2) $(PROG2_OBJ)
>> CLEANFILES += $(LIB1) $(LIB1_OBJ)
>>
>> # setup some needed tools and their flags and some include/library-paths
>> CC = gcc
>> AR = ar
>> RM = -rm -f
>> # for windows you could use
>> #RM = -del
>> # actually gdb is most likely the default debugger
>> # though -g would be good too
>> C_DEBUG = -ggdb
>> CFLAGS = $(C_DEBUG) -I<extraincludedirs>
>> LDFLAGS = -L<extralibs_dirpath> -lc
>>
>> # these targets are no real files!
>> .PHONY: all debug clean
>> # the default target, if make is being called _without_ target
>> .DEFAULT: all
>>
>> # if target 'all' is set, clear C_DEBUG
>> all:
>> $(MAKE) "C_DEBUG=" $(PROG1) $(PROG2) $(LIB1)
>>
>> debug:
>> $(MAKE) $(PROG1) $(PROG2) $(LIB1)
>>
>> $(PROG1): $(PROG1_OBJ)
>> $(CC) -o $@ $< $(LDFLAGS)
>>
>> # rule for building PROG2
>> $(PROG2): $(PROG2_OBJ)
>> $(CC) -o $@ $< $(LDFLAGS)
>>
>> # rule for building a static library
>> # actually build all LIB1_OBJ-files before by calling the %o:-rule
>> # and then more or less copy them into the .a file
>> $(LIB1): $(LIB_OBJ)
>> $(AR) cr $@ $<
>>
>> # general rule for compiling C-Files to objects
>> %.o: %.c
>> $(CC) $(CFLAGS) -o $@ -c $^
>>
>> # general rule for compiling C++-Files to objects
>> %.o: %.cpp
>> $(CXX) $(CXXFLAGS) -o $@ -c $^
>>
>> clean:
>> $(RM) $(CLEANFILES)
>> ############################################################ ################
>>
>> #### add dependencies below and if one of these file in the deps
>> #### is changed, compile the files again
>> myprog.o: myprog.c myprog.h extramodule.h
>> anotherprog.o: anothermodule.c anothermodule.h othermodule.h
>> extramodule.o: extramodule.c extramodule.h
>> othermodule.o: othermodule.c othermodule.h
>> module1.o: module1.c module1.h
>> module2.o: module2.c module2h
>> module3.o: module3.c module3.h
>>
>> ################### Makefile End #######################################
>> ############################################################ ################
>>
>>
>> I have pasted a Makefile here before which also checks MAKECMDGLOBALS if
>> make is called with 'debug' to either set C_DEBUG or not.
>>
>> kesselhaus
>>
>> Sandro De Santis schrieb:
>>
>>> Hello,
>>> I am having great fun with Eclipse, CDT and CGYWIN on Win2K.
>>> I downloaded the latest stable versions about 15 days ago.
>>> Even though my experience is really limited I could compile and run a
>>> simple project.
>>> I wrote the following .mak
>>> ************************************************************
>>> Prj1 : Prog1.o
>>> gcc -O Prj1 Prog1.o
>>>
>>> Prog1.o : Prog1.c
>>> gcc -ggdb -O Prog1.c
>>>
>>> all :
>>> make -f prog1.mak
>>>
>>> .PHONY : clean
>>> clean :
>>> -del Prj1.exe -del *.o
>>> ****************************************
>>>
>>> the project is compiled and runs correctly in native mode.
>>> When I try to debug it I can stop the execution at the main()
>>> but when I look at the gdb console I get the following:
>>> ************************************************************ **
>>> info threads
>>> No stack.
>>> No symbol table is loaded. Use the "file" command.
>>> info threads
>>> 2 thread 1412.0x9d4 * 1 thread 1412.0x588
>>> ************************************************************ ***
>>>
>>> I'd appreciate any help.
>>> Thank in advance
>>> Sandro
>>>
>>>
>>
>
Re: Missing Symbol Table ( newbie question ) [message #67012 is a reply to message #66702] Thu, 17 April 2003 15:13 Go to previous message
Eclipse UserFriend
Originally posted by: brianr1026.netscape.net

Regardless of the details of your makefile, if you can build and run from
the Cygwin shell, but get

> No symbol table is loaded. Use the "file" command.
> info threads

when you try to debug within CDT, it is because there are spaces in the
path to your project. Move the project to a path without spaces, or move
the entier Eclipse install to a path without spaces and it should work. I
was tearing my hair out over the same problem.

Brian


Sandro De Santis wrote:

> Hello,
> I am having great fun with Eclipse, CDT and CGYWIN on Win2K.
> I downloaded the latest stable versions about 15 days ago.
> Even though my experience is really limited I could compile and run a
> simple project.
> I wrote the following .mak
> ************************************************************
> Prj1 : Prog1.o
> gcc -O Prj1 Prog1.o

> Prog1.o : Prog1.c
> gcc -ggdb -O Prog1.c

> all :
> make -f prog1.mak

> ..PHONY : clean
> clean :
> -del Prj1.exe -del *.o
> ****************************************

> the project is compiled and runs correctly in native mode.
> When I try to debug it I can stop the execution at the main()
> but when I look at the gdb console I get the following:
> ************************************************************ **
> info threads
> No stack.
> No symbol table is loaded. Use the "file" command.
> info threads
> 2 thread 1412.0x9d4 * 1 thread 1412.0x588
> ************************************************************ ***

> I'd appreciate any help.
> Thank in advance
> Sandro
Previous Topic:pasting into folders in C/C++ Projects view
Next Topic:CDT Debugger won't initialize...
Goto Forum:
  


Current Time: Sun Dec 22 06:15:34 GMT 2024

Powered by FUDForum. Page generated in 0.04678 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top