[comp.unix.misc] adb

23n@sage.cc.purdue.edu (03/11/91)

Subject: adb
Newsgroups: comp.unix.programmer
Distribution: usa
Keywords: how to

I am have been wondering about using adb.
I use dbx, mostly for debugging small mathematical models written in C, but I've
  heard about adb and I wonder what its good for.
I Read TFM and played around a little and the thing seems to be a bitch to use.
I do occasionally have to throw around a few pointers & dbx is okay for that, 
  too, but what's the deal with adb?
Are there any tutorials around about its use?
If it's not worth learning now, what would I want to pick it up for?
 
23n@sage.cc.purdue.edu

I am NOT a NUMBER!!

- the prisoner

gwoho@nntp-server.caltech.edu (g liu) (03/11/91)

23n@sage.cc.purdue.edu writes:

>Newsgroups: comp.unix.programmer
>Distribution: usa
>Keywords: how to

>I am have been wondering about using adb.
>I use dbx, mostly for debugging small mathematical models written in C, but I've
>I Read TFM and played around a little and the thing seems to be a bitch to use.
>I do occasionally have to throw around a few pointers & dbx is okay for that, 
>  too, but what's the deal with adb?
>Are there any tutorials around about its use?
>If it's not worth learning now, what would I want to pick it up for?
> 
>23n@sage.cc.purdue.edu

>I am NOT a NUMBER!!

>- the prisoner

i dont know about dbx, but i find adb to be a good debugger. the problem
with source debuggers for c is that they do not find bugs in the compiler
very well. i use adb to patch the kernel. i have an adb script+makefile
which i use to fix up problems in the kernel.
i think man adb gives an instruction manual.

gwoho liu.

guy@auspex.auspex.com (Guy Harris) (03/12/91)

>i dont know about dbx, but i find adb to be a good debugger. the problem
>with source debuggers for c is that they do not find bugs in the compiler
>very well.

I.e., "adb" is more of a pain to use in many circumstances, because it's
a more low-level debugger, but since many versions of "dbx" don't have
very good low-level facilities, there are times where "adb" is necessary.

bhoughto@pima.intel.com (Blair P. Houghton) (03/12/91)

In article <7606@mentor.cc.purdue.edu> 23n@sage.cc.purdue.edu writes:
>I am have been wondering about using adb.

You're right.  The man-page is good for reference only, and
it's too long for that (I distilled it, printed it, and
reduced it xerographically so it's four pages on one face
of an 8.5x11 sheet of xerobond, sort of like the two-volume
OED; it's a more fitting way to display that little data,
and it takes only one pin on my bulletin board).

If you have access to a set of Sun manuals (there's gotta
be a set _somewhere_ at Purdue), find them.  They include
the tutorial for the Sun version of adb(1), which is
different from other adb(1)'s (actually, Sun wrote a
different-capability-possessing version of adb(1) for the
Sun 386i's, too), but the differences are obvious.

If you have dbx(1), you can debug sufficiently.  Adb(1)
provides only a more raw interface that gives you more
access but less processing power, and almost no
interpretation (not even a prompt, for unrevealed
reasons).  It's great, though, if you know exactly what
you're looking for and don't need source code.

				--Blair
				  "0,-1?a2X4^i"

allbery@NCoast.ORG (Brandon S. Allbery KB8JRR) (03/15/91)

As quoted from <7606@mentor.cc.purdue.edu> by 23n@sage.cc.purdue.edu:
+---------------
| I am have been wondering about using adb.
| I Read TFM and played around a little and the thing seems to be a bitch to use.
| I do occasionally have to throw around a few pointers & dbx is okay for that, 
|   too, but what's the deal with adb?
+---------------

adb has been pretty much superseded by sdb/dbx/gdb/cv (SCO) for debugging, but
is still useful for patching binary files.  With two exceptions:

(1) It's still the Xenix ("OMF") format debugger.
(2) SCO UNIX (but, I hope, not other V.3.2's) adb insists that the file *must*
be OMF (Xenix x.out) format; it won't do arbitrary binary files.  (grrr)

It's also just about the only way you can hope to debug a program without a
symbol table, but you need to be familiar enough with assembly language to get
away with it.  Nevertheless, it is possible to debug and even patch symbol-
less binaries with adb.

++Brandon
-- 
Me: Brandon S. Allbery			    Ham: KB8JRR on 40m, 10m when time
Internet: allbery@NCoast.ORG		      permits; also 2m, 220, 440, 1200
America OnLine: KB8JRR // Delphi: ALLBERY   AMPR: kb8jrr.AmPR.ORG [44.70.4.88]
uunet!usenet.ins.cwru.edu!ncoast!allbery          KB8JRR @ WA8BXN.OH