TweetFollow Us on Twitter

Aug 99 Factory Floor

Volume Number: 15 (1999)
Issue Number: 8
Column Tag: From the Factory Floor

Richard Atwell, Mac OS Debugger

by Richard Atwell and Dave Mark, ©1999 by Metrowerks, Inc., all rights reserved.

This month, we'll hear from Richard Atwell, a key member of Metrowerks' Debugger team. Richard will fill us in on the latest and greatest in Macintosh CodeWarrior debugging.

Richard Alexander David Atwell, aka ratwell, is the Mac OS Debugger Engineer at Metrowerks and is responsible for making MetroNub do nasty things to Mac OS so you can debug your code. Before joining Metrowerks, Richard worked for the Apple Education Consultant Program in Canada. He can be reached at <ratwell@metrowerks.com>.

Dave: Richard, tell me about your role at Metrowerks?

Richard: I work on Mac OS Debugging along with Ken Ryall, our Debugger Architect and our Java debugger engineers. Ken and I are responsible for adding support in CodeWarrior's integrated debugger for emerging Mac OS technologies.

Dave: I know you are working on the debugger for Mac OS X. Tell me about that.

Richard: CodeWarrior runs on Mac OS, Windows, Solaris and now Linux. Before we could deliver a version that ran on Mac OS X, developers needed to be able to debug applications that ran on the new operating system. At the time, the only remote debugger that we had was the Mac->Win debugger that lets you debug targets that run on a Win32 machine from a Mac running the IDE, but there wasn't much that we could reuse for the new OS. So with help from Apple we decided to leverage the debugger built into Mac OS X called gdb.

gdb is the command line debugging tool that is indigenous to UNIX based operating systems like Mac OS X. We discovered that NeXT/Apple had been modifying gdb over the years to meet their own needs but had kept it up to date with the open-source gdb version. All that we needed to do was hide the gdb command line interface from the developer and allow it to be controlled from the IDE.

With Apple's assistance we created a remote debugger for CodeWarrior running on Mac OS 8 that allows you to debug applications on a second Mac running Mac OS X over TCP/IP. gdb is running behind the scenes on Mac OS X but all the developer sees is a simple control panel like application that allows you to set the IP address and port of the machine that is running the IDE and a button to start/stop gdb.

Dave: Tell me about the new Mac OS 8 remote debugger? Is it similar to what Metrowerks did with the Mac->Win cross debugger?

Richard: Yes. For Windows we have an application called MWRemote that is run on the target machine and it acts as the middleman between the IDE running on the host Mac and Windows where your target runs.

For Mac->Mac debugging, we needed to write a similar application to run on the target machine. On the Pro 5 Tools CD in the "Other Metrowerks Tools" folder you'll find an application called MetroNub Remote 2.0. By running this application on a second Mac that has the MetroNub extension installed, you can debug applications remotely.

To operate it, run MetroNub Remote 2.0 and configure it with an IP address and port. This is a necessary security precaution to prevent "unfriendly" IDEs from debugging and essentially running programs on your Mac. Once the remote machine is setup, you configure the IDE for remote debugging by entering an IP address and port in the MetroNub settings preference panel. You next specify the path on the remote machine where the target is to be executed from and you're ready to debug the application just as you would if it were running on the same machine as the IDE.

Dave: What's new with Pro 5's integrated debugger?

Richard: We've added a lot of value to the debugger with Pro 5. The debugger in the IDE has an improved variables view that is better at displaying variable values for the supported languages. There is also a new widget at the top that toggles between two new variable modes: All and Auto. When the widget is toggled from All to Auto the view displays only the variables that are in the scope of the statement block where the program counter lies. Before we added this it was often awkward having to scroll the view down to the bottom to see the variables that you were interested in.

Remote debugging support for Mac OS 8 and Mac OS X is a large addition as we've already mentioned. Remote debugging is advantageous when you are short of screen real estate, wish to debug a system version earlier than the one you usually develop on, debug on another OS, or simply wish to stay independent of the program crashes that can interrupt your development cycle.

Dave: How about remote Java debugging?

Richard: Remote debugging of Java is now possible with Pro 5. In previous releases the MetroNub plug-in was used to debug Mac OS and Java programs. With Pro 5 our Java engineers have created a new debugger plug-in called SunJavaPlugin which uses the debugging facilities built-into Apple's MRJ. Debugging is done over TCP/IP when debugging on a local machine so making it work in the remote case required little extra development effort.

Dave: Is it possible to debug Java on other platforms?

Richard: Yes. Any Java VM that supports Sun's debugger API can be debugged remotely as long as both machines have TCP/IP services. We've also implemented a remote debugger for Win32 that lets you debug from one Win32 machine to another for the first time.

Dave: Aside from remote debugging, what else is new?

Richard: There is now an ability to control whether or not to attempt to automatically debug libraries that your program links against. There is a global setting for this that is used when there isn't a target, such as when you attach to an already running process. There is also a target-level setting to control this behavior.

We've changed the Debugger Setting panel that appears when you edit the preferences of your target. The field which previously specified the location of the host application has been changed to include the location of the remote folder where targets will execute from and also to include the location where code resources, shared libraries or DLLs that are used by your target can be found. The host application field has been relocated to a new panel called Runtime Settings.

We've also improved the reporting of libraries that are loaded by your application. You can now toggle whether the display of library loading messages appear in the log window with a checkbox. Previously this checkbox only applied if you were using the Mac->Win cross debugger.

To improve the debugging experience, there we've added a setting for a delay that can be adjusted which tells the IDE how often to refresh the contents of windows while you are debugging. This can also be set in the Debugger Settings panel.

Dave: How about Mac OS X and Carbon?

Richard: Mac OS X and Carbon are the hot programming topics today. Mac OS X has been making small leaps for about a year now and we've been making similar progress in order to keep from developing solutions with a short life span.

Our ultimate goal is to provide a Carbonized IDE that runs on the client version of Mac OS X. In the meantime we've been providing tools in staged releases.

Dave: What's been done for Carbon developers?

Richard: Carbon is Apple's programming model for Mac OS 8 and Mac OS X that allows developers to leverage the Mac OS toolbox based code they have developed over the last several years. Carbon is the only programming model on Mac OS X that doesn't require developers to completely rewrite their code. This makes Carbon very attractive to developers and we believe that CodeWarrior users are going to choose this development path over the others for most of their development needs.

Towards filling this demand we've been creating the tools that our customers require as the evolving Mac OS X technology allows us.

The first step we took was to release compiler and linker plug-ins with Pro 4 that created binaries in the Mac OS X native Mach-O execution. You could use these to create a separate target in your project that generated a Mach-O binary with which you could move over to Mac OS X and then debug it using gdb.

With the release of Mac OS X PR1 at WWDC this year, Pro 5 took the next logical step and made it possible to use the CodeWarrior integrated debugger for debugging applications on Mac OS X via remote debugging.

The Mac OS X remote debugger setup was specifically designed for debugging Carbon applications. Carbon applications can be PEF based just as they are now for Mac OS 8 or Mach-O based for Mac OS X. If you make applications that are PEF based using the Mac OS PPC Linker instead of the Mach-O linker, you can develop using a single target that you can then debug on Mac OS 8 or remotely on Mac OS X or Mac OS 8. If you app uses shared libraries for plug-ins or for code separation you'll have stick with PEF because Mach-O uses a different scheme for shared libraries that isn't supported by our debugger.

Dave: What's the word on AltiVec support?

Richard: AltiVec is an extension to the PowerPC architecture that provides 32 new 128-bit registers, 162 new instructions and a new execution unit within the AltiVec processor itself to complement the Branch, Integer and Floating Point units.

In addition, Apple and Motorola have introduced an AltiVec programming model for Mac developers in the form of an extension to the C language to support a new variable type called vector.

We've added the language support to our C/C++ compilers and added the necessary ABI changes to the linker. To the debugger, we've added support for displaying vectors variables just as we display any other type and we've added a third register window. Because AltiVec registers as so wide we've implemented a scrolling window to preserve screen real estate.

Dave: What's coming down the road?

Richard: Apple has revisited multi-processing with the introduction of Mac OS 8.6 using the MP hardware introduced a few years ago. For several releases we've had a version of MetroNub that was specifically designed for debugging MP tasks called "MetroNub for MP". Apple has dramatically changed their MP implementation with version 2.0 of the "Multiprocessing API Library" in Mac OS 8.6 and, as a result, the version of MetroNub for MP that shipped with Pro 5 is only compatible with MacOS 8.5.1 and earlier.

We're updating MetroNub for MP to support the new and improved MP library and the update will be available soon.

We're also planning to merge the two versions of MetroNub together. We originally split the extension into two separate versions because the old MP Library 1.4 had a huge memory overhead. Since the new library has a very low overheard of only 100K or so, we can merge the two versions together again. The merged extension will support MP debugging only on Mac OS 8.6 or later. If you want to debug MP Tasks on older versions of the OS, you can still use previous versions of CodeWarrior.

Another request that we've been listening to is to allow remote debugging of Mac applications from the IDE running on Win32 machines. After adding Win->Win and Mac->Mac debugging in Pro 5, we're now working on Win->Mac debugging for the next release. We hope this will encourage Windows developers to port their applications to Mac OS.

