Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > How to remove your debug code!

How to remove your debug code!
Thread Tools
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
Sep 16, 2003, 05:09 AM
 
Make sure to read all of these instructions before following them!
Step 1: Log in as an admin user.
Explanation: You will need to edit the actual kernel of the OS, which requires admin privileges.
Step 2: Open Terminal
Explanation: The "strip" program, which you are going to use, is commandline-only.
Step 3: Enter the command "sudo strip /mach_kernel" and then, when prompted, your password.
Explanation: From the "strip" man page:
strip removes or modifies the symbol table attached to the output of the assembler and link editor. This is useful to save space after a program has been debugged and to limit dynamically bound symbols.
Step 4: Now that you have carefully read all the instructions before following any of them, do not follow any (except this one).
Explanation: strip really will remove the "debug symbols" from your kernel, reducing its size and making it run faster - but extensions and the IOKit require those symbols to link to the kernel at runtime, and stripping mach_kernel will render your system unbootable.
Unbootable... but sans debug code! Finally!
[vash:~] banana% killall killall
Terminated
     
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
Sep 16, 2003, 05:30 AM
 
Ahahahaha!
[Wevah setPostCount:[Wevah postCount] + 1];
     
Addicted to MacNN
Join Date: Oct 2001
Location: BFE
Status: Offline
Reply With Quote
Sep 16, 2003, 06:14 AM
 
...Unbootable... but sans debug code! Finally!
I can do that just by deleting the kernel all together.

I'm a bird. I am the 1% (of pets).
     
Mac Elite
Join Date: Sep 2001
Location: The Land of Beer and Chocolates
Status: Offline
Reply With Quote
Sep 16, 2003, 10:15 AM
 
Good thing you didn't post these instructions in the Software forum, it might have turned out to be a worthy sudo rm debacle successor
     
Mac Enthusiast
Join Date: Jul 2002
Status: Offline
Reply With Quote
Sep 16, 2003, 06:14 PM
 
On a more serious note,

there is a difference between debug code, debug symbols, debug resources, and unoptimized code.

Apple isn't totally stupid, usually. They remove the first two. They seem to miss the third one quite often. They are slowly improving on the fourth.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:30 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2