Doc updates

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18485 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2004-01-26 04:42:28 +00:00
parent 6306bb3bf0
commit 5366bd558e
7 changed files with 264 additions and 9 deletions

View file

@ -1,3 +1,13 @@
2004-01-25 Adam Fedor <fedor@gnu.org>
* base.make.in: Move LIBXML variable outside gnu-foundation check.
* Documentation/GNUmakefile (SUBPROJECTS): Add General
* Documentation/General/GNUmakefile: New file.
* Documentation/General/Degbugging.gsdoc: Moved to here.
* Documentation/General/OpenStepCompliance.gsdoc: Idem.
* Source/DocMakefile: Remove OpenStepCompliance.gsdoc
2004-01-25 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSPropertyList.m: Fix bug in encoding integers as xml.

View file

@ -32,7 +32,7 @@ include ../config.mak
# The documents to be generated
DOCUMENT_NAME = coding-standards
SUBPROJECTS = manual
SUBPROJECTS = manual General
# The text documents to be generated
DOCUMENT_TEXT_NAME = \

View file

@ -0,0 +1,184 @@
<?xml version="1.0"?>
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 1.0.0//EN" "http://www.gnustep.org/gsdoc-1_0_0.xml">
<gsdoc base="Debugging" up="Tools">
<head>
<title>Debugging with GDB</title>
<author name="Adam Fedor"></author>
</head>
<body>
<chapter>
<heading>Debugging</heading>
<p>
GDB is the GNU debugger and is the main method used for debugging
Objective-C programs. Full support for debugging Objective-C with
GDB was added in version 6.0. This document will describe the
various features of GDB that help with debugging Objective-C programs.
However, GDB is a very complex program, and not everything that it
can do will be described here.
</p>
<section>
<heading>Basic GDB usage</heading>
<p>
To start the debugger, specify the program you want to debug:
</p>
<example>
gdb myprogram
</example>
<p>
With GNUstep you can also use the debugtool and debugapp scripts
to begin a debugging session:
</p>
<example>
debugapp MyApp.app
</example>
<p>
Following is a short list of important commands that gdb accepts.
After this list, a more detailed explaination of each command is
given.
</p>
<list>
<item>run <var>args</var> - Run the program</item>
<item>break <var>func/method</var> - Stop at a function or method</item>
<item>print <var>var/func</var> - Print value of a variable/function</item>
<item>backtrace - List the fuction stack</item>
<item>frame <var>value</var> - Move up and down the fuction stack</item>
<item>help - Get help on gdb commands</item>
<item>quit - Quit the program</item>
</list>
</section>
<section>
<heading>The <em>run</em> command</heading>
<p>
This command starts the program inside the debugger. You can optionally
add arguments to the run command and these arguments will get passed
directly to the program as normal command-line arguments. For instance,
you might want to start an application and open a file:
</p>
<example>
run -NSOpen=afile.txt
</example>
</section>
<section>
<heading>The <em>break</em> command</heading>
<p>
This command instructs the debugger to stop when it reaches a
certain location in the program. The syntax for break can be very
complex. However we will only cover some simple examples. One instance
is to break on a particular line number.
</p>
<example>
break afile.m:345
</example>
<p>
will stop the debugger at line 345 in the file <file>afile.m</file>.
</p>
<example>
break a_function
</example>
<p>
will tell the debugger to stop at the beggining of the
<code>a_function</code> function. Finally, and most importantly
for Objective-C programs, you can enter a fully-qualified or
partially-qualified method name to stop at.
A fully qualified Objective-C method name is specified as
</p>
<example>
-[Class methodName]
</example>
<p>
where the minus sign is used to indicate an instance method and
a plus sign (not shown) is used to indicate a class method. The
class name <var>Class</var> and method name <var>methodName</var> are
enclosed in brackets, similar to the way messages are specified
in Objective-C source code. For example, to set a breakpoint at
the <code>create</code> instance method of class <code>Fruit</code>
in the program currently being debugged, enter:
</p>
<example>
break -[Fruit create]
</example>
<p>
One can also specify just a method name:
</p>
<example>
break initWithValue:
</example>
<p>
gdb will automatically determine what class this method belongs to. If
there is more than one class that implements this method, you will
be presented with a list of classes that implement the method from which
you must chose one.
</p>
</section>
<section>
<heading>The <em>print</em> command</heading>
<p>
The print command can be used to display a wide variety of information
that gdb knows about the program. As with the <var>break</var> command,
the variety of things you can do is very large, but we will discuss only
a few of the things that can be done. Below are several simple examples
of printing the value of a variable.
</p>
<example>
print aVariable
print anIvar
print self->anIvar
print anArray[4]
print aStruct.subvalue
print *(int *)pointerValue
</example>
<p>
Note that you can specify variables in the same way you specify them
in source code, using array subscripts, pointer dereferences, etc.
You can also set the value of a variable using print:
</p>
<example>
print aVariable = 4
</example>
<p>
One can also print the value of a function. Here gdb will actually
call the function you specify and return the output:
</p>
<example>
print my_function(4, "hithere")
</example>
<p>
When debugging Objective-C programs, the same thing can be done
with methods.
</p>
<example>
print -[object hash]
</example>
<p>
A special command has been added to gdb to print the
<var>description</var> of an object (based on the method of the
same name). This is the <var>print-object</var> (or <var>po</var>)
command:
</p>
<example>
po anObject
</example>
<p>
Which is the same as typing
</p>
<example>
print -[myObject desciption]
</example>
</section>
<section>
<heading>Other command</heading>
<p>
The <var>clear</var>, <var>info line</var>, <var>jump</var>,
and <var>list</var> commands also accept Objective-C method
syntax for specifying locations.
</p>
</section>
</chapter>
</body>
</gsdoc>