Dave: Any other changes on the CodeWarrior CDs?

Richard: We cleaned up the Mac OS Support folder by removing headers and libraries that belong to obsolete SDKs. We've also improved the layout by prominent placement of the OpenTransport and Universal folder that Apple provides. When new versions of these headers and libraries appear between CodeWarrior releases you'll easily be able to replace or add the new headers without having to walk the Mac OS Support folder hierarchy looking for the files that need to be removed.

We've also updated the MPW folder to the latest Tools CD from Apple and of course we've included versions of our MPW tools in that folder.

Finally, we've added a Sherlock index to the reference CD so all HTML and text documents have been searched along with the example code.
 
AAPL
$96.03
Apple Inc.
+0.43
MSFT
$43.16
Microsoft Corpora
+0.00
GOOG
$572.46
Google Inc.
+0.86

MacTech Search:
Community Search:

Software Updates via MacUpdate

Adobe Lightroom 5.6 - Import, develop, a...
Adobe Lightroom software helps you bring out the best in your photographs, whether you're perfecting one image, searching for ten, processing hundreds, or organizing thousands. Create incredible... Read more
OneNote 15.2 - Free digital notebook fro...
OneNote is your very own digital notebook. With OneNote, you can capture that flash of genius, that moment of inspiration, or that list of errands that’s too important to forget. Whether you’re at... Read more
iStat Menus 4.22 - Monitor your system r...
iStat Menus lets you monitor your system right from the menubar. Included are 8 menu extras that let you monitor every aspect of your system. Some features: CPU -- Monitor cpu usage. 7 display... Read more
Ember 1.8 - Versatile digital scrapbook....
Ember (formerly LittleSnapper) is your digital scrapbook of things that inspire you: websites, photos, apps or other things. Just drag in images that you want to keep, organize them into relevant... Read more
OmniPlan 2.3.6 - Robust project manageme...
With OmniPlan, you can create logical, manageable project plans with Gantt charts, schedules, summaries, milestones, and critical paths. Break down the tasks needed to make your project a success,... Read more
Command-C 1.1.1 - Clipboard sharing tool...
Command-C is a revolutionary app which makes easy to share your clipboard between iOS and OS X using your local WiFi network, even if the app is not currently opened. Copy anything (text, pictures,... Read more
Knock 1.1.7 - Unlock your Mac by knockin...
Knock is a faster, safer way to sign in. You keep your iPhone with you all the time. Now you can use it as a password. You never have to open the app -- just knock on your phone twice, even when it's... Read more
Mellel 3.3.6 - Powerful word processor w...
Mellel is the leading word processor for OS X and has been widely considered the industry standard since its inception. Mellel focuses on writers and scholars for technical writing and multilingual... Read more
LibreOffice 4.3.0.4 - Free Open Source o...
LibreOffice is an office suite (word processor, spreadsheet, presentations, drawing tool) compatible with other major office suites. The Document Foundation is coordinating development and... Read more
Freeway Pro 7.0 - Drag-and-drop Web desi...
Freeway Pro lets you build websites with speed and precision... without writing a line of code! With it's user-oriented drag-and-drop interface, Freeway Pro helps you piece together the website of... Read more

Latest Forum Discussions

See All

Train Your Own Dragon in DreamWorks’ Fir...
Train Your Own Dragon in DreamWorks’ First Story App – Dreamworks Press: Dragons Posted by Jessica Fisher on August 1st, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »
Dream Revenant Review
Dream Revenant Review By Lee Hamlet on August 1st, 2014 Our Rating: :: WATCH OUT FOR BED BUGSUniversal App - Designed for iPhone and iPad Dream Revenant takes players on a journey through a man’s subconscious. And though it’s full... | Read more »
Dawn of the Immortals Review
Dawn of the Immortals Review By Jennifer Allen on July 31st, 2014 Our Rating: :: RESPECTABLE EXPLORATIONUniversal App - Designed for iPhone and iPad Dawn of the Immortals might not re-invent the wheel, but it does tweak it a little... | Read more »
80 Days Review
80 Days Review By Jennifer Allen on July 31st, 2014 Our Rating: :: EPIC ADVENTUREUniversal App - Designed for iPhone and iPad A fantastic and fascinating re-envisioning of the classic novel by Jules Verne, 80 Days is a delightful... | Read more »
Battleheart Legacy Guide
The world of Battleheart Legacy is fun and deep; full of wizards, warriors, and witches. Here are some tips and tactics to help you get the most enjoyment out of this great game. | Read more »
Puzzle Roo Review
Puzzle Roo Review By Jennifer Allen on July 31st, 2014 Our Rating: :: PUZZLE-BASED TWISTUniversal App - Designed for iPhone and iPad A different take on the usual block dropping puzzle game, Puzzle Roo is quite pleasant.   | Read more »
Super Crossfire Re-Release Super Crossfi...
Super Crossfire Re-Release Super Crossfighter Coming Soon, Other Radiangames Titles Go 50% Off Posted by Ellis Spice on July 31st, 2014 [ | Read more »
Hexiled Review
Hexiled Review By Rob Thomas on July 31st, 2014 Our Rating: :: HEX SELLSUniversal App - Designed for iPhone and iPad In space, no one can hear you… spell? Hexiled is a neat concept for a word scramble puzzle, but it doesn’t go too... | Read more »
Summoners War: Sky Arena Passes 10 Milli...
Summoners War: Sky Arena Passes 10 Million Installs! Posted by Jessica Fisher on July 31st, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »
Deep Loot Review
Deep Loot Review By Jennifer Allen on July 31st, 2014 Our Rating: :: DIVE DEEPUniversal App - Designed for iPhone and iPad Dive deep in this fun explore-em-up that’s a little grind heavy but ultimately quite entertaining.   | Read more »

Price Scanner via MacPrices.net

13-inch MacBook Airs on sale for $100 off MSR...
B&H Photo has the new 2014 13″ MacBook Airs on sale $100 off MSRP. Shipping is free, and B&H charges NY sales tax only. They also include free copies of Parallels Desktop and LoJack for... Read more
16GB iPad Air on sale for $399, save $100
Best Buy is offering the 16GB WiFi iPad Air for $399.99 on their online store for a limited time. Their price is $100 off MSRP. Choose free shipping or free store pickup (if available). Price is for... Read more
All Over For Tablets Or Just A Maturing, Evol...
CNN’s David Goldman weighs in on tablet sector doom and gloom, asking rhetorically: “Is this the beginning of the end for the tablet?” Answering that, he contends that hysteria and panic are... Read more
Letterspace 1.0.1 – New Free iOS Text Editor...
Bangkok, Thailand based independent developer Sittipon Simasanti has released Letterspace, a new text editor for iPhone, iPad, and iPod touch devices. Letterspace is a note taking app with an... Read more
Save up to $130 on an iPad mini with Apple re...
The Apple Store has Certified Refurbished 2nd generation iPad minis with Retina Displays available for up to $130 off the cost of new models, starting at $339. Apple’s one-year warranty is included... Read more
iPad Cannibalization Threat “Overblown”
Seeking Alpha’s Kevin Greenhalgh observes that while many commentators think Apple’s forthcoming 5.5-inch panel iPhone 6 will cannibalize iPad sales, in his estimation, these concerns are being... Read more
Primate Labs Releases July 2014 MacBook Pro P...
Primate Labs’ John Poole has posted Geekbench 3 results for most of the new MacBook Pro models that Apple released on Tuesday. Poole observes that overall performance improvements for the new MacBook... Read more
Apple Re-Releases Bugfixed MacBook Air EFI Fi...
Apple has posted a bugfixed version EFI Firmware Update 2.9 a for MacBook Air (Mid 2011) models. The update addresses an issue where systems may take longer to wake from sleep than expected, and... Read more
Save $50 on the 2.5GHz Mac mini, plus free sh...
B&H Photo has the 2.5GHz Mac mini on sale for $549.99 including free shipping. That’s $50 off MSRP, and B&H will also include a free copy of Parallels Desktop software. NY sales tax only. Read more
Save up to $140 on an iPad Air with Apple ref...
Apple is offering Certified Refurbished iPad Airs for up to $140 off MSRP. Apple’s one-year warranty is included with each model, and shipping is free. Stock tends to come and go with some of these... Read more

Jobs Board

*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
Sr. Product Leader, *Apple* Store Apps - Ap...
**Job Summary** Imagine what you could do here. At Apple , great ideas have a way of becoming great products, services, and customer experiences very quickly. Bring Read more
Sr Software Lead Engineer, *Apple* Online S...
Sr Software Lead Engineer, Apple Online Store Publishing Systems Keywords: Company: Apple Job Code: E3PCAK8MgYYkw Location (City or ZIP): Santa Clara Status: Full Read more
Sr Software Lead Engineer, *Apple* Online S...
Sr Software Lead Engineer, Apple Online Store Publishing Systems Keywords: Company: Apple Job Code: E3PCAK8MgYYkw Location (City or ZIP): Santa Clara Status: Full Read more
*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.