home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / linux / 16475 < prev    next >
Encoding:
Text File  |  1992-11-12  |  11.1 KB  |  278 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!munnari.oz.au!metro!extro.ucc.su.OZ.AU!davem
  3. From: davem@extro.ucc.su.OZ.AU (David Monro)
  4. Subject: ups (the X-based debugger)
  5. Message-ID: <davem.721579221@extro.ucc.su.OZ.AU>
  6. Sender: news@ucc.su.OZ.AU
  7. Nntp-Posting-Host: extro.ucc.su.oz.au
  8. Organization: Sydney University Computing Service, Sydney, NSW, Australia
  9. Date: Thu, 12 Nov 1992 14:40:21 GMT
  10. Lines: 266
  11.  
  12. Anybody thought of having a look at porting UPS? It is a you-beaut X-based
  13. debugger. I regularly use it on a MIPS system at uni and love it.
  14. 'Fraid the port is beyond me - not enough C or low level knowledge,
  15. and I'm not running X right now (No space :( ). Anyway, if someone has
  16. a lot of spare time looking for a project...
  17.  
  18. Here is a copy of the file ups-2.45.README on archie.au in X11/contrib:
  19.  
  20. This is a copy of the top level README file for the ups debugger.
  21. You should find a compressed tar file containing the current
  22. release (2.45) of ups in the file ups-2.45.tar.Z in this directory.
  23.  
  24.  
  25. WHAT IS UPS?
  26. ------------
  27.  
  28. Ups is a source level C debugger that runs under X11 or SunView.
  29. It runs in a window with two major regions: one showing the
  30. current state of the target program data and the other showing
  31. the currently executing source code.  A key feature of ups is
  32. that the variables display is persistent: when you add a variable
  33. to the display it stays there as you step through the code.  The
  34. current stack trace (which function called which) is always visible.
  35.  
  36. Ups includes a C interpreter which allows you to add fragments
  37. of code simply by editing them into the source window (the source
  38. file itself is not modified).  This lets you add debugging printf
  39. calls without recompiling, relinking (or even restarting) the
  40. target program.  You can also add conditional breakpoints in a
  41. natural way - you just add a statement like "if (i == 73) #stop"
  42. at the appropriate place in the source window.
  43.  
  44. Some things you can do with ups:
  45.  
  46.    + Add variables to the display by simply clicking on them
  47.      in the source window.
  48.  
  49.    + Expand (recursively) structures and unions to show their
  50.      members.
  51.     
  52.    + Assign to variables by editing the displayed value.
  53.  
  54.    + Add breakpoints by pointing with the mouse at the line
  55.      where you want execution to stop.
  56.     
  57.    + Add interpreted code at any breakpoint, including code that
  58.      calls compiled functions and assigns to variables.
  59.  
  60. It's hard to describe an interactive application in a few paragraphs of
  61. text - the best way to see what ups is like grab a copy and try it.
  62. There's a walkthrough debugging session in the manual page: if you work
  63. through this and aren't hooked at the end of it then I'll give you
  64. your money back :-)
  65.  
  66.  
  67. HOW UPS DIFFERS FROM XXGDB, XDBX AND DBXTOOL
  68. --------------------------------------------
  69.  
  70. The key implementation difference between ups and the various X front
  71. ends for dbx and gdb is that ups is not a front end for a command based
  72. debugger.  Xdbx and xgdb give you a convenient way to invoke the
  73. underlying debugger's commands, but it is fairly clear in both that
  74. you are talking to a text based debugger.  Ups in the other hand is
  75. a complete native debugger implementation; there is no underlying
  76. command language.
  77.  
  78. An example: to print the value of a variable in xgdb you select (by
  79. dragging) a variable name and then click on `print' in the menu.  Xgdb
  80. passes the print command with the selection to gdb and displays the
  81. result.  By contract in ups you click the mouse over a variable name
  82. and it is added to the display.  Once the variable is added to the
  83. display it stays there, so you can watch it change as you step through
  84. the code.  If the variable happens to be a structure or a pointer to a
  85. structure you can `expand' it to show its members.  Again, the
  86. structure members thus added remain in the display until you get rid of
  87. them so you can watch their values change as you execute the code.
  88.  
  89. Of course there is a downside to not talking to an existing debugger: you
  90. lose portability.  Ups is machine dependent - a port to a new architecture
  91. is a significant effort.  I think the benefits outweigh the cost.
  92.  
  93.  
  94. SUPPORTED CONFIGURATIONS
  95. ------------------------
  96.  
  97. The current list of supported configurations is:
  98.  
  99.     Architecture        OS version        Window system
  100.     ------------        ----------        -------------
  101.     SPARC            SunOS 4.X        X11 or SunView 1
  102.     Sun 3            SunOS 4.X        X11 or SunView 1
  103.     Sun 386i        SunOS 4.0.X        X11 or SunView 1
  104.     DECstation        Ultrix 3.X and 4.2    X11
  105.     Intel 386        BSDI BSD/386 0.3 Beta    X11
  106.     HLH Clipper        4.3BSD            X11
  107.  
  108. [ You've never heard of the HLH Clipper.  Don't worry, you're not alone. ]
  109.  
  110. Ups has also been ported to the Sony NEWS (MIPS) workstation (by Nobuyuki
  111. Hikichi) and to the MIPS Magnum 3000 (by Hal R. Brand and Conor Doherty).
  112. I have folded these changes into the code but I don't have access to the
  113. machines to test them directly.
  114.  
  115. Ups has FORTRAN support on the Sun 3 and SPARC but this is not as
  116. stable or complete as the C support.  Ups should also work with gcc (even
  117. with the -O flag).  This is known to work pretty well on the SPARC; your
  118. mileage may vary on other systems.  Unlike earlier releases, the current
  119. version of ups works with gcc 2.X (except on the DECstation).
  120.  
  121. Ups will probably work on OS releases other than these; the list above
  122. describes the OS versions on the machines that I have access too.  In
  123. particular I have built ups for a VAX 750 running 4.3BSD and X11 - it
  124. appeared to work OK but wasn't tested thoroughly or used in anger.
  125.  
  126. Ups is unavoidably architecture and OS dependent as it knows about things
  127. like the ptrace() system call interface and object file symbol table formats.
  128. A port to a new architecture is likely to take several weeks.
  129.  
  130.  
  131. INSTALLATION
  132. ------------
  133.  
  134. Ups should be reasonably simple to install.  It has no library files,
  135. just a binary and manual page.  You can put the binary and manual
  136. pages where you like.  There is no need to be root to do any part of
  137. the installation (although you must obviously have permission to
  138. create files in the directories where you put the binary and manual page).
  139.  
  140. The steps are:
  141.  
  142. 1)  Unpack the distribution. You should have a compressed tar file called
  143.     ups-2.XX.tar.Z (where 2.XX is the version number of the release).
  144.     Change directory to a disk with a three or more megabytes of free
  145.     space and say:
  146.  
  147.      zcat ups-2.XX.tar | tar xfp -
  148.  
  149.     This will create a directory tree called ups-2.XX.  Change directory
  150.     into it.
  151.  
  152. 2)  If you wish to use imake then say "sh imake.sh" at this point
  153.     and skip to step 4.  This will unpack Imakefiles from the file
  154.     imakefiles.tar and run xmkmf to build makefiles.  The Imakefiles
  155.     were written by Rainer Klute (klute@irb.informatik.uni-dortmund.de).
  156.  
  157.     If you are building the SunView version of ups, or do not have imake
  158.     or xmkmf then skip this step and use the supplied makefiles.
  159.  
  160. 3)  Optionally edit the Makefile in this root directory.  You might want
  161.     to do this if you want to specify special flags to to compiler (for
  162.     example if your X header files live somewhere other that /usr/include/X11).
  163.     You might also want to change the default locations of the installed
  164.     binary and manual page.
  165.  
  166. 3a) If you are building ups on a Sun (of any architecture) running
  167.     SunOS 4.0.3 or earlier, uncomment the line in the Makefile in this
  168.     directory that sets SUBMAKEFLAGS to ARCH_CFLAGS=-DFIX_SHORT_PARAMS.
  169.     See the comment in the Makefile for more information.
  170.  
  171. 3b) If you are using a MIPS RISC/os machine, uncomment the SUBMAKEFLAGS
  172.     line for RISC/os.  If you are running RISCwindows then uncomment
  173.     the X11LIB line just below the SUBMAKEFLAGS line.
  174.  
  175. 4)  Type "make".  If all goes well this should build you a binary called
  176.     ups/ups.  If you want the SunView binary, say "make sunviewups".
  177.     This will produce a binary called ups/sunviewups.
  178.  
  179.     The BSDI make and sh (at least on the Beta 0.3 release) have some
  180.     bugs which are triggered by the ups makefiles.  If you are not using
  181.     imake (which also failed for me on BSDI), you can use the following
  182.     evil runes to make ups build:
  183.  
  184.          make ups/develhdrs libx11wn
  185.      make SUBMAKEFLAGS="-n | sh -x"
  186.  
  187.     If you want you can experiment with ups at this point.  The manual
  188.     page (in ups/doc/ups.man) has a "GETTING STARTED" section which
  189.     should get you going.
  190.  
  191. 5)  Type "make install".  By default this will install ups/ups as
  192.     /usr/local/X11/ups and the manual page as /usr/man/manl/ups.l.
  193.     To install the Sunview version of ups say "make sunviewinstall".
  194.     By default this will install ups/sunviewups as /usr/local/Sunview/ups.
  195.  
  196.     If you don't wish to run "make install" you can install ups simply by
  197.     copying the binary and manual page into place.
  198.  
  199.  
  200. DOCUMENTATION
  201. -------------
  202.  
  203. The following files contain documentation on ups:
  204.  
  205.     ups/doc/ups.man     The user manual page
  206.  
  207.     ups/doc/porting.ms  A guide to porting ups to a new architecture.
  208.  
  209.     README.multiarch    Description of a scheme for doing simultaneous
  210.                 builds of ups in one NFS mounted source
  211.                 directory on multiple architectures.
  212.  
  213.     lib/*/README        Brief overviews of the various libraries
  214.                 used to build ups.  Some have pointers to
  215.                 more documentation.
  216.                 
  217.  
  218. COPYING THE CODE
  219. ----------------
  220.  
  221. Feel free to copy bits of ups for your own use (caveat: you must contact
  222. me first if you want to incorporate the code into a commercial product).
  223. You must preserve the copyright notices.
  224.  
  225. Things you might find useful (despite the lack of documentation):
  226.  
  227. ups/ci_*.[cy]    A reasonably complete ANSI C interpreter.  There are many
  228.         details that it gets wrong (e.g. the exact type of integer
  229.         constants and the subtler aspects of typedefs).  There is
  230.         a test driver in ups/cx.c.  The grammar is in ups/ci_parse.y.
  231.         This was derived from the grammar at the back of K&R2.
  232.  
  233. ups/as_*.c    Disassemblers for the 68020, SPARC, VAX and MIPS chips.
  234.  
  235. lib/libmtrprog/genmergesort.h
  236.         A macro to implement a merge sort function for any linked list.
  237.  
  238. lib/libukcprog/*.c
  239.         Various low level routines that aren't in the standard
  240.         C library.
  241.  
  242. lib/libarg/*.c    General purpose command line parsing, including filename
  243.         globbing and I/O redirection.
  244.  
  245. One day I might get round to documenting all this stuff ...
  246.  
  247.  
  248. FEEDBACK
  249. --------
  250.  
  251. I hope you find ups a useful tool.  If you have problems building
  252. or using it, find bugs or have suggestions for improvements please
  253. send me mail (I am mtr@ukc.ac.uk).  Paeans of praise describing how
  254. wonderful ups is are also appreciated :-)
  255.  
  256. There is a mailing list for discussion of ups and for announcements
  257. of bug fixes and new features.  The list is ups-users@ukc.ac.uk -
  258. send requests to be added to the list to ups-users-request@ukc.ac.uk.
  259.  
  260. I'm especially interested in ports to new architectures.  There is
  261. a document (ups/doc/porting.ms) giving an overview of the implementation
  262. of ups and how to port it.  I'll be happy to give advice and help
  263. to anyone doing a port, and even happier to incorporate completed
  264. ports back into the standard release.
  265.  
  266. A personal note: I have benefited enormously from free software
  267. that others have contributed (things like perl, gcc, X and BSD).
  268. Ups is my attempt to give something back.  Long live free software.
  269.  
  270. Mark Russell
  271. mtr@ukc.ac.uk
  272. -- 
  273. David Monro
  274. e-mail: davem@extro.ucc.su.OZ.AU
  275. -- 
  276. David Monro
  277. e-mail: davem@extro.ucc.su.OZ.AU
  278.