View file

@ -0,0 +1,67 @@
#
# Makefile for GNUstep Base Library documentation.
#
# Copyright (C) 2002 Free Software Foundation, Inc.
#
# Written by: Richard Frith-Macdonald <rfm.gnu.org>
#
# This file is part of the GNUstep Base Library.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
#
# Install into the system root by default
GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT)
include $(GNUSTEP_MAKEFILES)/common.make
DOCUMENT_NAME = BaseGeneral
BaseGeneral_DOC_INSTALL_DIR = Developer
BaseGeneral_AGSDOC_FILES = \
Debugging.gsdoc \
OpenStepCompliance.gsdoc \
#
# Hack ... using the -DocumentationDirectory flag overrides the value
# used by the make package, and puts our output in the documentation
# directory.
#
#BaseGeneral_AGSDOC_FLAGS = -DocumentationDirectory .
# Use local version of autogsdoc in case it is not installed
AUTOGSDOC=../../Tools/obj/autogsdoc
include $(GNUSTEP_MAKEFILES)/documentation.make
#
# Ensure that our destination subdirectory exists in the Documentation
# directory, and temporarily copy the base source file here for autogsdoc
# to use.
#
#before-all::
#
# Clean up temporary files used while generating documentation.
#
after-clean::
if [ -d BaseGeneral ]; then \
$(RM) BaseGeneral/stamp; \
$(RM) BaseGeneral/dependencies; \
rmdir BaseGeneral; \
fi

View file

@ -33,7 +33,6 @@ BaseAdditions_DOC_INSTALL_DIR = Developer
Base_AGSDOC_FILES = \
../Documentation/Base.gsdoc \
../Documentation/OpenStepCompliance.gsdoc \
NSArchiver.h \
NSArray.h \
NSAttributedString.h \
@ -172,7 +171,6 @@ include $(GNUSTEP_MAKEFILES)/documentation.make
#
before-all:: ../Documentation/Base \
../Documentation/Base/Functions.gsdoc \
../Documentation/Base/OpenStepCompliance.gsdoc \
../Documentation/Base/TypesAndConstants.gsdoc \
../Documentation/BaseAdditions \
../Documentation/BaseAdditions/Functions.gsdoc \
@ -186,10 +184,6 @@ before-all:: ../Documentation/Base \
../Documentation/Base/Functions.gsdoc: ../Documentation/Functions.gsdoc
cp ../Documentation/Functions.gsdoc ../Documentation/Base
../Documentation/Base/OpenStepCompliance.gsdoc: \
../Documentation/OpenStepCompliance.gsdoc
cp ../Documentation/OpenStepCompliance.gsdoc ../Documentation/Base
../Documentation/Base/TypesAndConstants.gsdoc: \
../Documentation/TypesAndConstants.gsdoc
cp ../Documentation/TypesAndConstants.gsdoc ../Documentation/Base

View file

@ -37,8 +37,6 @@ ifeq ($(FOUNDATION_LIB),gnu)
GNUSTEP_BASE_MINOR_VERSION = @MINOR_VERSION@
GNUSTEP_BASE_SUBMINOR_VERSION = @SUBMINOR_VERSION@
GNUSTEP_BASE_HAVE_LIBXML=@HAVE_LIBXML@
FND_LDFLAGS =
FND_LIBS = -lgnustep-base
FND_DEFINE = -DGNUSTEP_BASE_LIBRARY=1
@ -50,4 +48,6 @@ ifeq ($(FOUNDATION_LIB),gnu)
endif
endif
GNUSTEP_BASE_HAVE_LIBXML=@HAVE_LIBXML@
endif # BASE_MAKE_LOADED