Subject: assembler and customization of gdb

From: Rainer Dorsch <[email-masked]>
Date: Mon, 04 Jan 1999 13:29:28 +0100

I have three questions (all somewhat offtopic, but I hope that there is 
somebody on the list using ARM CPUs in embedded system design):

Does anybody know, if the syntax of the GNUassembler for the ARM CPU is the 
same as of ARMs software development toolkit?

Does anybody know if gdb for the ARM code is extendable as armsd (symbolic 
debugger) is? Are there some examples, e.g. how to add a memory model or a 
coprocessor model?

Is there a better list for questions dealing with ARM CPUs and embedded 
systems?

Thank you.
-- 
Rainer Dorsch
Abt. Rechnerarchitektur  e-mail:[email-masked]
Uni Stuttgart            Tel.: 0711-7816-215

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: "Dr . David Alan Gilbert" <[email-masked]>
Date: Tue, 05 Jan 1999 09:17:52 +0000

>same as of ARMs software development toolkit?

It is not the same - the ARM syntax is somewhat odd as I remember.

>debugger) is? Are there some examples, e.g. how to add a memory model or a 

Hmm? 'armsd' is a monitor'/debugger often built with the ARMulator ARM
emulator
which does the emulation and has the memory models.  As I remember newer
versions
of GDB are also supplied with an ARM emulator which is actually an older
release
of the ARMulator used with ARMsd.  As I remember the version distributed
with gdb
is a bit buggy - but it is extendible (in the same way as the ARM version).

Dave

---

From: Alan Cox <[email-masked]>
Date: Tue, 5 Jan 1999 10:13:07 +0000 (GMT)

> debugger) is? Are there some examples, e.g. how to add a memory model or a 

You get source code to the entire thing. I can't think of anything more
you could possibly need. Also for kernel debugging work you can run gdb
over a serial port and single step a target from a remote gdb - very
useful inded

---

From: Philip Blundell <[email-masked]>
Date: Tue, 05 Jan 1999 13:32:09 +0100

>same as of ARMs software development toolkit?

It's similar but not 100% identical.  You should have no problem learning the 
GNU syntax, but don't expect old code that you wrote with the SDT to build 
unchanged.

>debugger) is? Are there some examples, e.g. how to add a memory model or a 

The GDB documentation might cover this; I can't remember.  I've never used 
armsd in anger so I don't know how extensible it actually is. :-)

>Is there a better list for questions dealing with ARM CPUs and embedded 

Not really.  You could try the comp.sys.arm newsgroup.

p.

---

From: Rainer Dorsch <[email-masked]>
Date: Tue, 05 Jan 1999 17:12:09 +0100

> It is not the same - the ARM syntax is somewhat odd as I remember.

Do you know if there is somewhere a reference card for the GNU syntax? Or 
could you just send me a small hello world program in GNU syntax?

> which does the emulation and has the memory models.  

Yes, that is right.

> As I remember newer

Is this documented somewhere? ARM distributes a "free of charge" version of 
SDT 2.02 for universities. I would be interested, if it is based on the same 
armulator as supplied with gdb.

---

From: "Dr. David Alan Gilbert" <[email-masked]>
Date: Tue, 05 Jan 1999 17:04:42 +0000

> could you just send me a small hello world program in GNU syntax?

I've never seen one - the easiest way I find is to compile something with
gcc -S and look at the assembler you get!

> > As I remember newer  versions

Some time ago ARM released an old version of their ARMulator under GPL - it is
that which is included with GDB.  The memory model interfaces were pretty much
identical
to the commercial versions until recently when they improved the commercial
models
a bit.

Dave

-- 
/------------------------------------------------------------------\
| Dr. David Alan Gilbert | Work: [email-masked] (+44-161-286-2000)   |
| -------- G7FHJ --------|---------------------------------------- |
| Home: [email-masked]   http://www.treblig.demon.co.uk          |
\------------------------------------------------------------------/
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Alex Holden <[email-masked]>
Date: Wed, 6 Jan 1999 09:58:05 +0000 (GMT)

> over a serial port and single step a target from a remote gdb - very

I've heard that before, but how do you actually do it?

--------------- Linux- the choice of a GNU generation. --------------
: Alex Holden (M1CJD)- Caver, Programmer, Land Rover nut, Radio Ham :

---

From: [email-masked] (David Smythe)
Date: Thu, 7 Jan 1999 09:42:26 -0600 (CST)

Alex Holden wrote
> I've heard that before, but how do you actually do it?

The GDB info pages are fairly detailed in this respect.  I've
not done it on Linux, but have on other UNIX kernels.  What it
amounts to is:

- Cause the kernel to jump to the gdb remote stub at some point
  (either by recompiling it or with a boot-line parameter, depending
   on what your kernel supports)
- Start (a compatible) gdb running on a machine connected to the
  machine you want to debug (via a serial port).  Lets presume
  that the maching running gdb uses /dev/tty01 to talk to the
  machine you want to debug.
  (we used to have to use the "-k" parameter to gdb, as well, to
   debug the kernel)
- At the gdb prompt, you use the "target" command to select a
  protocol and destination to debug.  The simplest protocol,
  which works over the serial port, is "remote".  So, you would
  type "target remote /dev/tty01" to attach gdb to the other
  machine's kernel.

At that point you should be able to step through and debug things.
You will need access to a kernel with symbols and all necessary
sources on the machine running the debugger.  You may need the
"file" command to get your symbol-laden kernel loaded.

D

-- 
===============================================================================
[email-masked] http://www-cs-students.stanford.edu/~dsmythe/home.html
(612) 979-1249       "Have you lived here all your life?"  "Not yet..."
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Philip Blundell <[email-masked]>
Date: Fri, 08 Jan 1999 20:12:40 +0100

>   on what your kernel supports)

I think that's the current stumbling block.  Nobody has yet contributed a gdb 
stub for the Linux kernel on ARM to my knowledge.  There's been interest in 
the past; I don't know if anybody is working on it at the moment.

p.