The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: jnc@mercury.lcs.mit.edu (Noel Chiappa)
Subject: [TUHS] v6 debugging
Date: Sat, 23 Jan 2016 12:18:51 -0500 (EST)	[thread overview]
Message-ID: <20160123171851.F423518C0D3@mercury.lcs.mit.edu> (raw)

    > From: Will Senn

    > How did folks debug assembly routines in Unix v6, back in the day?

There are three different questions here, although you may not realize it:

 - How did folks debug assembly routines in user programs in Unix v6
 - How did folks debug assembly routines in the kernel in Unix v6
 - How did folks debug assembly routines in PDP-11 standalone code created
   with Unix v6

I did all three, and I used different methods for each.

For user code, there was no source-level debugger, so debugging C programs
and debugging code written in assembler were the same thing. I used 'adb'
(which is, stricly speaking, slightly post-V6 - our system at MIT was
actually sort of an early PWB clone), but V6 itself provides 'db' (and also,
IIRC, 'cdb'); all three are very similar.

For standalone code (in my case, a packet switch that ran on PDP-11's), I
used a version of DDT that was linked in with the rest of the code. The
original version was one in MACRO-11 which I inherited from Jim Mathis at
SRI, but I eventually re-wrote it in portable C, and it was used on the 68K,
uVax and 29K.

For kernel assembler code... I can't remember what I did! Although I wrote a
fair amount of it (I modified m45.s very extensively, to work with the Able
ENABLE card), so I must have done _something_, but I have no idea what. In
theory I could have linked DDT in with the kernel, but I don't think I ever
did so?

Recently I was debugging some kernel code (the splice() system call we were
discussing here), and I debugged it using... printf()'s! It was written in C,
but I don't really differentiate between debugging C code, and assembler.


    > 2. No map file created by ld.

LD normally includes a symbol table in the output file, which 'nm' can dump.

    > 3. No debugger that I can find.

See above.

    > My workarounds include using OD to view the generated machine code

Use db/cdb/adb if you want to look at compiled code. Also, for 'cc', use the
-S flag.

	Noel


             reply	other threads:[~2016-01-23 17:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-23 17:18 Noel Chiappa [this message]
2016-01-23 17:38 ` Will Senn
  -- strict thread matches above, loose matches on Subject: below --
2016-01-25 15:12 Noel Chiappa
2016-01-25 15:26 ` Clem Cole
2016-01-25 15:12 Noel Chiappa
2016-01-23 18:03 Noel Chiappa
2016-01-23 18:42 ` Will Senn
2016-01-23 16:58 Will Senn
2016-01-23 17:25 ` Brantley Coile
2016-01-23 17:30 ` Clem Cole
2016-01-23 17:39   ` Clem Cole

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160123171851.F423518C0D3@mercury.lcs.mit.edu \
    --to=jnc@mercury.lcs.mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).