⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.1st

📁 嵌入式系统基础课件
💻 1ST
📖 第 1 页 / 共 2 页
字号:
Development environment (aka IDE)
---------------------------------

Currently, DJGPP doesn't come with an integrated environment of its
own.  You are free to choose any editor that can launch DOS programs
and catch their output, to act as an IDE.  Many people who work with
DJGPP use a DOS port of GNU Emacs (it's available in the v2gnu
subdirectory) which can be compiled with DJGPP.  Emacs is a very
powerful editor (for example, it has a built-in Info reader, so you
can read DJGPP documentation without leaving the editor), but many
other free editors can serve as an IDE.  The only task that these
editors (including Emacs) cannot do is to run a debugger in a
full-screen session.

A DJGPP-specific IDE called RHIDE has recently been released and is
now available to all DJGPP users.  It features a Turbo C-style
interface, auto-indentation, color syntax highlighting, automatic
invocation of the DJGPP compiler, automatic Makefile generation, and
easy access to the DJGPP online documentation.  RHIDE also
incorporates integrated and/or standalone debugging using the same
functionality as the GNU Debugger (gdb).  Since RHIDE is brand new,
there are still revisions and bugfixes being made; visit
http://www.tu-chemnitz.de/~sho/rho/rhide.html for the latest
information and updates.



Debugging
---------

To debug a program, you must first compile its source files with the
`-g'switch:

	gcc -c -Wall -g mymain.c
	gcc -c -Wall -g mysub1.c
	gcc -c -Wall -g mysub2.c

and then link with `-g' as well:

	gcc -g -o myprog.exe mymain.o mysub1.o mysub2.o

