473,568 Members | 2,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Makefile need debug option

Hi gurus,

Can someone quickly remind me how I can add a -g (to generate the
debug table inside the core file) so I can run it against GDB and find
out whats happening. I tried to put it in the right after the $(CC)
as in $(CC) -g .... But it didn't work. The core file shows no
stack in GDB
By the way, I am compiling on a Linux box. This is a makefile from a
piece of code that i need to maintain. TIA


=============== =========== THE MAKEFILE FOLLOWS =============== =====

I=$(CUST)/src/include
MAKEINCDIR=$(I)/Makefiles
DIRNAME=SendFti r
CATALOG=SendFti r_text.t
CDEBUGFLAGS=-g

include $(MAKEINCDIR)/$(shell uname)/vets.variables
include $(MAKEINCDIR)/$(shell uname)/ANSI.compiler
include $(MAKEINCDIR)/vets.rules
include $(MAKEINCDIR)/NLS.rules
all: catalogs progs

LIBS=\
$(LIB)/libvets.a \
$(LIB)/libphrases.a \
$(LIB)/libftir.a \
$(LIB)/libio.a \
$(LIB)/libinifile.a \
$(LIB)/libstr.a \
$(LIB)/libXXX.a

SYSLIB= $(SYSNLSLIB)

# --------------------------------------------------------------------
# CATALOGS
#
include $(MAKEINCDIR)/catalogs.progs

# --------------------------------------------------------------------
# PROGS
#
..PHONY progs: SendFtir

SENDFTIR=\
$(OBJDIR)GetDat a.o \
$(OBJDIR)PrintD ata.o \
$(OBJDIR)SendFt ir.o

SendFtir: $(BIN)/SendFtir6k
$(BIN)/SendFtir6k: $(SENDFTIR) $(LIBS)
$(CC) $(LDFLAGS) -o $(@F) $(SENDFTIR) $(LIBS) $(SYSLIB)
$(INSTALL)
$(CLEANUP)

# --------------------------------------------------------------------
include $(MAKEINCDIR)/clean.rules

#
# Include file dependencies
#
include $(addprefix depends/,$(SENDFTIR:.o= .d))
include $(addprefix depends/,$(CATALOG:.t=. d))

Oct 9 '07 #1
4 2028
Joseph <sp****@canada. comwrites:
Can someone quickly remind me how I can add a -g (to generate the
debug table inside the core file) so I can run it against GDB and find
out whats happening. I tried to put it in the right after the $(CC)
as in $(CC) -g .... But it didn't work. The core file shows no
stack in GDB
By the way, I am compiling on a Linux box. This is a makefile from a
piece of code that i need to maintain. TIA
[snip]

This isn't a C question. comp.unix.progr ammer is probably your best
bet, or possibly one of the Linux groups.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Oct 9 '07 #2
In article <ln************ @nuthaus.mib.or g>,
Keith Thompson <ks***@mib.orgw rote:
>Joseph <sp****@canada. comwrites:
>Can someone quickly remind me how I can add a -g (to generate the
debug table inside the core file) so I can run it against GDB and find
out whats happening. I tried to put it in the right after the $(CC)
as in $(CC) -g .... But it didn't work. The core file shows no
stack in GDB
By the way, I am compiling on a Linux box. This is a makefile from a
piece of code that i need to maintain. TIA
[snip]

This isn't a C question. comp.unix.progr ammer is probably your best
bet, or possibly one of the Linux groups.
IOW:

Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

--
Useful clc-related links:

http://en.wikipedia.org/wiki/Aspergers
http://en.wikipedia.org/wiki/Clique
http://en.wikipedia.org/wiki/C_programming_language

Oct 9 '07 #3
In article <11************ **********@19g2 000hsx.googlegr oups.com>,
Joseph <sp****@canada. comwrote:
>Can someone quickly remind me how I can add a -g (to generate the
debug table inside the core file) so I can run it against GDB and find
out whats happening.
Try setting CFLAGS to -g in your makefile.
>I tried to put it in the right after the $(CC)
as in $(CC) -g
That should work.
>The core file shows no stack in GDB
Do you really mean it shows no stack? Or just that it doesn't show
the names of functions on the stack? If there's no stack, it probably
means that the bug has completely screwed up the stack pointer.

-- Richard
--
"Considerat ion shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Oct 9 '07 #4
On Oct 10, 3:49 am, Joseph <spm...@canada. comwrote:
Hi gurus,

Can someone quickly remind me how I can add a -g (to generate the
debug table inside the core file) so I can run it against GDB and find
out whats happening. I tried to put it in the right after the $(CC)
as in $(CC) -g .... But it didn't work. The core file shows no
stack in GDB
By the way, I am compiling on a Linux box. This is a makefile from a
piece of code that i need to maintain. TIA

=============== =========== THE MAKEFILE FOLLOWS =============== =====

