Results 1 to 20 of 20

Thread: MacsBug documentation......

  1. #1
    Join Date
    Sep 2000
    Location
    Peoples Republic of Lawrence, KS, US
    Posts
    1,370

    Default

    Hi guys. This seemed like a better place to continue this discussion.....

    Mag, as you said, MacsBug would be a better way to interrupt apparent software hangs than using the programmer restart. Thanks for your tip on Interarchy. It is slick, for sure.

    Louie, I got v6.6.3 installed in my System folder, and now get the "debugger installed" message on startup.

    But, I've looked on the Apple website, and there doesn't appear to be ANY documentation on how to use it, I get 0 hits doing a search, and couldn't find it in the Developers section. Although, Apple has a knack for putting things in places on their site that require pre-knowledge of exact URL addressing. I couldn't find any real documentation on gurus ftp either.

    Can you or Mag give me some guidance?

    Best,

    Dave

  2. #2
    Join Date
    May 2000
    Location
    Cordova, TN
    Posts
    2,428

    Default

    I'll check. They probably hid it.

  3. #3
    Join Date
    Sep 2000
    Location
    Peoples Republic of Lawrence, KS, US
    Posts
    1,370

    Default

    p.s. Thanks for the file Louie.

    Found the documentation Louie, its here:
    http://developer.apple.com/tools/debuggers/MacsBug/

    Damn, it's also a primer for assembly language, and OS archtecture and operation!!

    D

    [This message has been edited by crazyeights (edited 10 February 2001).]

    [This message has been edited by crazyeights (edited 10 February 2001).]

  4. #4
    Join Date
    May 2000
    Location
    Cordova, TN
    Posts
    2,428

    Default

    That's it! I knew it was there someplace. Study it and give us a 100 word summation next Wednesday.

  5. #5
    Join Date
    Sep 2000
    Location
    Peoples Republic of Lawrence, KS, US
    Posts
    1,370

    Default

    I may have to do that Louie. It's not exactly clear when, where or if it will get around to basic instructions. Maybe you can tell me.....

    With Macsbug installed, does that mean I can hit programmer interrupt, and it will kick me into Macsbug command line?

    c8

  6. #6
    Join Date
    Apr 2000
    Posts
    693

    Default

    I can't remember what happens if you hit the button (my 9500 doesn't have programmer's interrupt or reset switches). If you don't have MacsBug, the Mac throws up the built in low-level debugger, with that white box.

    However, the normal way to enter MacsBug if you have it installed is to hit command-power key on your keyboard, and if you are doing it during normal operation (i.e. not while crashed) you can get back out by typing 'g' for Go To Finder. The only other commands that I find useful are 'es' for Escape Current App and 'rs' for Restart.

    Using these commands, sometimes repeatedly, can get you out of about 60% of crashed apps, or at the very least, let you restart without just killing power, slightly better for the system's internal filing. IE, the PPP control panel, Netscape, and most games are, in my experience, able to be jettisoned by MacsBug.

    With some effort, and some documentation, you can actually use MacsBug to do more than that. You can check condition of system variables, addresses in RAM, and all kinds of weird stuff. It is incredibly powerful, but most people never use it. It also has the strangest screen-scramble algorithm I've ever seen. You'll see what I mean when you test it.

    [This message has been edited by mactheripper (edited 10 February 2001).]

  7. #7
    Join Date
    May 2000
    Location
    Cordova, TN
    Posts
    2,428

    Default

    Dookie already told you more than I know. Second Lieutenants are good for something.

  8. #8
    Join Date
    Sep 2000
    Location
    Peoples Republic of Lawrence, KS, US
    Posts
    1,370

    Default

    MTR, thanks man!!! Yeah, it works like a charm, and, it turns out the debugger screen is on my smaller "pallette" monitor. Perfect!!

    Thanks to you too Louie.

    I would expect using this will be much kinder to my OS resources.

    UPDATE: Oh Yeah!!! This is nice. Another question. If you use ES to escape from a running application, is there any penalty to stability like there is with an "Unexpectedly quit" error. Does it leave System heap and memory with artifacts requiring restart, or does it clear heap and pointers?

    Thanks again guys!!!

    c8

    [This message has been edited by crazyeights (edited 10 February 2001).]

  9. #9
    Join Date
    May 2000
    Location
    Cordova, TN
    Posts
    2,428

    Default

    I would suspect you will be much cleaner useing ES.

  10. #10
    Join Date
    Sep 2000
    Location
    Peoples Republic of Lawrence, KS, US
    Posts
    1,370

    Default

    Yeah, that would make sense. But man, when you issue that command, whatever app is gone like NOW!

    That reminds me of my exw..........oh yeah, Mag doesn't like us to talk about that...........


  11. #11
    Join Date
    May 2000
    Location
    wherever I hang my hat
    Posts
    3,575

    Default

    hush, now.

    only use ES if you need to bail out and can't, using command-q or the menus. In other words, don't think you can kill an app in MacsBug and continue working for 50-days more without a restart. It's risky.

    while it is cleaner to ES out than force-quit out, it ain't by much. Either is best considered an opportunity to execute a restart.

    and guys, there is a separate directory on the FTP site labelled "macsbug_references." The contents may or may not be useful.



    you can also just type "help" and hit return in MacsBug itself. Extra points if you can also figure out how to print it.


  12. #12
    Join Date
    Sep 2000
    Location
    Peoples Republic of Lawrence, KS, US
    Posts
    1,370

    Default

    Well......all right then....................

    ah.....we knew that Mag, we just wanted to see if you were on the ball.....right guys?


  13. #13
    Join Date
    May 2000
    Location
    wherever I hang my hat
    Posts
    3,575

    Default

    I bet dookie knows how to print the help screens from within MacsBug.


  14. #14
    Join Date
    Sep 2000
    Location
    Peoples Republic of Lawrence, KS, US
    Posts
    1,370

    Default

    I wouldn't know what to do with em after I printed em. I guess I could send em to Mag, and he could do a collage on the wall of Heaven with them.

    If I documented bugs would that get me in to being privy to those groovy comp copies of OS's and Apps software........aka "a developer"?

  15. #15
    Join Date
    Apr 2000
    Posts
    693

    Default

    Oh, yeah. I just remembered another little tidbit, and one that would mean you don't have to invoke the feared "stdlog" command.

    There is an app that puts MacsBug in a window in the Finder, one that you can move around and have a menu bar with. It's called MacsBugWin, or MBWindow, or something weird like that. My friend showed it to me on his G4. That would probably simplify the process of learning MB.

  16. #16
    Join Date
    Sep 2000
    Location
    Peoples Republic of Lawrence, KS, US
    Posts
    1,370

    Default

    Righteous!! I'll see if I can track it down.

    Thanks Mac!!

    c8

  17. #17
    Join Date
    Jun 2000
    Posts
    769

    Default

    Its just called MacsBugApp. It is the Application version of MacsBug that comes with the download when you get MacsBug from the Apple ftp site.

  18. #18
    Join Date
    May 2000
    Location
    wherever I hang my hat
    Posts
    3,575

    Default

    dookie....

    sigh.


  19. #19
    Join Date
    Sep 2000
    Posts
    53

    Default

    Jumping into this late, it's worth adding that probably the best macsbug book ever written is "Debugging Macintosh Software with Macsbug" buy Othmer and Strauss, circa 1991. I assumed it was out of print, but amazon says it's still available (and "includes version 6.2 on floppy disk!").

    That book is a gold mine of interesting and useful facts, even if you never actually use it to debug anything. For example, who hasn't crashed right in the middle of posting a mesage like this one. What a drag to retype it. Well, macsbug can search RAM and usually find the text. If the system isn't totally hosed, you can usually log taht memory off to a file, then restart.

    Other good books are "How To Write Macintosh Software" 1st ed by Knaster (out of print, it has little to say about -writing- software and should have been called "Why Software Crashes." Parts are way out of date but still a worthwhile book if you can find one. The 2nd ed. is more about writing software and much less about why it breaks.)

    Apple's "Macsbug Reference and Debugging Guide", also from 1991, is terse and neither as entertaining or useful that the Othmer/Straus book. But it is free from Apple's site.

    Current versions macsbug do lots more than is in any of these books. It's own built in help (type ? for a list of topics) is the best reference. These days the mouse even works when stopped inside it. Amazing...

    BTW, someone mentioned using ES to kill off a crashed app. That works in 68K, but not very well in PPC code. If it was 68K, typing
    es
    will do the job (es = exit to shell).

    But if PPC code was executing, using es will just crash back into macsbug again. So first type

    gp

    and *then* issue ExitToShell.

    Anybody can tell what kind of code is executing. Look at the register display at the left of the macsbug display. If there's a long unbroken list of items (they are the pn-chip registers) and if the bottommost label is "R31", it's PPC code

    If the list is broken up into two sections, with labels D0 through D7 and A0 through A7, you're in 68K code.

    Another way to tell if just look at the code. If it's displayed in all caps and seems to have English-like words in it such as
    MOVEQ
    MOVEM
    UNLK

    then it's 68K.

    If it is all-lowercase gibberish such as

    blr
    stw
    li

    then it is PPC code, and the gp command is helpful before killing off the app with es.

  20. #20
    Join Date
    Sep 2000
    Location
    Peoples Republic of Lawrence, KS, US
    Posts
    1,370

    Default

    Hey, thanks Bmonk. That's good info. Funicular sent me a couple of links earlier today that also have some great info, here:
    http://www.tidbits.com/tb-issues/TidBITS-449.html http://www.tidbits.com/tb-issues/TidBITS-450.html

    I had occasion to use some of this info today. I had a full crash while doing a Palm HotSync and using IE 5.0, which I guess I was kinda asking for it ("I wonder if my Palm Mac can handle HotSync while cranking up a large HTML doc"?). Did a StdLog and determined that it was my Palm Mac app that had fully puked, and then killed it......presto! Back to IE 5.0 and full finder access again.

    That is just too cool!!!! Magician, thanks for your original suggestion!!!

    Hope everybody around these parts is doing okay.

    Hey Mag, I'm a non-smoker now!!! 2 weeks and not counting.....much anyway.......


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •