home *** CD-ROM | disk | FTP | other *** search
/ db.tidbits.com / db.tidbits.com.tar / db.tidbits.com / getbits.acgi?tbser=1057.orig < prev    next >
Text File  |  2010-09-23  |  82KB  |  878 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2.         "http://www.w3.org/TR/html4/loose.dtd">
  3.  
  4. <html lang="en">
  5. <head>
  6.     <meta http-equiv="content-type" content="text/html;charset=utf-8">
  7.     <meta http-equiv="Content-Language" content="en">
  8.     <title>TidBITS: MacsBug!</title>
  9.  
  10.     <meta name="title" content="TidBITS: MacsBug!">
  11.     <meta name="description" content="TidBITS is a free email and Web publication covering the Macintosh Internet community.">
  12.     <link rel="image_src" href="/images/tblogo9.gif" />
  13.     <meta name="keywords" content="Apple, Mac, Macintosh, Mac OS, Mac OS X, newsletter, Internet, analysis, reviews, technology, news, TidBITS, TidBITS Talk, Engst">
  14.     <link rel="Help" href="http://www.tidbits.com/about/about-tidbits.html" title="About TidBITS">
  15.     <link rel="Search" href="http://www.tidbits.com/search/" title="Search All TidBITS Content">
  16.     <link rel="Author" href="http://www.tidbits.com/about/contact-info.html" title="Contact Information">
  17.     <link rel="Contents" href="tb-issues/" title="TidBITS Issue Archive">
  18.     <link rel="alternate" type="application/rss+xml" href="http://db.tidbits.com/feeds/tidbits.rss" title="TidBITS Full Text Feed">
  19.     <link rel="alternate" type="application/rss+xml" href="http://db.tidbits.com/commentfeeds/firehose.xml" title="TidBITS Full Comments Feed">
  20.  
  21.     <link rel="stylesheet" href="/tidbits_2010_001.css" type="text/css">
  22.     <LINK rel="stylesheet" type="text/css" media="print" href="/tb-new-print.css">
  23.     <script src="/javascript/tb.js" type="text/javascript"></script>
  24.     <meta name="viewport" content="width:940">
  25.     <script type='text/javascript' src='http://db.tidbits.com/ads/delivery/spcjs.php?id=2'></script>
  26.     <script src="/javascript/prototype.js" type="text/javascript"></script>
  27. <script src="/javascript/scriptaculous.js" type="text/javascript"></script>
  28. <script src="/js-global/FancyZoom.js" type="text/javascript"></script>
  29. <script src="/js-global/FancyZoomHTML.js" type="text/javascript"></script>
  30. <script type="text/javascript"  src="http://api.recaptcha.net/js/recaptcha_ajax.js"></script>
  31.  
  32. </head>
  33. <body onLoad="setupZoom()">
  34. <!-- popup query -->
  35. <div id="big_ole_background" style="display:none"> </div>
  36. <div id="tipbits_enclosure_preview" style="display:none">
  37. <div class="tearoffbox_wide_container">
  38. <div class="tearoffbox_wide_tips">
  39.  
  40. <div class="tip_display">
  41. <div class="preview">
  42. <h6><span id="p_tips_title"></span></h6>
  43. <p id="p_tips_text"></p>
  44. <p>Visit <a href="javascript:void(0)" id="p_url"><span id="p_label"></span></a></p>
  45. <p class="credit">Submitted by <span id="p_reader"></span></p>
  46. <p><input type="submit" value="Back" name="preview_tip" onClick="preview_box('ts','tipbits_enclosure_preview'); return false;"></p>
  47. </div>
  48. </div>
  49. <div class="tearoffbox_wide_bottom_tips">
  50. </div>
  51.  
  52. </div><!-- end tearoffbox_wide_tips -->
  53. </div><!-- end tearoffbox_wide_container for tips-->
  54. <!-- end tearoff box wide -->
  55. </div><!-- end enclosure -->
  56.  
  57. <div class="popup_box_with_captcha" id="ts" style="display:none">
  58.     <div id="popup_box_thanks" style="display:none" onClick="close_popup_thanks('popup_box_thanks', 'ts')"><br>Thanks for submitting your tip! All submissions are moderated by an editor before appearing online. We've reset the form so you can enter another tip. Or you can close the tip submission box.    <div class="x_close" id="thanks_upper_right"><a href="javascript:void(0)" onmousedown="close_popup_thanks('popup_box_thanks', 'ts'); return true;">Close</a></div></div>
  59.     <div class="tip_box_format">
  60.     <div id="ts_innards" onClick="close_popup_thanks('popup_box_thanks', 'ts')">
  61.         <div class="tip_box_head">TipBITS Submission</div>
  62.         <div class="tip_box_form">        
  63.                 
  64.             <div class="tbf_row" id="ts_message_box" style="display:none">
  65.                 <div class="tbf_wide"><div class="tbf_alert" id="ts_top_message"></div></div>
  66.             </div>
  67.             <div class="spacer"></div>
  68.  
  69.             <form action="foobar.cgi" method="get" name="submit_tip">
  70.  
  71.             <div class="tbf_row"><div class="tbf_wide_extra_top not_bold">Please submit only technical tips that will help other TidBITS readers better use their Macs, iPhones, and related software and hardware. All product announcements should be sent to <a href="mailto:releases@tidbits.com">releases@tidbits.com</a>.</div></div>
  72.             <div class="spacer"></div>
  73.             <div class="tbf_row">
  74.                 <div class="tbf_left">Tip title<span class="required_field">*</span></div><div class="tbf_right"><input type="text" value="" id="tip_title_id" name="tip_title" tabindex="1"></div>
  75.             </div>
  76.             <div class="spacer"></div>
  77.             <div class="tbf_row">
  78.                 <div class="tbf_left">Your tip<span class="required_field">*</span></div><div class="tbf_right"><textarea name="tip_text" rows="3" cols="40" tabindex="2"></textarea></div>
  79.             </div>
  80.             <div class="spacer"></div>
  81.             <div class="tbf_row">
  82.                 <div class="tbf_left">URL</div><div class="tbf_right"><input type="text" value="" name="tip_link_url" tabindex="3"><span class="tip_description"><br>Enter the URL to a Web page that supports your tip.</span></div>
  83.             </div>
  84.             <div class="spacer"></div>
  85.             <div class="tbf_row">
  86.                 <div class="tbf_left">Linked text</div><div class="tbf_right"><input type="text" value="" name="tip_link_label" tabindex="4"><span class="tip_description"><br>Enter the name of the page linked above.</span></div>
  87.             </div>
  88.             <div class="spacer"></div>
  89.             <div class="tbf_row">
  90.                 <div class="tbf_left">Your name<span class="required_field">*</span></div><div class="tbf_right"><input type="text" value="" name="tip_reader_name" tabindex="5"></div>
  91.             </div>
  92.             <div class="spacer"></div>
  93.             <div class="tbf_row">
  94.                 <div class="tbf_left">Your email<span class="required_field">*</span></div><div class="tbf_right"><input type="text" value="" name="tip_reader_email" tabindex="6"></div>
  95.             </div>
  96.             <div class="spacer"></div>
  97.             <div class="spacer"></div>
  98.                 <div class="tbf_wide"><span class="fine_print"><span class="required_field">* indicates required fields</span></span></div>
  99.             <div class="spacer"></div>
  100.             <div class="tbf_row">
  101.                 <div class="tbf_wide_extra_top"><span class="fine_print">To help us avoid automated posts and spam, please enter the words below.</span></div>
  102.             </div>
  103.             <div class="spacer"></div>
  104.             <div class="tbf_row">
  105.                 <div class="tbf_wide"><div id="ts_recaptcha"></div></div>
  106.             </div>
  107.             <div class="spacer"></div>
  108.             <div class="tbf_row">
  109.                 <div class="tbf_wide"><input type="submit" value="Preview Your Tip" name="preview_tip" onClick="fill_preview('tipbits_enclosure_preview', 'ts', this.form); return false;" tabindex="7"> <input type="submit" value="Send Us Your Tip!" name="submit_this_tip" onClick="handle_tip_submission('ts', '', this.form, 'tip'); return false;" tabindex="8"></div>
  110.             </div>
  111.             <div class="spacer"></div>
  112.             <div class="tbf_row">
  113.                 <div class="tbf_wide"><span class="fine_print">When you submit a tip, you give us permission to use it. Read <a href="javascript:void(0)" onClick="generic_show_hide('tip_terms')">our terms</a> for more details. All submissions are reviewed before publication.</span></div>
  114.             </div>
  115.             
  116.             <div class="tbf_row" id="tip_terms" style="display: none">
  117.                 <div class="tbf_wide"><span class="fine_print">Our terms: By submitting a tip, you agree to assign TidBITS Publishing Inc., a non-exclusive, worldwide, perpetual license to reproduce, publish, and distribute your tip in connection with the TidBITS Web site and associated products in any media. You agree that you created the content you submitted, and that you have the right to assign us this license. You give us permission to use your name, but your email address won't be publicly displayed or shared. We review all submissions before publication, and reserve the right to select which submissions we feel are appropriate for our readers and to edit those we publish.</span></div>
  118.             </div>
  119.             <div class="spacer"></div>
  120.             </form>
  121.         </div><!-- end tip_box_form -->
  122.     </div><!-- end tip box innards -->
  123.     </div><!-- end tip box format -->
  124.     
  125.     <div class="x_close" id="ts_upper_right"><a href="javascript:void(0)" onmousedown="HidePopupContent('ts', 'ts', ''); return true;">Close</a></div>
  126.     
  127. </div><!-- end tip_submit box-->
  128.  
  129. <div class="popup_box_with_captcha" id="article_reference" style="display:none"><div class="article_ref_format"><textarea style="width:350px; height:100px;" name="article_ref" id="article_ref_box"></textarea></div>    <div class="x_close" id="article_reference_upper_right"><a href="javascript:void(0)" onmousedown="HidePopupContent('article_reference', 'article_reference', ''); return true;">Close</a></div>
  130. </div>
  131.  
  132. <div class="popup_box_with_captcha" id="comm" style="display:none">
  133.     <div class="tip_box_format">
  134.     <div id="comment_thanks" style="display:none" onClick="close_popup_thanks('comment_thanks', 'comm')"><br>Thanks for submitting a comment! Please check your email for a link that, when clicked, will verify that you're a real person and cause your comment to appear immediately. <div class="x_close" id="comment_upper_right"><a href="javascript:void(0)" onmousedown="close_popup_thanks('comment_thanks', 'comm'); return true;">Close</a></div></div>
  135.     <div id="comm_innards" onClick="close_popup_thanks('comment_thanks', 'comm')">
  136.         <div class="tip_box_head" id="comm_headline">Post a Comment</div>
  137.         <div class="tip_box_form">        
  138.                 
  139.             <div class="tbf_row" id="comm_message_box" style="display:none">
  140.                 <div class="tbf_wide"><div class="tbf_alert" id="comm_top_message"></div></div>
  141.             </div>
  142.             <div class="spacer"></div>
  143.  
  144.             <form action="foobar.cgi" method="get" name="post_comment" id="post_comment">
  145.             <input type="hidden" name="comment_nest" value=''>
  146.             <input type="hidden" name="comment_id" value=''>
  147.             <input type="hidden" name="article_id" value=''>
  148.             <input type="hidden" name="edit" value=''>
  149.             <div class="tbf_row">
  150.                 <div class="tbf_left">In reply to</div>
  151.                 <div class="tbf_right">
  152.                     <div id="cb_quoted_row">
  153.                         <div class='cb_open_quote'>“</div>
  154.                         <div id="cb_quoted"></div>
  155.                         <div class='cb_close_quote'>”</div>
  156.                     </div>
  157.                     <div class="spacer"></div>
  158.                 </div>
  159.             </div>
  160.             <div class="spacer"></div>
  161.  
  162.             <div class="tbf_row">
  163.                 <div class="tbf_left" style="padding-top:0">Your comment</div>
  164.                 <div class="tbf_right"><textarea tabindex="1" name="cb_item_add" id="cb_item_add" rows="4" cols="50" onKeyDown="count_insert('cb_item_add','cb_char_count')"></textarea><br><div class="cb_char_count" id="cb_add_count">Remaining characters: <span id="cb_char_count">0</span></div></div>
  165.             </div>
  166.             <div class="spacer"></div>            
  167.  
  168.             <div class="tbf_row">
  169.                 <div class="tbf_left">Your name</div><div class="tbf_right" style="margin-top:8px"><input tabindex="2" type="text" value="" name="cb_add_name" id="cb_add_name" style="margin-top: -4px"></div>
  170.             </div>
  171.             <div class="spacer"></div>
  172.             
  173.             <div class="tbf_row">
  174.                 <div class="tbf_left">Your email</div><div class="tbf_right"><input tabindex="3" type="text" name="cb_add_email" id="cb_add_email"></div>
  175.             </div>
  176.             <div class="spacer"></div>
  177.             
  178.             <div class="tbf_row">
  179.                 <div class="tbf_left"> </div><div class="tbf_right"><input id="comm_post_comment" tabindex="4" type="submit" value="Post Comment" name="submit_this_comment" style="width:100px; float:right" onClick="cb_post_submit(); return false;"></div>
  180.             </div>
  181.             <div class="spacer"></div>
  182.             
  183.             <div class="tbf_row" id="comment_terms">
  184.                 <div class="tbf_wide"><span class="fine_print">Our terms: We reserve the right to edit or delete any comment, so please post thoughtfully. We use your email address <i>only</i> to send you a one-time verification message confirming that you posted this comment. We also store your address to allow you to verify using other Web browsers in the future. For more info, see our <a href="http://db.tidbits.com/privacy.html">privacy policy</a>.</span></div>
  185.             </div>
  186.             <div class="spacer"></div>
  187.  
  188.             </form>
  189.         </div><!-- end comm_form -->
  190.     </div><!-- end comm box innards -->
  191.     </div><!-- end comm box format -->
  192.     
  193.     <div class="x_close" id="comm_upper_right"><a href="javascript:void(0)" onmousedown="HidePopupContent('comm', 'comm', ''); return true;">Close</a></div>
  194.     
  195. </div><!-- end comm_submit box-->
  196.  
  197.  
  198. <!-- start mainbody -->
  199. <div id="mainbody">
  200.  
  201. <!-- start header -->
  202. <div id="header">
  203.  
  204.  
  205.  
  206.     <div id="tblogo">
  207.     <a href="/"><img src="/images/tblogo20_01.gif" alt="TidBITS: Apple News for the Rest of Us" width="177" height="84" border="0"></a>
  208.  
  209.     </div><!-- end tblogo -->
  210.  
  211.  
  212. <!-- leaderboard ad -->
  213. <div id="top_banner">
  214. <script type='text/javascript'><!--// <![CDATA[
  215.     OA_show(3);
  216. // ]]> --></script><noscript><a target='_blank' href='http://db.tidbits.com/ads/delivery/ck.php?n=TBe5f7021'><img border='0' alt='' src='http://db.tidbits.com/ads/delivery/avw.php?zoneid=3&n=TBe5f7021'></a></noscript>
  217. </div><!-- end top_banner style -->
  218. <!-- end leaderboard ad -->
  219.  
  220.  
  221. </div><!-- end header  -->
  222.  
  223.  
  224. <!-- start content_container -->
  225. <div id="content_container">
  226.  
  227.  
  228. <!-- begin leftcolumn -->
  229. <div id="leftcolumn">
  230.  
  231. <!-- begin leftnav /left navigation -->
  232. <div>
  233.     <ul class="leftnav">
  234.         <!-- start search -->
  235.         <li class="topcorner">
  236.             <form action="http://db.tidbits.com" method="POST" name="search_form"><input type="hidden" name="advanced_search" value=''><input type="text" name="search_text" size="8" maxlength="70" value="Search" onFocus="this.value=''" onBlur="if (this.value == '') { this.value = 'Search'; }"> <span style="margin: 0 5px 0 5px; vertical-align: -2px"><span style="vertical-align: -2px"><input type="image" name="submit_search" src="/images/go_search_button.gif"></span>  <img src="/images/adv_search_button.gif" title="Click for Advanced Search" onClick="var f = document.search_form; f.search_text.value =''; f.advanced_search.value = '1'; f.submit();"></span></form>
  237.         </li>
  238.     </ul>
  239. </div>
  240. <!-- end search -->
  241.  
  242. <!-- Get TidBITS box (temp) -->
  243. <div>
  244.     <ul class="leftnav">
  245.         <li class="gettb"><strong>Get TidBITS via...</strong></li>
  246.     
  247.         <li><a href="http://www.tidbits.com/list" title="Subscribe via email" class="gettb">Email <img src="/images/gettb_button_email.gif" width="12" height="12" border="0" class="nav_img" alt="Email subscription options"></a></li>
  248.         <li><a href="/feeds/tidbits.rss" title="Subscribe via RSS" class="gettb">RSS <img src="/images/feed-icon-12x12.gif" width="12" height="12" border="0" class="nav_img" alt="Subscribe via RSS"></a></li>
  249.         <li><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=276986548" title="Subscribe to the podcast" class="gettb">Podcast <img src="/images/feed-icon-12x12_podcast.gif" width="12" height="12" border="0" class="nav_img" alt="Subscribe to the postcast"></a></li>
  250.         <li><a href="http://www.twitter.com/TidBITS" title="Get Article Updates via Twitter" class="gettb">Twitter <img src="/images/feed_icon_12x12_twitter.png" width="12" height="12" border="0" class="nav_img" alt="Get Article Updates via Twitter"></a></li>
  251.         <li><a href="http://www.facebook.com/pages/TidBITS/195314925519" title="Go to the TidBITS Page at Facebook" class="gettb">Facebook <img src="/images/feed_icon_12x12_facebook.gif" width="12" height="12" border="0" class="nav_img" alt="Go to the TidBITS Page at Facebook"></a></li>
  252.     </ul>
  253. </div>
  254. <!-- end Get TidBITS box -->
  255.     
  256.     <ul class="leftnav">
  257.         <li><a href="/" class="tabhead">TidBITS Home</a></li>
  258.  
  259.         <li><a href="javascript:void(0)" title="Sections" class="tabhead" onClick="return showhide('articleslist')">Sections <span id="articleslist_triangle"><img src="/images/nav_triangle_open.gif" width="9" height="9" border="0" class="navtriangle" id="articleslist_tri_image" alt="Click to show or hide the contents of this section."></span></a></li>
  260.     
  261.     
  262.     </ul>
  263.  
  264. <div id="articleslist" style="display: none"><ul class="leftnav"><li><a href="/section/business" >Business Apps</a></li>
  265. <li><a href="/section/entertainment" >Entertainment</a></li>
  266. <li><a href="/section/links" >External Links</a></li>
  267. <li><a href="/section/home" >Home Macs</a></li>
  268. <li><a href="/section/inside" >Inside TidBITS</a></li>
  269. <li><a href="/section/iphone-ipad-ipod" >iPhone iPad iPod</a></li>
  270. <li><a href="/section/fun" >Just for Fun</a></li>
  271. <li><a href="/section/macs" >Macs & Mac OS X</a></li>
  272. <li><a href="/section/creative" >Media Creation</a></li>
  273. <li><a href="/section/net" >Networking</a></li>
  274. <li><a href="/section/opinion" >Opinion</a></li>
  275. <li><a href="/section/support" >Problem Solving</a></li>
  276. <li><a href="/section/security" >Safe Computing</a></li>
  277. <li><a href="/section/tech" >Tech News</a></li>
  278. <li><a href="/section/watchlist" >Watchlist</a></li>
  279. </ul></div>
  280.  
  281. <div>
  282. <ul class="leftnav">
  283.     <li><a href="javascript:void(0)" onClick="return showhide('stafflist')" title="Staff" class="tabhead">Staff <span id="stafflist_triangle"><img src="/images/nav_triangle_closed.gif" width="9" height="9" border="0" class="navtriangle" id="stafflist_tri_image" alt="Click to show or hide the contents of this section."></span></a></li>
  284. </ul>
  285. </div>
  286.  
  287. <div id="stafflist" style="display:block"><ul class="leftnav"><li><a href="/author/Adam+C+Engst" title="Adam Engst, Publisher">Adam Engst</a></li>
  288.     <li><a href="/author/Tonya+Engst" title="Tonya Engst, Editor in Chief">Tonya Engst</a></li>
  289.     <li><a href="/author/Jeff+Carlson" title="Jeff Carlson, Managing Editor">Jeff Carlson</a></li>
  290.     <li><a href="/author/Joe+Kissell" title="Joe Kissell, Senior Editor">Joe Kissell</a></li>
  291.     <li><a href="/author/Glenn+Fleishman" title="Glenn Fleishman, Contributing Editor">Glenn Fleishman</a></li>
  292.     <li><a href="/author/Mark+Anbinder" title="Mark Anbinder, Contributing Editor">Mark H. Anbinder</a></li>
  293.     <li><a href="/author/Matt+Neuburg" title="Matt Neuburg, Contributing Editor">Matt Neuburg</a></li>
  294.     <li><a href="/author/Rich+Mogull" title="Rich Mogull, Contributing Editor">Rich Mogull</a></li>
  295.     <li><a href="/author/Lex+Friedman" title="Lex Friedman, Staff Writer">Lex Friedman</a></li>
  296.     </ul>
  297.     </div>
  298.  
  299. <div>
  300. <ul class="leftnav">
  301.  
  302.     <li><a href="javascript:void(0)" title="Issues" class="tabhead" onClick="return showhide('issuelist')">Weekly Issues <span id="issuelist_triangle"><img src="/images/nav_triangle_closed.gif" width="9" height="9" border="0" class="navtriangle" id="issuelist_tri_image" alt="Click to show or hide the contents of this section."></span></a></li>
  303. </ul>
  304. </div>
  305.  
  306. <div id="issuelist" style="display:none"><ul class="leftnav"><li><div class="special"><form method="post" action="noaction.cgi" onsubmit="return false" id="issue_search_form" name="issue_search_form">Issue # <input type="text" onkeydown="if (event.keyCode == 13) { redirect_issue(this.form); }" id="issue_searchvalue" name="issue_number" style="width:35px; height: 10px"> <input onclick="redirect_issue(this.form)" type="image" name="submit_search" src="/images/go_search_button_blk.gif"></form></div></li><li><A HREF="/issue/1045" >#1045, 20 Sep 10</A></li>
  307. <li><A HREF="/issue/1044" >#1044, 13 Sep 10</A></li>
  308. <li><A HREF="/issue/1043" >#1043, 06 Sep 10</A></li>
  309. <li><A HREF="/issue/1042" >#1042, 30 Aug 10</A></li>
  310. <li><A HREF="/issue/1041" >#1041, 23 Aug 10</A></li>
  311. <li><A HREF="/issue/1040" >#1040, 16 Aug 10</A></li>
  312. <li><A HREF="/issue/1039" >#1039, 09 Aug 10</A></li>
  313. <li><A HREF="/issue/1038" >#1038, 02 Aug 10</A></li>
  314. <li><A HREF="/issue/1037" >#1037, 26 Jul 10</A></li>
  315.  
  316.  
  317. <li><a href="/backissues">Back Issues</a></li></ul></div>
  318.  
  319.  
  320. <div>
  321. <ul class="leftnav">
  322.  
  323.     <li><a href="/tidbitstalk" title="TidBITS Talk" class="tabhead">TidBITS Talk</a></li>
  324. </ul>
  325. </div>
  326.  
  327.  
  328.  
  329. <div>    
  330. <ul class="leftnav">
  331.     <li><a href="javascript:void(0)" onClick="return showhide('abouttidbits')" title="About TidBITS" class="tabhead">About TidBITS <span id="abouttidbits_triangle"><img src="/images/nav_triangle_closed.gif" width="9" height="9" border="0" class="navtriangle" id="abouttidbits_tri_image" alt="Click to show or hide the contents of this section."></span></a></li>
  332. </ul>
  333. </div>
  334.  
  335. <div id="abouttidbits" style="display:none">
  336. <ul class="leftnav"><li><a href="/about.html" title="About TidBITS">About Us</a></li><li><a href="/account.html" title="Account Help">Account Help</a></li><li><a href="/advertising.html" title="Advertise with TidBITS!">Advertise</a></li><li><a href="/contact.html" title="Contact Info">Contact</a></li><li><a href="/copyright.html" title="Copyright Terms">Copyright</a></li>
  337. </ul>
  338. </div>
  339.  
  340. <div>
  341. <ul class="leftnav">
  342. <li class="bottom"> </li>
  343. </ul>
  344. </div>
  345. <!-- end leftnav/left navigation -->
  346.  
  347. <!-- making sure nav elements hide/show before page loads --><script type="text/javascript"><!--
  348.     showhide('articleslist','show'); 
  349. // --></script>
  350.  
  351. <!-- begin sponsor_sidebox -->
  352.  
  353. <div class="sponsor_sidebox">
  354.  
  355. <ul>
  356.  
  357. <li><a href="http://markspace.com/bits?source=tidbits">Mark/Space</a></li>
  358.  
  359. <li><a href="http://www.thedatarescuecenter.com/">The Data Rescue Center</a></li>
  360.  
  361. <li><a href="http://crashplan.com/ref/tidbits.html">CrashPlan</a></li>
  362.  
  363. <li><a href="http://www.smilesoftware.com/">Smile</a></li>
  364.  
  365. <li><a href="http://www.usefulfruit.com/tb">Useful Fruit</a></li>
  366.  
  367. <li><a href="http://www.tidbits.com/about/support/contributors.html">Readers Like You!</a></li>
  368.  
  369. <li><a href="http://www.econtechnologies.com/tb">Econ Technologies</a></li>
  370.  
  371. <li><a href="http://macte.ch/conf_tidbits">MacTech Conference</a></li>
  372.  
  373. <li><a href="http://www.webcrossing.com/">Web Crossing</a></li>
  374.  
  375. <li><a href="http://nuance.com/dragon/mac">Nuance</a></li>
  376.  
  377. <li><a href="http://www.smithmicro.com/tidbits">Smith Micro</a></li>
  378.  
  379. </ul><div class='sponsor_sidebox_bottom'> </div>
  380. </div>
  381.  
  382.  
  383. <!-- end sponsor_sidebox -->
  384.  
  385.  
  386. </div> <!-- end leftcolumn div -->
  387.  
  388. <!-- end left column -->
  389.  
  390.  
  391. <!-- begin centercolumn_border -->
  392.  
  393. <div id="centercolumn_border">
  394.  
  395. <div class="center_top">Thoughtful, detailed coverage of the Mac, iPhone, and iPad, plus the best-selling <a href="http://www.takecontrolbooks.com/?pt=TB-TAGLINE" style="color:yellow">Take Control</a> ebooks.</div>
  396.  
  397. <!-- begin centercolumn -->
  398. <div id="centercolumn">
  399.  
  400.  
  401.  
  402. <!-- begin rightcolumn_container -->
  403. <div id="rightcolumn_container">
  404.  
  405. <!-- begin rightcolumn -->
  406.     <!-- rightcolumn is embedded within centercolumn so featured text wraps around it -->
  407.     <div id="rightcolumn">
  408.  
  409. <p class="top"> </p>
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420. <!-- Watchlist items -->
  421. <div class="tearoffbox_wide_container">
  422. <div class="tearoffbox_wide_watchlist">
  423. <p class="tearoffbox_wide_top_watchlist"> </p>
  424.  
  425. <h6><a href="/section/watchlist">TidBITS Watchlist</a></h6>
  426. <ul>
  427.  
  428. <LI><a href="/article/11625">Adobe Flash Player 10.1.85.3</a></LI>
  429.  
  430. <LI><a href="/article/11622">DEVONthink and DEVONnote 2.0.4</a></LI>
  431.  
  432. <LI><a href="/article/11620">Security Update 2010-006</a></LI>
  433.  
  434. <LI><a href="/article/11619">TinkerTool 4.2</a></LI>
  435.  
  436. <LI><a href="/article/11618">Mailplane 2.2</a></LI>
  437.  
  438. <LI><a href="/article/11617">Pro Applications Update 2010-02</a></LI>
  439.  
  440. <LI><a href="/article/11611">Dialectic 1.7</a></LI>
  441.  
  442. <LI><a href="/article/11604">Transmit 4.1.1</a></LI>
  443.  
  444. <LI><a href="/article/11603">MarsEdit 3.1.1</a></LI>
  445.  
  446. <LI><a href="/article/11600">Savescreenie 2.0</a></LI>
  447.  
  448. </ul>
  449.  
  450. <div class="tearoffbox_wide_bottom_watchlist"> </div>
  451.  
  452. </div><!-- end tearoffbox_wide -->
  453.  
  454. </div><!-- end tearoffbox_wide_container for watchlist items -->
  455.  
  456. <!-- begin tearoff box wide -->
  457.  
  458. <div class="tearoffbox_wide_container">
  459. <div class="tearoffbox_wide_tips">
  460.  
  461. <div class="tip_display">
  462. <div class="tips_sponsor_logo">
  463.  
  464. </div>
  465. <h6>Undelete an iPhone Voicemail Message</h6>
  466. <p><p>There's no Command-Z in the Phone app, but you may be able to retrieve a deleted voicemail message: Open the Voicemail screen in the Phone app. At the bottom of the screen, tap Deleted Messages. To restore a listed message, tap it and then click Undelete.</p></p>
  467.  
  468. </div>
  469.  
  470. <div class="tearoffbox_wide_bottom_tips">
  471. <div style="padding-bottom:35px"><div class="tip_display" style="float:left"><p><br><a href="/tipbits/185">Link to this tip</a></p></div><div class="tip_display" style="float:right; width:150px">
  472.  
  473. <p class="credit">Written by<br><a href="/author/Tonya%20Engst">Tonya Engst</a></p></div></div>
  474.  
  475. </div>
  476.  
  477. <div class="tearoffbox_wide_tips_submit">
  478. <form method="post" onsubmit="return false" id="tipbits_form" name="tipbits_form" action="noaction.cgi"><p><a href="javascript:void(0)" onmousedown="ShowTipBox('ts','ts_recaptcha', 50, 'tip_title_id'); return true;">Share your own tip!</a> | <a href="javascript:void(0)" onClick="generic_show_hide('search_tipbits'); document.tipbits_form.tipbits_searchvalue.focus()">Search TipBITS</a></p>
  479. <p style="display:none" id="search_tipbits"><input type="text" onkeydown="if (event.keyCode == 13) { search_tipbits('tipbits_searchvalue'); }" id="tipbits_searchvalue" name="tipbits_searchvalue"> <a href="javascript:void(0)" onClick="search_tipbits('tipbits_searchvalue')">Search</a></p></form>
  480. </div>
  481. <div class="tearoffbox_wide_bottom_tips_submit">
  482.  
  483. </div>
  484.  
  485. </div><!-- end tearoffbox_wide_tips -->
  486. </div><!-- end tearoffbox_wide_container for tips-->
  487. <!-- end tearoff box wide -->
  488.  
  489.  
  490.  
  491. <!-- begin 300 x 250 ad -->
  492.  
  493. <div id="content_ad_square">
  494. <script type='text/javascript'><!--// <![CDATA[
  495.     OA_show(5);
  496. // ]]> --></script><noscript><a target='_blank' href='http://db.tidbits.com/ads/delivery/ck.php?n=TB7671f69'><img border='0' alt='' src='http://db.tidbits.com/ads/delivery/avw.php?zoneid=5&n=TB7671f69'></a></noscript>
  497. </div><!-- end 300 x 250 ad -->
  498.  
  499. <!-- TBTalk items -->
  500. <div class="tearoffbox_wide_container">
  501.  
  502. <div class="tearoffbox_wide_p">
  503. <p class="tearoffbox_wide_top_p"> </p>
  504.  
  505. <h5>Recent TidBITS Talk Discussions</h5>
  506. <ul>
  507.  
  508. <LI><a href="http://emperor.tidbits.com/webx?50@@.3cf95241">Alternatives to MobileMe for syncing calendars between iPad/Mac</a> (1 message)</LI>
  509.  
  510. <LI><a href="http://emperor.tidbits.com/webx?50@@.3cf94dbb">Free anti-virus for the Mac</a> (20 messages)</LI>
  511.  
  512. <LI><a href="http://emperor.tidbits.com/webx?50@@.3cf934e6">iTunes 10 syncing iPod Touch 4.1</a> (2 messages)</LI>
  513.  
  514. <LI><a href="http://emperor.tidbits.com/webx?50@@.3cf92a22">Thoughts about Ping</a> (16 messages)</LI>
  515.  
  516. </ul>
  517.  
  518. <div class="tearoffbox_wide_bottom_p"> </div>
  519.  
  520. </div><!-- end tearoffbox_wide -->
  521.  
  522. </div><!-- end tearoffbox_wide_container for TBtalk items -->
  523.  
  524. <!-- start takecontrol_ad -->
  525. <script type='text/javascript'><!--// <![CDATA[
  526.     OA_show(7);
  527. // ]]> --></script><noscript><a target='_blank' href='http://db.tidbits.com/ads/delivery/ck.php?n=TBe46d56f'><img border='0' alt='' src='http://db.tidbits.com/ads/delivery/avw.php?zoneid=7&n=TBe46d56f'></a></noscript><!-- end takecontrol_ad -->
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543. <div id="rightcolumn_bottom">
  544.  
  545. </div>
  546.  
  547.     </div><!-- end rightcolumn -->
  548.  
  549.  
  550. </div><!-- end rightcolumn_container -->
  551.  
  552.  
  553.  
  554. <!-- featured articles -->
  555.  
  556. <div id="center_ajax_sub" class="instapaper_body">
  557.  
  558. <!-- google_ad_section_start -->
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579. <!-- issue, article, or series -->
  580.  
  581.     
  582.     
  583.     
  584.         <!-- start pagehead -->
  585.         <div id="pagehead">
  586.         <h2>Series: MacsBug!</h2>
  587.         <p class="pagesubtitle">How real people can get good mileage from Apple's low-level debugger. </p>
  588.         <p class="showhide_all_series"><a href="javascript:void(0)" onClick="return showhide_all_articles('3797,3809,3823')"><span id="showhide_arts_top">Show the full text of all articles</span></a>
  589.         </div><!-- end pagehead -->
  590.     
  591.     
  592.     
  593.         
  594.     <!-- show article(s) -->
  595.     <div class="article"><a name="3797"></a>
  596.     
  597. <!-- comment initialization routine as needed -->
  598. <div class="popup_box_with_captcha" id="hc_3797" style="display: none">
  599.     <div class="tip_box_format">
  600.     <div id="hc_innards_alt_3797" style="display: none">
  601.             <div class="tbf_row">
  602.                 <div class="tbf_wide_80" id="hc_small_response_3797"></div><div class="x_close_row" id="hc_upper_right1_3797"><a href="javascript:void(0)" onmousedown="HidePopupContent('hc_3797', 'hc', '3797'); return true;">Close</a></div>
  603.  
  604.             </div>
  605.     </div>
  606.     <div id="hc_innards_3797">
  607.         <div class="tip_box_form">        
  608.             <form action="foobar.cgi" method="get" name="check_human_3797">
  609.             <div class="tbf_row">
  610.                 <div class="tbf_wide_80" id="hc_rc_3797">To help us avoid automated posts and misuse of our site, please enter the words below.</div><div class="x_close_row" id="hc_upper_right2_3797"><a href="javascript:void(0)" onmousedown="HidePopupContent('hc_3797', 'hc', '3797'); return true;">Close</a></div>
  611.  
  612.             </div>
  613.             <div class="spacer"></div>
  614.             <div class="tbf_row" id="hc_message_box_3797" style="display:none">
  615.                 <div class="tbf_wide"><div class="tbf_alert" id="hc_top_message_3797"></div></div>
  616.             </div>
  617.             <div class="spacer"></div>
  618.             <div class="tbf_row">
  619.                 <div class="tbf_wide"><div id="hc_recaptcha_3797"></div></div>
  620.             </div>
  621.             <div class="spacer"></div>
  622.             <div class="tbf_row">
  623.                 <div class="tbf_wide"><input type="submit" value="Submit" name="submit_this_tip" onClick="handle_tip_submission('hc', '3797', this.form, this.form.submit_type.value); return false;"><input name="calling_routine" type="hidden"><input type="hidden" name="getbits" value="5118"><input type="hidden" name="author_id"><input type="hidden" name="submit_type" value=""></div>
  624.             </div>
  625.             <div class="spacer"></div>
  626.             </form>
  627.         </div><!-- end tip_box_form -->
  628.     </div><!-- end hum box innards -->
  629.     </div><!-- end tip box format -->
  630. </div><!-- end tip_submit box-->
  631.  
  632.  
  633.  
  634.         
  635.         
  636.         <!-- specific article details here -->
  637.         
  638.         
  639.             <p class="series_number">Article 1 of 3 in series</p>
  640.         
  641.     
  642.         <article_link><script type="text/javascript">open_if_linked('')</script></article_link>
  643.         
  644.         <div class="featured_meta"><div class="meta_article">05 Oct 1998 | <a href="/article/5118?print_version=1">Print <span class="shift_up"><img src="/images/printer_icon.gif" alt="Printer-Friendly Version of This Article" border="0" width="9" height="10"></span></a></div></div>
  645.  
  646.         <H2><a href="/article/5118">MacsBug for the Merely Geeky, Part One</a></H2>
  647.  
  648.         <p class="byline">by <a href="/author/Geoff%20Duncan">Geoff Duncan</a> <a href="javascript:void(0)" onClick="document.check_human_3797.submit_type.value='email'; document.check_human_3797.author_id.value='15'; ShowTipBox('hc_3797', 'hc_recaptcha_3797')"><span class="shift_down"><img src="/images/gettb_button_email.gif" height="12" width="12" border="0" alt="Send Email to Author"></span></a></P>
  649.  
  650.         <!-- article text -->
  651.         <div id="article_blurb_3797"><p>Here's a fun game: let's plot Macintosh software on a map of the Earth, based on how Mac-like the software is.We would naturally plot the points representing the easiest, most intuitive software for the Mac OS at Apple headquarters in Cupertino, California<span class="readmore_series"><a href="javascript:void(0)" onClick="return showhide_article('3797')">Show full article</a></span></p></div>
  652.         <div id="article_text_3797" style="display:none"><p class="showhide_all_series"><a href="javascript:void(0)" onClick="return showhide_article('3797')">Hide full article</a></p><P>Here's a fun game: let's plot Macintosh software on a map of the Earth, based on how Mac-like the software is.</P><P>We would naturally plot the points representing the easiest, most intuitive software for the Mac OS at Apple headquarters in Cupertino, California. As we plotted more points, we'd find the surrounding San Francisco area would be peppered with thousands of dots, each representing a Macintosh program. In fact, most Macintosh software - even hard-to-learn programs or obtuse, cryptic utilities meant for power users - could be plotted within, say, a few thousand miles of Cupertino. That's not the kind of travel you'd undertake without packing a toothbrush and some clean underwear, but, for many people, getting there is at least conceivable in today's world.</P><P>However, on the opposite side of the globe, well south of Mauritius in the Indian Ocean, we would find a dot representing MacsBug.</P><P>MacsBug is Apple's low-level assembly language Macintosh debugger. If I remember correctly, MacsBug stands for "Motorola Advanced Computer System Debugger" and predates the Macintosh, first appearing in 1981. There's nothing Mac-like about MacsBug: it has no menu bar, no menus, no windows, no icons, no dialogs, and no buttons. Its display is a jumble of numbers, letters, and some cryptic words. You communicate with MacsBug using a command line, precisely the thing many people sought to escape with the Mac. MacsBug doesn't provide intuitive feedback about practically anything - in short, MacsBug violates every aspect of the Macintosh ideal.</P><P>MacsBug breaks these rules because it was designed to live underneath the Macintosh system software so programmers can see what's going on in overwhelming detail. MacsBug provides direct access to things users were never meant to see: system globals, application heap zones, CPU registers, task queues, and executing code.</P><P>Sounds scary, right? It is. But MacsBug is powerful, and power is seductive. Mastering MacsBug would require most Macintosh users to apply for passports and visas, receive immunizations and inoculations, make expensive travel arrangements, endure radical culture shock, leave their real lives, and maybe even grow gills. However, you can benefit from MacsBug without travelling to the other side of the world (or learning to read assembly language). MacsBug's not for everybody, but if you've been willing to travel from Cupertino to, say, Ohio, for another Macintosh program (like DeBabelizer or ResEdit), you should be able to put MacsBug to work for you. MacsBug can provide detailed information about your computer and problems you might be having, and - perhaps most significantly - save work in other applications when an otherwise fatal system error occurs.</P><P><STRONG>Installing MacsBug</STRONG> -- You can download MacsBug for free from Apple. I recommend the most recent version available - even if it's not a final release - because it's likely to work with the latest versions of the Mac OS. You can also download a PDF version of Apple's pre-PowerPC MacsBug documentation, which makes for interesting reading if you're curious about MacsBug's more abstruse capabilities. As of this writing, the current version of MacsBug is 6.5.4.a6.</P><P><<A HREF="http://developer.apple.com/dev/tools/debuggers/MacsBug/">http://developer.apple.com/dev/tools/debuggers/ MacsBug/</A>></P><P>You install MacsBug by dragging it into your System Folder and restarting your Mac (feel free to ignore other files that come with it). Your Mac OS startup screen will say "Debugger installed" to let you know MacsBug is there. MacsBug works with any Mac newer than the Mac Plus and System 6.0 or higher; it might even work with earlier system software. Although for years MacsBug occupied only a few hundred kilobytes of RAM, changes to the Macintosh architecture over the last few years mean MacsBug commonly requires 1 to 1.5 MB of RAM on modern Macs.</P><P>Recent versions of MacsBug come with a program called MacsBugApp, which, despite limitations, is a stand-alone application that behaves much like MacsBug itself. It's occasionally flaky, but you can use it to follow along with some of the examples below without installing MacsBug itself.</P><P><STRONG>Invoking MacsBug</STRONG> -- Once you've installed MacsBug, you might wonder where it is - nothing on your screen changes. There are two ways to enter MacsBug: deliberately and dramatically.</P><P>To enter MacsBug deliberately, press Command-Power, where Power is the key you use to turn on your Mac from the keyboard. This combination works on most Macs; older Macintosh models (up to the NuBus Power Macs, I believe) may also have a physical interrupt switch on the front, side, or back of the machine. If you've ever pressed a switch and seen a mysterious dialog containing only a greater-than symbol (">"), that's the interrupt switch. (By the way, that dialog is referred to as MicroBug or the programmer's window; to get out, your best bet is to type the letter G and press Return. You'll never see MicroBug with MacsBug installed, but Apple has a brief TechNote about it if you're curious.)</P><P><<A HREF="http://developer.apple.com/technotes/tn/tn1136.html">http://developer.apple.com/technotes/tn/ tn1136.html</A>></P><P>You can also invoke MacsBug by holding down the Control key when your Mac starts up. Only programmers typically need to do this, but I was once surprised by an old keyboard with sticky modifier keys.</P><P>The dramatic way to enter MacsBug is to experience a system error. Normally, a system error produces a bomb dialog, or a program quits, resulting in a dialog saying "An error of type -1 occurred." or something equally unhelpful. Now, MacsBug instantaneously appears, completely taking over your startup monitor. You need to be careful about how you exit MacsBug in response to a system error; your options are covered below.</P><P>First, let's describe MacsBug's display - it's divided into four areas. At the bottom is the command line, where you type MacsBug commands. Immediately above the command line is the PC region: PC stands for "program counter," and it displays the next instruction the CPU will execute, along with the disassembly of that instruction. This information is for programmers: it can give you an idea of where a system error occurred, but things like instruction pipelining (where the CPU executes more than one instruction at a time) sometimes mean the PC may not point to the actual error. Programmers sometimes need to disassemble forward and backward from the current PC to find the problem.</P><P>The largest area of the MacsBug display is called the output region, and it's where MacsBug shows the results of your commands. Although it doesn't have scrollbars, the Page Up, Page Down, Home, and End keys do scroll the output region's history. When you first enter MacsBug, it displays the version and copyright information in the output region, along with the reason MacsBug was entered.</P><P>Finally, along the entire left side of the MacsBug display is the status region, most of which displays CPU registers (R0 to R31 for PowerPC code, D0 to D7 and A0 to A7 for 68K code), along with the current stack pointer and, for 68K code, the stack itself. Don't worry about the stack and CPU registers. In the middle of all this, however, is some important information: beneath the label CurAppName, MacsBug shows the name of the currently executing application. If you entered MacsBug because of a system error, this is the program that had control when the error occurred, although it may <EM>not</EM> be the program you were using. Programs continue to execute when they aren't frontmost, and many things we think of as extensions - like Web Sharing and File Sharing - are in fact faceless applications that run in the background. Further, although CurAppName always says what program was in control when a problem occurred, the real problem could be in an extension, driver, or other software that underlies an application.</P><P>Near CurAppName, MacsBug also displays VM if you're using virtual memory, vM to indicate MacsBug was invoked while the Memory Manager was swapping between real and virtual memory, or RM to show you're using real memory. MacsBug also shows a number from 0 to 7 that indicates the interrupt level before MacsBug was invoked. Interrupts tell your CPU to set aside whatever it's doing and immediately take up a more important operation - they're used to handle mouse actions, screen redraws, network activity, serial port operations, and many other functions. MacsBug itself takes control of your system by generating a level 7 interrupt, otherwise known as a Non-Maskable Interrupt or NMI. (If you enter MacsBug deliberately, it tells you that the reason is an NMI rather than a system error.) An NMI overrides everything and can't be interrupted by other tasks. Generally, this isn't a problem: your applications aren't even aware they've been suspended. However, other computers on a network can notice that your Mac is no longer responding. After a few minutes, AppleShare servers will assume your Mac is gone and drop their connections; similarly, Internet servers might drop connections, and ISPs might hang up on you.</P><P><STRONG>Stop This Crazy Thing!</STRONG> Now that you're in MacsBug, the first thing most sensible people want to do is get out. If you invoked MacsBug deliberately, this is simple: just type G then press Return, or press Command-G. This stands for Go, and tells your Mac to resume operating right where it left off. MacsBug then vanishes, your Mac's normal display reappears, and your Macintosh universe resumes its normal, harmonious state.</P><P>If you entered MacsBug as the result of a system error, try the following options. First, under CurAppName in the status region, note the name of the program executing when the error occurred. Also look at the bottom of the output region for the reason MacsBug was triggered. It might say something like "bus error" or "illegal instruction." If you need to see what you were doing on screen when the error occurred, pressing Escape toggles between your normal Macintosh display and MacsBug. Don't become confused: pressing Escape <EM>doesn't</EM> exit MacsBug, it just <EM>shows</EM> your screen at the instant MacsBug was triggered, which can be handy for writing down that paragraph of erudition that you otherwise stand no chance of recreating. Press Escape again to return to MacsBug.</P><UL><LI><P>Next, try typing G then pressing Return, or pressing Command-G. Most likely, you'll immediately reenter MacsBug with the same error, but it's worth a shot.</P><LI><P>Type ES then press Return. ES stands for Exit to Shell, and tells MacsBug to terminate the current application and return you to the Finder. This is roughly equivalent to forcing an application to quit by pressing Command-Option-Escape. You may have to try ES a few times - just make sure you check which program is currently executing before repeating the command. If ES returns you to the Finder, save all your work and restart. If an application appears to have locked up, you can enter MacsBug intentionally and use ES to terminate that program. Use this capability with discretion, however: there's no telling what might be left in your computer's memory, whether any files that program had open will be closed properly, whether preferences might be damaged, etc. If you do this, restart as soon as possible.</P><LI><P>If none of these techniques work - you keep popping into MacsBug with a system error - you may have no choice but to restart, even though it means losing unsaved work. You do this by typing RB (for ReBoot), then pressing Return. The RB command unmounts your startup volume and then restarts the machine. If you have multiple volumes, this action can result in delays the next time you need to use those disks: since they weren't properly unmounted, the Mac makes sure they're okay before mounting them on the desktop. You can alternatively use the RS command (for ReStart) to unmount all drives, then restart the system. Some programmers may tell you the RS command is dangerous, since it could write corrupted volume information back to your drives, potentially leading to data loss or a session with a disk recovery tool. In my experience, everyday problems with the RS command are quite rare, and changes to both the RS and RB commands in recent versions of MacsBug reduce the danger further. However, either command is preferable to turning your computer off and on.</P></UL><P>Note that there are crashes from which MacsBug can't save you, and there are crashes that will still freeze your Mac, failing to invoke MacsBug at all. (The latter are often caused by poor or non-existent error checking when a program is low on memory.) In these cases, MacsBug can't help you, but having it installed doesn't hurt.</P><P><STRONG>Impress Your Friends</STRONG> -- Now that you can get into and out of MacsBug, let's look at some simple tricks to enhance your guru status.</P><P>Being a low-level programmer's tool, MacsBug's default numbering system is base 16, or hexadecimal. Hexadecimal digits run from zero to fifteen, with ten through fifteen represented by the letters A through F. So, the number 200 is written as C8 in hexadecimal, which means "twelve times sixteen, plus eight." Hexadecimal is useful for representing binary values, and if you've done much HTML authoring, you've seen six-digit hexadecimal values like 3366CC used to specify colors. This might be wonderful from MacsBug's point of view, but hexadecimal isn't intuitive for people like me who have trouble making change for a dollar. Fortunately, you can tell MacsBug a number is a normal decimal number by preceding it with a pound symbol ("#"). Thus, if you type 42, MacsBug sees it as hexadecimal and thinks you mean 66 (four times sixteen, plus two), but if you type #42, MacsBug thinks you mean 42.</P><P>One instance where this esoteric knowledge becomes practical is in conjunction with MacsBug's error command, which returns a short description of cryptic Mac OS error numbers. If a program complains that "an error -43 occurred" you can identify the error number by popping into MacsBug, typing "error #-43", and pressing Return:</P><PRE> $FFD5     #-43  fnfErr - File not found</PRE><P>The application is telling you it tried to open a file, but couldn't find it. Depending on the program, this might be caused by a missing extension, plug-in, or document, but at least it gives you something to go by. The error command can score big points: I once got a frantic call from a small business owner who had an AppleScript that essentially looked up records in a database and printed a variety of labels. "I think it has corrupted the hard drive! Every time I need to use the machine, it says there's an error -1711 - big error numbers are really bad, right?" So, assuring the caller that the number of digits in an error has nothing to do with its severity, I popped into MacsBug and looked up the number:</P><PRE> $F951   #-1711  errAEWaitCanceled - in AESend, the user cancelled   out of wait loop for reply or receipt</PRE><P>It turned out this script had been designed to run overnight, since it spent most of its time waiting around for other applications. However, the script was instead being run during lunch breaks and other odd times. Whenever someone needed to use the machine, they pressed Command-Period to stop the script, which promptly produced this error. The situation was harmless, but in this case having MacsBug installed helped me reduce my caller's blood pressure and gave me a low-stress consulting job fixing the script.</P><P>You can also use MacsBug to convert between decimal and hexadecimal, which can be useful with other MacsBug commands. Since MacsBug assumes numbers are hexadecimal; entering "3366CC" on MacsBug's command line yields this result:</P><PRE> 3366cc = $003366CC   #3368652   #3368652   '*3fA' (between #3M and #4M)</PRE><P>This shows the number 3366CC as a hexadecimal value, an unsigned decimal value, a signed decimal value, an ASCII value, and (often) a semi-human-friendly conversion to memory units, in this case between three and four megabytes. If you're converting from hexadecimal to decimal, the number you want is the third - the signed ASCII value (notice that it's preceded with a pound sign). Thus, 3366CC in hexadecimal is equal to 3,368,652 in decimal. The second (unsigned) decimal value will be identical for non-negative numbers, but wildly different for negative numbers. Convert #-43 and see what you get. You can use this trick to convert numbers up to about 2.1 billion.</P><P>Recent versions of MacsBug include basic mouse support in the output region, enabling you to click on a word, number, or term in order to place it in the command line. Although this mouse support drives some programmers insane (say, if the mouse moves while debugging a problem with a pop-up menu), you can quickly convert a number from hexadecimal to decimal by clicking it and pressing Return.</P><P>Finally, you can do math using MacsBug - try entering 32 + 32, or #32 + #32. Programmers occasionally rave about this capability, since they often need to play with hexadecimal values after an application has crashed. But most people should stick to the Calculator desk accessory.</P><P><STRONG>Break Point</STRONG> -- In the next part of this article, we'll look at some MacsBug commands that provide important information about your computer and applications, and how to make MacsBug automatically restart your computer if an application crashes, which can be great for unattended servers.</P><!-- MacsBug for the Merely Geeky, Part One Geoff Duncan --></div>
  653.         <div id="article_text_bottom_3797" style="display:none">
  654.         <p class="showhide_all_series"><a href="javascript:void(0)" onClick="return showhide_article('3797')">Hide full article</a></p><div class="sponsorbox">
  655. <div class="sponsortext"><A HREF="http://markspace.com/bits?source=tidbits"><IMG SRC="http://db.tidbits.com/images/badges/mark-space.gif" ALT="" HEIGHT="50" WIDTH="50" BORDER="0" ALIGN="left"></A>SYNC YOUR PHONE with The Missing Sync: Sync your calendar,<br />address book, music, photos and much more between your phone<br />and Mac. Supports ANDROID, BLACKBERRY, PALM PRE and many<br />other phones. <<a href="http://markspace.com/bits?source=tidbits">http://www.markspace.com/bits</a>></div>
  656. </div>
  657. <div class="sponsorbox_bottom"> </div>
  658. </div>
  659.  
  660.         <!-- end article text -->
  661.     
  662.         
  663.  
  664.         
  665.     </div><div class="article"><a name="3809"></a>
  666.     
  667. <!-- comment initialization routine as needed -->
  668. <div class="popup_box_with_captcha" id="hc_3809" style="display: none">
  669.     <div class="tip_box_format">
  670.     <div id="hc_innards_alt_3809" style="display: none">
  671.             <div class="tbf_row">
  672.                 <div class="tbf_wide_80" id="hc_small_response_3809"></div><div class="x_close_row" id="hc_upper_right1_3809"><a href="javascript:void(0)" onmousedown="HidePopupContent('hc_3809', 'hc', '3809'); return true;">Close</a></div>
  673.  
  674.             </div>
  675.     </div>
  676.     <div id="hc_innards_3809">
  677.         <div class="tip_box_form">        
  678.             <form action="foobar.cgi" method="get" name="check_human_3809">
  679.             <div class="tbf_row">
  680.                 <div class="tbf_wide_80" id="hc_rc_3809">To help us avoid automated posts and misuse of our site, please enter the words below.</div><div class="x_close_row" id="hc_upper_right2_3809"><a href="javascript:void(0)" onmousedown="HidePopupContent('hc_3809', 'hc', '3809'); return true;">Close</a></div>
  681.  
  682.             </div>
  683.             <div class="spacer"></div>
  684.             <div class="tbf_row" id="hc_message_box_3809" style="display:none">
  685.                 <div class="tbf_wide"><div class="tbf_alert" id="hc_top_message_3809"></div></div>
  686.             </div>
  687.             <div class="spacer"></div>
  688.             <div class="tbf_row">
  689.                 <div class="tbf_wide"><div id="hc_recaptcha_3809"></div></div>
  690.             </div>
  691.             <div class="spacer"></div>
  692.             <div class="tbf_row">
  693.                 <div class="tbf_wide"><input type="submit" value="Submit" name="submit_this_tip" onClick="handle_tip_submission('hc', '3809', this.form, this.form.submit_type.value); return false;"><input name="calling_routine" type="hidden"><input type="hidden" name="getbits" value="5130"><input type="hidden" name="author_id"><input type="hidden" name="submit_type" value=""></div>
  694.             </div>
  695.             <div class="spacer"></div>
  696.             </form>
  697.         </div><!-- end tip_box_form -->
  698.     </div><!-- end hum box innards -->
  699.     </div><!-- end tip box format -->
  700. </div><!-- end tip_submit box-->
  701.  
  702.  
  703.  
  704.         
  705.         
  706.         <!-- specific article details here -->
  707.         
  708.         
  709.             <p class="series_number">Article 2 of 3 in series</p>
  710.         
  711.     
  712.         <article_link><script type="text/javascript">open_if_linked('')</script></article_link>
  713.         
  714.         <div class="featured_meta"><div class="meta_article">12 Oct 1998 | <a href="/article/5130?print_version=1">Print <span class="shift_up"><img src="/images/printer_icon.gif" alt="Printer-Friendly Version of This Article" border="0" width="9" height="10"></span></a></div></div>
  715.  
  716.         <H2><a href="/article/5130">MacsBug for the Merely Geeky, Part Two</a></H2>
  717.  
  718.         <p class="byline">by <a href="/author/Geoff%20Duncan">Geoff Duncan</a> <a href="javascript:void(0)" onClick="document.check_human_3809.submit_type.value='email'; document.check_human_3809.author_id.value='15'; ShowTipBox('hc_3809', 'hc_recaptcha_3809')"><span class="shift_down"><img src="/images/gettb_button_email.gif" height="12" width="12" border="0" alt="Send Email to Author"></span></a></P>
  719.  
  720.         <!-- article text -->
  721.         <div id="article_blurb_3809"><p>The first part of this article in TidBITS-449 looked at MacsBug, Apple's free low-level debugger, explained how to install and invoke it, and how to use MacsBug to recover from application crashes<span class="readmore_series"><a href="javascript:void(0)" onClick="return showhide_article('3809')">Show full article</a></span></p></div>
  722.         <div id="article_text_3809" style="display:none"><p class="showhide_all_series"><a href="javascript:void(0)" onClick="return showhide_article('3809')">Hide full article</a></p><P>The first part of this article in <A HREF="http://www.tidbits.com/tb-issues/TidBITS-449.html">TidBITS-449</A> looked at MacsBug, Apple's free low-level debugger, explained how to install and invoke it, and how to use MacsBug to recover from application crashes. It also discussed looking up system error numbers with MacsBug, plus converting between decimal and hexadecimal and doing basic math.</P><P><<A HREF="http://db.tidbits.com/article/05118">http://db.tidbits.com/article/05118</A>></P><P>This time, we'll take a look at some MacsBug commands that reveal detailed information about your system and its applications. We'll also explain a bit about how your Macintosh and applications use memory, as well as how to make problem logs using MacsBug. MacsBug <EM>still</EM> isn't a friendly piece of software I'd recommend to all Macintosh users, but if you've come this far, going a little further won't hurt.</P><P><STRONG>By Your Command</STRONG> -- Let's take a look at some common (yet useful) MacsBug commands. These and other commands are case insensitive; it doesn't matter if you capitalize them the way I've written them here. MacsBug also has a Help command that displays often-cryptic descriptions of these and other commands. Although you'll see many of MacsBug's capabilities have to do with obscure functions like traps, breakpoints, and disassembly, there are some useful gems to be found. Type Help Misc for a small sampling.</P><UL><LI><P>How - Displays the reason MacsBug was invoked. If you entered MacsBug deliberately, this command tells you the cause is an NMI (Non-Maskable Interrupt).</P><LI><P>Stat - Displays the current date and time (along with how long since you last restarted the machine), the name of the current application, and some technical information about your system. Stat is handy for figuring out how long it's been since you last restarted your machine - for instance, although it's asleep much of the day, my PowerBook has been running for more than four months.</P><LI><P>ProcInfo - Displays a summary of running applications (or processes), including faceless background programs. The status column indicates which program is in the foreground (this might be different from the currently executing program found under CurAppName), which applications are in the background, and which are background-only. You can also see the programs' type and creator codes, along with how much memory they take and how much of that memory is free. These memory numbers are in hexadecimal: if you're using a recent version of MacsBug, remember you can just click them and press Return to translate the numbers to decimal. This is a great way to find out how much memory is used by the Finder and background applications like File Sharing, Web Sharing, or Desktop PrintMonitor. Note that the total memory size listed here does not include any temporary memory in the system heap the application might be using; for instance, MacsBug might say Internet Explorer is using 5 MB of memory, while About This Computer under Mac OS 8.x could report a significantly higher number since it includes temporary memory with its totals.</P><LI><P>File - Did you know that the Mac OS can open only 348 file forks - data and resource - at the same time? The File command displays a complete list of open file forks, sometimes including both the data fork and resource fork of the same file. In this list, you'll see not only any documents or files you currently have open, but all your running applications, fonts, disk directories, extensions, plug-ins and shared libraries used by applications, and more. At the end of the list, you'll see how many of the file forks are currently open: don't be surprised if this number approaches 200. It's not unusual for designers, production artists, programmers, and Web developers to open too many files inadvertently. Usually, quitting an application (or removing unused fonts) solves the problem. If you want to see which files a particular application has open, use the command File -P, followed by the process serial number of the program you're curious about. Process serial numbers are four digits long, and listed in the first column of the ProcInfo command, above. To see all open files except for fonts, type File 0 (that's a zero, not the letter O).</P><LI><P>Vol - Displays information about all mounted disks. For the most part, you already know what disks are mounted on your desktop, but this command tells you a little more about them. First, it provides (in hexadecimal) separate totals for the number of files and folders on a drive, unlike the Finder's Get Info command which just displays the total number of items. (It also tells you the allocation block size for a volume, but these numbers seem to be incorrect for HFS+ disks.)</P><LI><P>StopAS - Shuts down connections to all AppleShare servers, whether you connected to them using AppleTalk or TCP/IP. (Earlier versions of MacsBug support the StopXPP command, which just closes AppleTalk connections.) For non-programmers, StopAS has two uses. First, you might want to shut down all AppleShare connections if a server is giving you trouble (like disk errors or slow response due to network congestion). Second, remember from the first part of this article that AppleShare servers give up on you if you spend more than a couple minutes inside MacsBug. There's another downside: if this happens, when you exit MacsBug your applications will spend a couple more minutes in limbo wondering where these servers went. Using StopAS to shut down AppleShare connections eliminates delays when you come out of MacsBug.</P><LI><P>DX - When programmers are debugging an application, they often insert commands called "user breaks" that deliberately trigger MacsBug. User breaks are helpful if a programmer needs to see what's going on <EM>before</EM> a program crashes rather than after it has taken leave of the known universe. Programs released to the public don't usually have user breaks, but sometimes they slip through: I have a script that commonly triggers a few in Eudora Pro, and I've seen plenty in pre-release and beta software. If you don't have MacsBug installed and encounter a user break, the application is likely to crash with an error -10; with MacsBug installed, MacsBug will take over your system just like a system error, but will show the cause as a user break along with (sometimes) a message from the programmer. You can often just press Command-G to get out of a user break, but you should report the user break to the developer as a bug. However, if you hit an annoying one and you're trying to get work done, you can use the DX command to tell MacsBug to ignore user breaks: DX OFF turns user breaks off, DX ON turns user breaks on, and DX NOW tells you whether user breaks are enabled or disabled without changing their status. If you turn user breaks off, MacsBug turns them back on again when you restart your machine.</P></UL><P><STRONG>Thanks Heaps</STRONG> -- Each application running on your Mac stores windows, dialogs, documents, and other data in an area of RAM called its application heap. The size of a heap varies with the amount of memory allocated to an application. The system also has a heap, and it's the only one the Mac OS can resize on the fly. To change the size of an application heap, you must quit the program, change its memory settings in its Get Info window, then re-launch the program. This is one of the reasons proponents of other operating systems say the Mac OS has a weak memory model.</P><P>Heaps are divided into blocks, which can either be free (unused), relocatable (in use, but movable), or locked (in use and unmovable). Blocks in use can also be marked as purgeable, meaning that the application would prefer the data stay in RAM, but it can be released (purged) if the program needs more free memory. Each block of memory begins with a header containing some information about the memory block.</P><P>An application heap is a little like a disk in that it can become fragmented. As a program uses and releases memory (say, opening and closing documents), both free and occupied blocks of memory can become scattered throughout the heap. If the blocks are relocatable, the application re-organizes them to create larger areas of free space - just like optimizing a hard drive. If the blocks are locked, however, they can't be moved and the application may not be able to handle requests for large blocks of memory (say, to open a big document), even though there might be enough total free memory for the request.</P><P>Given this, you might wonder why programs ever use locked blocks. The reasons vary, but a good example is playing a movie. If the memory block containing a movie could be moved at any instant, the application would constantly have to check whether the memory had moved, which would destroy performance. By being able to guarantee the block won't move, the program can concentrate on playing the movie, then (in theory) give back the memory when its done. Some applications use more locked memory than others, but all applications use some.</P><P>Heaps can also become corrupted, usually when a program puts more data into a block than it was intended to hold. When this happens, it usually overwrites the header of the next block, and the Mac's Memory Manager loses track of that next block. The consequences can range from unnoticeable to disastrous, depending on the nature of that next block of memory.</P><P>If you'd like a program that graphically displays areas of an application's heap (and can peer into heap blocks), check out Joshua Golub's ZoneRanger, a 517K download from Metrowerks's Web site. It's a little unstable under recent versions of the Mac OS, but it's useful and educational.</P><P><<A HREF="http://www.metrowerks.com/tools/software/zoneranger.html">http://www.metrowerks.com/tools/software/ zoneranger.html</A>></P><P>MacsBug can tell you heaps about your heaps.</P><UL><LI><P>HT - The HT (heap total) command displays information about the current application's heap, including the amounts of free, relocatable, locked, and purgeable memory. HT provides results in hexadecimal and decimal numbers, expressed in bytes: you can use this command to see a bit of what's happening behind the scenes. If a program reports it's running low on memory but the HT command shows a large amount of free RAM is available, then the heap is probably seriously fragmented. You can try quitting and relaunching the application. If the problem persists, however, allocating more memory to the program may <EM>not</EM> solve the problem, since large areas of memory can be fragmented just as easily as smaller ones. (Of course, if a program complains it doesn't have enough memory and HT shows there truly isn't much memory available, then increasing the application's memory allocation should help.)</P><LI><P>HZ and HX - The heap total command, HT, works only on the current heap. How do you get information on a heap belonging to a different application? First, you need information about the other heaps, available via the HZ (heap zones) command. HZ lists all the heaps, complete with the names of the applications to which they belong. Each item on HZ's listing begins with a decimal number, starting with #1. You can use these numbers with the HX (heap exchange) command to switch to a particular heap. So, if HZ indicated Nisus Writer's heap was #9 on my machine, I could type HX #9 to switch to Nisus Writer's heap regardless of which application was running when MacsBug was invoked. Once I'd done that, the HT command would show me information about Nisus Writer's heap.</P><LI><P>HC - The HC (heap check) command tells MacsBug to check if the current application heap is corrupted; you can use HC ALL to check all heaps at once. You might try this if an application is behaving oddly but not crashing. If the HC command reports a heap is corrupted, things may get worse quickly: save all your work and quit the application. Note that this command can be fooled into thinking a heap is corrupted if MacsBug is invoked while an application is shuffling blocks around using the Memory Manager. There are ways you can tell MacsBug to keep running until a safe moment, but it's usually simpler to leave MacsBug using G (or Command-G), wait a second, then re-enter MacsBug to see if the problem persists. If you're curious, look up the WNE and WNEPPC (only available in recent versions of MacsBug) commands in MacsBug's help.</P></UL><P><STRONG>Logging Problems</STRONG> -- Because MacsBug is so good at uncovering information about your current application and the state of your Macintosh, it's useful for folks who are testing or evaluating software, as well as for software programmers. The only difficulty is determining what information is relevant when you're reporting a bug.</P><P>Fortunately, the folks who make MacsBug have made this easy for you. The StdLog command, as the name implies, creates a text file with a standardized log of information developers commonly need when they're investigating a bug. These logs are pretty big (usually about 20K), and contain the results of several MacsBug commands, including many discussed here. When you use the StdLog command, the log appears as a text file named StdLog on the desktop. If you use the StdLog command again, the information will be appended to any existing file named StdLog, rather than overwriting it.</P><P>Unless you're already in contact with the program's developer, I don't recommend sending a standard log via email as a bug report. Instead, describe the bug succinctly, and indicate you've made a MacsBug log of the problem, which you can send they like. Hang on to the file. Some developers will disagree with me, but, having handled my share of bug reports received via email, large reports with attachments are more awkward than concise notes. Frankly, if a program is in public testing, there should be few new bugs turning up. It's not particularly useful for a developer to receive dozens of log files about a problem that's already known and possibly already fixed.</P><P><STRONG>Another Break Point</STRONG> -- In the next part of this article, we'll take a quick look at using MacsBug to restart machines automatically in the event of a crash. If you'd like more information about MacsBug, check out Apple's MacsBug Reference and Debugging Guide, available in Acrobat PDF format. Although it hasn't been updated since MacsBug 6.2 in 1991, this guide still offers detailed information on the inner workings of Macintosh memory management, plus traps, disassembly, and much more.</P><P><<A HREF="http://developer.apple.com/dev/tools/debuggers/MacsBug/Documentation/MacsBugRef_6.2.pdf">http://developer.apple.com/dev/tools/debuggers/ MacsBug/Documentation/MacsBugRef_6.2.pdf</A>></P><P>In addition, the weekly journal MWJ published a lengthy two-part article earlier this year called MacsBug for Non-Programmers, which discusses several MacsBug features not covered here, including analyzing heaps and both displaying and searching memory. Both parts are reprinted on Ted Landau's MacFixIt site. If you can't get enough insightful Macintosh news, sign up for a free, no-obligation, three-week trial subscription to MWJ in time for their Mac OS 8.5 coverage, or download some free sample issues.</P><P><<A HREF="http://www.macfixit.com/reports/MacsBug.shtml">http://www.macfixit.com/reports/MacsBug.shtml</A>><BR><<A HREF="http://www.gcsf.com/pages/mwj/">http://www.gcsf.com/pages/mwj/</A>></P><!-- MacsBug for the Merely Geeky, Part Two Geoff Duncan --></div>
  723.         <div id="article_text_bottom_3809" style="display:none">
  724.         <p class="showhide_all_series"><a href="javascript:void(0)" onClick="return showhide_article('3809')">Hide full article</a></p><div class="sponsorbox">
  725. <div class="sponsortext"><A HREF="http://www.smithmicro.com/tidbits"><IMG SRC="http://db.tidbits.com/images/badges/StuffItDeluxe2010.gif" ALT="" HEIGHT="50" WIDTH="50" BORDER="0" ALIGN="left"></A>StuffIt Deluxe 2011 has everything you need to backup, encrypt,<br />share, and compress all of your photos, audio and documents.<br />Compress it. Secure it. Send it. Try StuffIt Deluxe 2011 today!<br />Click here for a free 30-day trial: <<a href="http://stuffIt.com/tidbits/">http://stuffIt.com/tidbits/</a>></div>
  726. </div>
  727. <div class="sponsorbox_bottom"> </div>
  728. </div>
  729.  
  730.         <!-- end article text -->
  731.     
  732.         
  733.  
  734.         
  735.     </div><div class="article"><a name="3823"></a>
  736.     
  737. <!-- comment initialization routine as needed -->
  738. <div class="popup_box_with_captcha" id="hc_3823" style="display: none">
  739.     <div class="tip_box_format">
  740.     <div id="hc_innards_alt_3823" style="display: none">
  741.             <div class="tbf_row">
  742.                 <div class="tbf_wide_80" id="hc_small_response_3823"></div><div class="x_close_row" id="hc_upper_right1_3823"><a href="javascript:void(0)" onmousedown="HidePopupContent('hc_3823', 'hc', '3823'); return true;">Close</a></div>
  743.  
  744.             </div>
  745.     </div>
  746.     <div id="hc_innards_3823">
  747.         <div class="tip_box_form">        
  748.             <form action="foobar.cgi" method="get" name="check_human_3823">
  749.             <div class="tbf_row">
  750.                 <div class="tbf_wide_80" id="hc_rc_3823">To help us avoid automated posts and misuse of our site, please enter the words below.</div><div class="x_close_row" id="hc_upper_right2_3823"><a href="javascript:void(0)" onmousedown="HidePopupContent('hc_3823', 'hc', '3823'); return true;">Close</a></div>
  751.  
  752.             </div>
  753.             <div class="spacer"></div>
  754.             <div class="tbf_row" id="hc_message_box_3823" style="display:none">
  755.                 <div class="tbf_wide"><div class="tbf_alert" id="hc_top_message_3823"></div></div>
  756.             </div>
  757.             <div class="spacer"></div>
  758.             <div class="tbf_row">
  759.                 <div class="tbf_wide"><div id="hc_recaptcha_3823"></div></div>
  760.             </div>
  761.             <div class="spacer"></div>
  762.             <div class="tbf_row">
  763.                 <div class="tbf_wide"><input type="submit" value="Submit" name="submit_this_tip" onClick="handle_tip_submission('hc', '3823', this.form, this.form.submit_type.value); return false;"><input name="calling_routine" type="hidden"><input type="hidden" name="getbits" value="5146"><input type="hidden" name="author_id"><input type="hidden" name="submit_type" value=""></div>
  764.             </div>
  765.             <div class="spacer"></div>
  766.             </form>
  767.         </div><!-- end tip_box_form -->
  768.     </div><!-- end hum box innards -->
  769.     </div><!-- end tip box format -->
  770. </div><!-- end tip_submit box-->
  771.  
  772.  
  773.  
  774.         
  775.         
  776.         <!-- specific article details here -->
  777.         
  778.         
  779.             <p class="series_number">Article 3 of 3 in series</p>
  780.         
  781.     
  782.         <article_link><script type="text/javascript">open_if_linked('')</script></article_link>
  783.         
  784.         <div class="featured_meta"><div class="meta_article">26 Oct 1998 | <a href="/article/5146?print_version=1">Print <span class="shift_up"><img src="/images/printer_icon.gif" alt="Printer-Friendly Version of This Article" border="0" width="9" height="10"></span></a></div></div>
  785.  
  786.         <H2><a href="/article/5146">MacsBug for the Merely Geeky, Part Three</a></H2>
  787.  
  788.         <p class="byline">by <a href="/author/Geoff%20Duncan">Geoff Duncan</a> <a href="javascript:void(0)" onClick="document.check_human_3823.submit_type.value='email'; document.check_human_3823.author_id.value='15'; ShowTipBox('hc_3823', 'hc_recaptcha_3823')"><span class="shift_down"><img src="/images/gettb_button_email.gif" height="12" width="12" border="0" alt="Send Email to Author"></span></a></P>
  789.  
  790.         <!-- article text -->
  791.         <div id="article_blurb_3823"><p>Previous parts of this article explored MacsBug, Apple's free low-level debugger. First, we covered installing MacsBug and using it to recover from application crashes - we also established MacsBug as possibly the least friendly software you'll ever encounter on a Macintosh<span class="readmore_series"><a href="javascript:void(0)" onClick="return showhide_article('3823')">Show full article</a></span></p></div>
  792.         <div id="article_text_3823" style="display:none"><p class="showhide_all_series"><a href="javascript:void(0)" onClick="return showhide_article('3823')">Hide full article</a></p><P>Previous parts of this article explored MacsBug, Apple's free low-level debugger. First, we covered installing MacsBug and using it to recover from application crashes - we also established MacsBug as possibly the least friendly software you'll ever encounter on a Macintosh. Next, we discussed common MacsBug commands that reveal detailed information about your Mac, applications, and memory, and how to make logs of problems you encounter. Although MacsBug isn't for the faint of heart, it can be useful even for people who don't program for a living.</P><P><<A HREF="http://db.tidbits.com/series/1057">http://db.tidbits.com/series/1057</A>></P><P>Now that you're familiar with MacsBug, you can put your knowledge to good use for automatically restarting crashed servers.</P><P><STRONG>Poor Man's Server Restart</STRONG> -- You may have noticed the StdLog command discussed in the second part of this article contains output from several other MacsBug commands. That's because StdLog is actually a MacsBug macro, or a sequence of other commands separated by semicolons. You can use the help command to see what commands are in a macro: type "help stdlog" to see the full expansion of the StdLog macro.</P><P>Generally, non-programmers don't need to define macros. However, MacsBug has two reserved macro names - FirstTime and EveryTime - that can be useful for people running unattended servers. If they exist, the FirstTime macro is executed when MacsBug is loaded at startup, and the EveryTime macro is executed every other time MacsBug is invoked, whether by the user or as the result of a system error. Here are some common strategies for defining these macros:</P><DL><DT>Simple restart:<DD>   FirstTime: <CODE>G</CODE><BR>       EveryTime: <CODE>RS</CODE><DT>Smarter restart:<DD>   FirstTime: <CODE>DX OFF;G</CODE><BR>   EveryTime: <CODE>STDLOG;RS</CODE></DL><P>The first example tells MacsBug to resume execution when it's invoked at system startup, then has MacsBug restart the machine in the event of a system error. The second example is identical, except that it turns off user breaks in the FirstTime macro (see the DX command, in part two of this article), and tries to make a standard log and restart the machine in the event of a system error - that way there's a record that the machine is having problems. Note that commands are separated by semicolons.</P><P><<A HREF="http://db.tidbits.com/article/05130">http://db.tidbits.com/article/05130</A>></P><P>You can use the RB command instead of RS in these macros, if you like. Be sure the last command in the FirstTime macro is G, or the Mac will never continue starting up. Also, don't end the EveryTime macro with G, or you'll never be able to get into MacsBug.</P><P>The FirstTime and EveryTime macros must be defined as permanent macros before you can use them to restart a machine. To do this, you use a resource editor like Apple's free ResEdit to define the macros and store them in a file.</P><P><<A HREF="ftp://ftp.info.apple.com/Apple_Support_Area/Apple_SW_Updates/US/Macintosh/Utilities/ResEdit_2.1.3.sea.bin">ftp://ftp.info.apple.com/Apple_Support_Area/ Apple_SW_Updates/US/Macintosh/Utilities/ ResEdit_2.1.3.sea.bin</A>></P><P>Although I can't give complete instructions about using ResEdit in this article, here are the steps for creating these macros:</P><UL><LI><P>Make a copy of MacsBug. (You can throw it away later.)</P><LI><P>Using ResEdit, create a new, empty file, naming it clearly. (Mine is called "MacsBug Cheapo Restart".)</P><LI><P>Leaving your new file open, use ResEdit to open the copy of MacsBug. Find and open the TMPL resources, select the mxbm resource (it should be the first one listed), then choose Copy from the Edit menu.</P><LI><P>Paste the mxbm template into your empty file, then close the copy of MacsBug. The only file ResEdit should have open now is your new file.</P><LI><P>Choose Create New Resource from the Resource menu. You can either type mxbm (all lowercase) or select mxbm from the scrolling list, then click OK. ResEdit creates the new resource and immediately opens it for editing.</P><LI><P>Click the resource entry, 1) *****, then choose Insert New Field(s) from the Resource menu.</P><LI><P>In the Macro name box, type FirstTime. In the Expansion box, type your FirstTime macro. (You can just type the letter G for now - you can always edit this later with ResEdit.)</P><LI><P>Click the second entry, 2) *****, and choose Insert New Field(s) from the Resource menu.</P><LI><P>In the Macro name box, type EveryTime. In the Expansion box, type your EveryTime macro. (Again, you can just type RS for now, and change it later if you like.)</P><LI><P>Choose Save from the File menu, and quit ResEdit.</P><LI><P>Move the file to the MacsBug Preferences folder inside your System Folder's Preferences folder. It will probably be the only file in that folder.</P><LI><P>You're done! The macros will start working when you restart the machine. If you want to disable them, move the file out of the MacsBug Preferences folder and restart.</P></UL><P><STRONG>Beyond Merely Geeky</STRONG> -- I still won't pretend that using MacsBug is for everyone. However, I hope you can see that its utility isn't limited to code-heads who drink too many carbonated beverages. Knowing the basics of using MacsBug can help you understand and troubleshoot software problems, which in turn makes your Mac more stable and using you Mac more productive. In the end, that's what everyone wants.</P><!-- MacsBug for the Merely Geeky, Part Three Geoff Duncan --></div>
  793.         <div id="article_text_bottom_3823" style="display:none">
  794.         <p class="showhide_all_series"><a href="javascript:void(0)" onClick="return showhide_article('3823')">Hide full article</a></p><div class="sponsorbox">
  795. <div class="sponsortext"><A HREF="http://macte.ch/conf_tidbits"><IMG SRC="http://db.tidbits.com/images/badges/mactech-twitter-icon-48x48.jpg" ALT="" HEIGHT="50" WIDTH="50" BORDER="0" ALIGN="left"></A>MacTech Conference, for IT Pros and Apple developers, is Nov 3-5,<br />in Los Angeles. The 3-day event is packed with sessions & evening<br />activities. Learn from the best. Meet and spend time with peers.<br />TidBITS readers save $50 at <<a href="http://macte.ch/conf_tidbits">http://macte.ch/conf_tidbits</a>>!</div>
  796. </div>
  797. <div class="sponsorbox_bottom"> </div>
  798. </div>
  799.  
  800.         <!-- end article text -->
  801.     
  802.         
  803.  
  804.         
  805.     </div><!-- end show article -->
  806.     
  807.     
  808.     <p class="showhide_all_series"><a href="javascript:void(0)" onClick="return showhide_all_articles('3797,3809,3823')"><span id="showhide_arts_bottom">Show the full text of all articles</span></a>
  809.  
  810.  
  811. <!-- article_plus end -->
  812. <!--
  813. </DIV>
  814. --><!-- end main_column DIV -->
  815.  
  816.  
  817. <!-- google_ad_section_end -->
  818.  
  819. </div><!-- end center AJAX insert -->
  820.  
  821. <!-- TipBITS Search Results Lozenge -->
  822. <div id="tipbits_results_loz" style="display:none">
  823. <form method="post" onsubmit="return false" id="tipbits_form_loz" name="tipbits_form_loz" action="noaction.cgi">
  824. <div class="tip_footer">
  825. <p id="search_tipbits_loz"><input type="text" onkeydown="if (event.keyCode == 13) { search_tipbits('tipbits_searchvalue_loz', 'tipbits_results_loz'); }" id="tipbits_searchvalue_loz" name="tipbits_searchvalue_loz"> <a href="javascript:void(0)" onClick="search_tipbits('tipbits_searchvalue_loz', 'tipbits_results_loz')">Search</a></p>
  826. </div>
  827. <div class="tip_footer_bottom">
  828.  </div>
  829. </form>
  830. </div><!-- end TipBITS Search Results lozenge -->
  831.  
  832.  
  833.  
  834.  
  835. <!-- begin footer -->
  836. <div id="footer">
  837.  
  838.  
  839. <p>Special thanks to <a href="http://www.forest.net/">digital.forest</a>, our
  840. Web and mailing list host.</p>
  841.  
  842. <p>TidBITS is copyright © 2010 TidBITS Publishing Inc.</p>
  843. <p>Reuse governed by <a href="http://www.tidbits.com/terms/">Creative Commons License</a>.</p>
  844.  
  845. <p><a href="/about.html" title="About TidBITS">About TidBITS</a> | <a href="/account.html" title="Account Help">Account Help</a> | <a href="/advertising.html" title="Advertise with TidBITS!">Advertise with TidBITS!</a> | <a href="/contact.html" title="Contact Info">Contact Info</a> | <a href="/copyright.html" title="Copyright Terms">Copyright Terms</a></p>
  846.  
  847. </div><!-- end footer -->
  848.  
  849.  
  850. </div> <!-- end centercolumn -->
  851.  
  852. <div class="center_bottom"> </div>
  853.  
  854. </div> <!-- end centercolumn_border -->
  855.  
  856.  
  857. </div> <!-- end content_container -->
  858.  
  859. </div> <!-- end mainbody -->
  860.  
  861.  
  862. <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
  863. </script>
  864. <script type="text/javascript">
  865. _uacct = "UA-276924-3";
  866. urchinTracker();
  867. </script>
  868. <script type="text/javascript"
  869. src="http://tidbitscom.skimlinks.com/api/skimlinks.js"></script>
  870. <script type="text/javascript">
  871. var skimlinks_pub_id = '2559X585851';
  872. var skimlinks_domain = 'go.tidbits.com';
  873. skimlinks();
  874. </script>
  875. </body>
  876. </html>
  877.  
  878.