I=$(CUST)/src/include
MAKEINCDIR=$(I)/Makefiles
DIRNAME=SendFti r
CATALOG=SendFti r_text.t
CDEBUGFLAGS=-g

include $(MAKEINCDIR)/$(shell uname)/vets.variables
include $(MAKEINCDIR)/$(shell uname)/ANSI.compiler
include $(MAKEINCDIR)/vets.rules
include $(MAKEINCDIR)/NLS.rules

all: catalogs progs

LIBS=\
$(LIB)/libvets.a \
$(LIB)/libphrases.a \
$(LIB)/libftir.a \
$(LIB)/libio.a \
$(LIB)/libinifile.a \
$(LIB)/libstr.a \
$(LIB)/libXXX.a

SYSLIB= $(SYSNLSLIB)

# --------------------------------------------------------------------
# CATALOGS
#
include $(MAKEINCDIR)/catalogs.progs

# --------------------------------------------------------------------
# PROGS
#
.PHONY progs: SendFtir

SENDFTIR=\
$(OBJDIR)GetDat a.o \
$(OBJDIR)PrintD ata.o \
$(OBJDIR)SendFt ir.o

SendFtir: $(BIN)/SendFtir6k
$(BIN)/SendFtir6k: $(SENDFTIR) $(LIBS)
$(CC) $(LDFLAGS) -o $(@F) $(SENDFTIR) $(LIBS) $(SYSLIB)
$(INSTALL)
$(CLEANUP)

# --------------------------------------------------------------------
include $(MAKEINCDIR)/clean.rules

#
# Include file dependencies
#

include $(addprefix depends/,$(SENDFTIR:.o= .d))
include $(addprefix depends/,$(CATALOG:.t=. d))

Try:
CFLAGS = $(CDEBUGFLAGS)
CDEBUGFLAGS = -g

I think, you have not linked the CFLAGS with CDEBUGFLAGS. Did you
cross-check that .
Else, try directly the CFLAGS = -g in the makefile.

The -g option should make it work .

Karthik Balaguru

Oct 11 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
631
by: Dave | last post by:
Does anyone know of a Windows compatible command line tool that capable of parsing Microsoft's VC++ workspace/project (e.g., .dsw, .dsp, .sln, ..vcproj, etc.) files and generating an nmake-compatible Makefile. I don't like or use the IDE but many authors distribute their source code with project files but no makefile. Thanks. Dave
1
1716
by: Lord2702 | last post by:
Fri. Aug. 06, 2003 10:30 PM PT In VC 6.0 you can create/ generate MakeFile of your project, but it seems this option is not there in VSIDE .NET 2003. Anybody know how to create the makefile of your project or solution ? I am not talking about the MakeFile Project. But, if it is possible with this option, still it is OK to me. Thanks,
2
1543
by: Anonymous | last post by:
Is it possible to generate some kind of makefile from vb? (with VS2003's native tools) Or is the only option to use .sln-files?
5
9864
by: pinkfloydhomer | last post by:
I have a Makefile target that uses a python script, like: %.abc: %.def python myscript.py The problem is that myscript.py and some modules that myscript.py imports are not in the current directory, but in another place in the filesystem, say, /path/to/stuff. If this was a tcsh script, I would just do:
1
2050
by: %NAME% | last post by:
I wish to put a number of .db2 scripts in my makefile. However, some of the db2 scripts tries to revoke privileges from users that might do not have that privilege already, thus returns an error to the shell. I do not want the makefile to stop there, but simply ignore the errors. For example, I have the following in my makefile run:
4
3947
by: Jess | last post by:
Hello, I am now trying to use makefile to compile C++ programs. My makefile looks like: f1.o : f1.cpp h1.h h2.h g++ -c f1.cpp f2.o : f2.cpp h2.h h3.h g++ -c f2.cpp
6
3659
by: ahlongxp | last post by:
socket.makefile() may lose data when "connection reset by peer". and socket.recv() will never lose the data. change the "1" to "0" in the client code to see the difference. confirmed on both windows and linux. so I guess there is a problem with makefile(). # Echo server program
2
5910
by: Mant | last post by:
Hi, I have a borland C++ makefile for a project created in Borland C++ which I wanted to translate into microsoft visual studio compatible makefile, so that I can build-Compile-debug the whole project in Visual Studio editor. The obvious reason for this translation is that, I am not able to debug the whole project for some run-time errors. ...
14
1754
by: Anna Smidt | last post by:
After having programmed since 8 years only VB6 I want to learn C++.NET now. It's amazing that everything has to be prepared first. For example I want to build the DirectShow baseclass, but the only files I found in the PSDK\Samples\Multimedia\DirectShow\BaseClasses are ..cpp ..h makefile I would like to ask how I should compile them...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7916
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8117
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6275
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5498
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.