(Note that beginning with v2.01 of DJGPP, it is no longer necessary to
compile to a raw COFF output by omitting the `.exe' from the filename
in order to debug programs.  The debuggers distributed with v2.01 and
later are capable of reading an executable as well as the raw COFF.
If you don't understand what this means, don't worry about it.)

Then run your program under the debugger:

	fsdb myprog.exe
or
	gdb myprog.exe
or
	edebug32 myprog.exe

(You will have to get gdb*b.zip if you want to debug with GDB.)
FSDB has a help screen; press F1 to read it.  GDB comes with Info
docs (see below) which can be read with info.exe.  Edebug32 is a
seldom-used alternative debugger; type 'h' to get help.



On-line docs
------------

Most of the on-line documentation is organized in a special hypertext
format used by the GNU project.  Each package comes with its own docs,
in files with the .iNN extension which are unzipped into the info/
subdirectory of your main DJGPP installation directory.  To browse
these docs, get and unzip the file txi*b.zip, then run info.exe.  If
you don't know how to use Info, read the next section.



Reading the documentation, or A Crash Course in Info
----------------------------------------------------

The following is not supposed to be a complete guide to using Info,
but just a starting point, so you could move around the docs and
search it efficiently for specific subjects.

To invoke Info to read a manual, type "info" followed by the manual
name.  For example:

  - type "info libc" to read the C library docs;
  - type "info libc alphabetical printf" to read the documentation
    of library function `printf';
  - type "info gcc" to read the manual for GCC, the GNU C compiler;
  - type "info faq" to read the DJGPP FAQ list;
  - type "info make" to read the manual for the Make utility;
  - type "info" to get a menu of all the manuals.

To exit Info, press `q' (for Quit).

Once inside Info, you can move around with the usual cursor motion
keys: Up-arrow, Down-arrow, PageDown, PageUp, etc.  

To read the entire manual in an orderly fashion, press SPACE every
time you've completed reading a screenful.  This will take you through
the entire sequence of chapters and sections of a manual.

Menus are marked by a line that says "* Menu:".  Each line below the
menu marker that begins with a "* " is a menu item.  To choose a menu
item, position the cursor at the beginning of a line, right under the
asterisk `*', and press [Enter].

Hypertext links are marked by "* Note".  To follow the reference,
position the cursor at the asterisk, then press [Enter].  To get back
from the excursion, press `l' (that's a lower-case letter ell, not the
digit one), for "Last".

To quickly search for a particular subject in the index of a manual,
press `i' (for Index), type the subject, then press [Enter].  You can
type only part of the subject name and press TAB, to see whether the
index includes any entries that begin with what you typed.  TAB causes
Info to try to complete what you typed using the available index
entries.  If Info beeps at you or flashes the screen colors when you
press TAB, it means that there are no index entries which begin with
what you typed; delete what you have typed (using the BackSpace key)
and try a different name for what you were looking for.  If there are
some index entries that begin with what you typed, Info will complete
it.  If the completed entry looks like what you are looking for, press
[Enter] to go to the section of the manual that discusses it; if not,
press TAB again to see all the possible completions.  If any of the
completions seem right, type enough text to make it unique and press
[Enter].  If none of the completions seem appropriate, delete what you
typed and try a different subject name.

For example, suppose you get the infamous message "ld.exe: cannot open
-lstdcxx: No such file or directory" and you want to check what the
FAQ has to say about that.  You start Info ("info faq"), then press
`i' and type "c a n TAB" (without the blanks).  The first TAB just
capitalizes "can" into "Can", so you know there are some index entries
which begin with "Can", and type TAB again.  Now you will see a list
of potential completions.  Alas, none of them seems to be relevant for
this problem, so you use BackSpace to delete "Can" and then type
"-lstd" followed by TAB.  Now Info has only one choice so it completes
your search and this time it's exactly what you are looking for!
Finally, press [Enter] to go to that node and read what the FAQ has to
say about this subject.

If you prefer to look up the subject in the index yourself, page
through the top-level menu of the manual until you find a menu entry
that says something like "* Concept Index" or "* Command Index" or
just "* Index", press [Enter] to go to the index, then browse it for
any pertinent entries.  An index is just a huge menu sorted in
alphabetical order, so find an entry you are looking for, position the
cursor at the beginning of its line, and press [Enter] to go to the
relevant section.

The library reference doesn't have an index, so search for functions
either in the alphabetical list or in the functional categories.  For
example, library function `mktime' is in the "Time Functions"
category, `random' is in the "Random Number Functions" category, etc.

Sometimes the index search won't help you (because the indices cannot
list everything).  In this case, press `s' (for Search), type the text
you want to find, and then press [Enter].  Info will search the entire
manual for this string and position you at the first occurrence.  To
search for the next occurrence, press `s' and [Enter] again: Info will
repeat the search.

Finally, if you don't know in what manual to look for some subject,
you can use the "--apropos" switch to cause Info to look for that
subject in the indices of every installed manual.  For example,
suppose you have heard that DJGPP programs support file-name
wildcards, but you don't know in which manual to look for their
description.  The following command will ask Info to print all the
sections in every manual whose indices mention the string "wildcard":

	info --apropos=wildcard

This will run for a while, and then print lines like these:

    "(kb)Features" -- Wildcards
    "(kb)Changes in 2.01" -- wildcards
    "(djgppfaq)Filename globbing" -- Filename wildcards expansion

The text inside the quotes is the name of the manual and the section
where the subject "wildcard" is discussed.  To invoke Info in order to
read the first entry above, type this:

	info --node="(kb)Features"

Info has many more commands and options.  To find out, from the
command line type "info info".  To find out even more, type
"info info-standalone".



Compatibility with V2.00
------------------------

If you are upgrading from version 2.00 of DJGPP, you should completely
reinstall all the packages you need to use.  Because of the different
methods used by versions 2.01 and later to handle long command lines
(and long filenames under Win95), mixing V2.00 programs with those
from later versions can cause very subtle and difficult to debug
problems.  See the FAQ section 16.6 for more information.



Compatibility with V1.x
-----------------------

Existing binaries compiled under DJGPP V1.x can be used for
applications for which there is no v2.x version.  V1 programs cannot
run V2 programs (but v2 programs *can* run v1 programs), so don't try,
say, using v1.x Make to run v2.x compiler.




--- COPYRIGHT ---

DJGPP V2 is Copyright (C) 1989-1999 by DJ Delorie.  Some parts of
libc.a are Copyright (C) Regents of the University of California at
Berkeley.

GNU software (gcc, make, libg++, etc) is Copyright by the Free
Software Foundation.

DJGPP V2's copyright allows it to be used to produce commercial
applications.  However, if you include code or libraries that are not
part of djgpp (like gnu's libg++) then you must comply with their
copyrights.  See Chapter 19 of the FAQ for more details.

There was a discussion a while ago on the DJGPP news group about the
copyright of some of libc's functions.  This copyright required that you
mentioned the "University of California, Berkeley" in your
distribution even if it only consisted of binaries, i.e. a compiled
program.  However, the Berkeley license has been changhed in July
1999, and you don't need to mention their copyright in your
distribution anymore.

The functions and files in libc that have the Berkeley copyright are
listed here:

from libc/ansi/time/ctime.c: asctime ctime gmtime localtime mktime
	tzset tzsetwall

from libc/compat/stdlib/random.c: initstate random setstate srandom

==============================================================================


Enjoy!


DJ Delorie
dj@delorie.com
http://www.delorie.com/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -