1748255 Members
3999 Online
108760 Solutions
New Discussion юеВ

Re: GDB

 
SOLVED
Go to solution
j0nas
New Member

GDB

Is ther any propblem when compiling Pro C programs using the -g flag?

When i run gdb it allways gives me (no debugging symbols found).

I tried with a simple c program and it is alright but with the Pro C makefile it doesn't work. I've done some research but i could'nt find anything.

Can anyone help??

My Hp Ux version is HP-UX 11i v1
and my Gdb version is 5.4.0
9 REPLIES 9
Steven Schweda
Honored Contributor

Re: GDB

I know nothing, but ...

How did you specify "the -g flag" when
"compiling Pro C programs"?

> [...] with the Pro C makefile it doesn't
> work.

And what's in "the Pro C makefile"?

Assuming that this is actually Oracle Pro*C,
I'm told that "Your system-specific Oracle
documentation has instructions on how to link
a Pro*C/C++ application." Have you looked?
Dennis Handly
Acclaimed Contributor

Re: GDB

What's your compiler version? It seems you must be using gcc, since gdb 5.4.0 isn't HP's wdb?
nitinjain
Occasional Advisor

Re: GDB

In general it is recommended to use latest WDB version (i.e. WDB 6.0). However WDB does not support Pro C.
j0nas
New Member

Re: GDB

Thank you for the reply, wdb could be an option by i can only access the server through telnet, and i can't open a display to use it.

I'm using cc to compile the program and i added the -g option to every compile lines in the makefile.

env_pre.mk

GFLAG = -g +d
CFLAGS = -c -I$(REFHEA) -I$(USRXIT) -D_HPUX_SOURCE +DAportable -Ae
CFLAGS1 = -c -I$(REFHEA) -I$(USRXIT) -D_HPUX_SOURCE +DAportable -Ae


makefile

$(CC) $(GFLAG) $(CFLAGS1) $(EXEC).c -o $@


the files have more code, but i would rather not to post here both code.

I think i have tryied everything, and i've seen posts with people saying that it works.


If you need more information i'll send it.


Thank you.
Jo├Г┬гo Lopes
Dennis Handly
Acclaimed Contributor

Re: GDB

>wdb could be an option by I can only access the server through telnet

WDB comes with wdb and HP's gdb, use the latter.

>I added the -g option to every compile lines

Did you also add it to the link line?
j0nas
New Member

Re: GDB

$(CC) $(GFLAG) $(LDFLAGS) $^ $(OBJS) $(PROLDLIBS) -lcurses

This is the link line, correct?? I added the -g option to this line and it didn't work.

I didn't made the makefile, it was already made, but there was no debugging option, wich can be a pain...

It's strange because i made a simple c program to test, and it worked, it must have something to do with my makefile correct...

include env_pre.mk

MKFLIBS=$(URLIB) $(USERLIB)

IAP_MK=$(EXEC).o
#$(IAPOUT)/$(EXEC): $(IAP_MK) $(MKFLIBS)
$(EXEC): $(IAP_MK) $(MKFLIBS)


@echo " HEELOO"
@echo " ******** Linkagem ******** "
@echo
$(CC) $(GFLAG) $(LDFLAGS) $^ $(OBJS) $(PROLDLIBS) -lcurses
@echo " ******** Stripagem ******** "
@echo
strip $@
chatr +s enable $@
#@rm -f $(EXEC).o
@echo
@cp $(EXEC) $(HOME)$(VERS)/BIN
@echo
@echo " ******** Link/Strip Completos ******** "
@echo
@echo " *************************************** "
@echo " ******** FIM COMPILACAO <$(EXEC).pc> "
@echo " *************************************** "
@echo
@echo
@echo
@echo
@echo

$(EXEC).o: $(EXEC).pc
@echo
@echo " *************************************** "
@echo " ******** INICIO COMPILACAO <$(EXEC).pc> "
@echo " *************************************** "
@echo
@echo " ********** Pre Compilacao ********** "
@echo
@echo
$(PROC) $(PROCPLSFLAGS) iname=$^
@echo
@echo " ********** Compilacao ********** "
@echo
@echo
$(CC) $(GFLAG) $(CFLAGS1) $(EXEC).c -o $@
# @rm -f $(EXEC).lis
# @rm -f $(EXEC).lis $(EXEC).c
@echo
@echo " ****** PComp./ Comp. Completos ****** "
@echo
Dennis Handly
Acclaimed Contributor
Solution

Re: GDB

>This is the link line, correct?

Yes.

>strip $@

Ack! Comment this, it strips the debug info!
j0nas
New Member

Re: GDB

It worked... :)

Pro*c developing will become much easier.

Thank you so much for your attention...
You are the best.

Best regards
Joao Lopes

Dennis Handly
Acclaimed Contributor

Re: GDB

>It worked... :)

If you are happy with the answers you have gotten, please read the following about assigning points:
http://forums.itrc.hp.com/service/forums/helptips.do?#33