User Tools

Site Tools


unix:osx:skype5_gdb

For some reason the Skype 5 for the Mac release has a minimum window height and width. It's very clearly un-liked by the masses, including myself. I have no idea of the legality or license breach or whatnot of running Skype in a debugger, but since there's no decompilation necessary to do this, I can't see the harm.

This is a very manual process. The window minimum height annoys me to such a degree that I'm willing to do this every time I start Skype (not very frequently though I use it every day).

Major Caveats:

  • Skype 5 is not designed to be run this way, so the GUI suffers with smaller windows sizes.
  • The process is manual and needs to be run every time you use Skype, I haven't bothered to try to automate it though I'm sure one can
  • The gdb debugger must already be installed on your mac (google it)

To run Skype 5 without the minimum window size, the steps are:

  1. Open Terminal
  2. enter: gdb /Applications/Skype.app/Contents/MacOS/Skype
  3. wait for the “(gdb)” prompt
  4. enter: b -[NSWindow setMinSize:] and answer “y” to any questions
  5. enter: b -[NSWindow setContentMinSize:] and answer “y” to any questions
  6. enter: r
  7. when greeted with “Breakpoint 1, 0x90a34f6d in -[NSWindow setMinSize:] ()”, enter: ret
  8. when greeted with “Make selected stack frame return now? (y or n)” enter: y
  9. enter: c
  10. when greeted with “Breakpoint 2, 0x90990fda in -[NSWindow setContentMinSize:] ()” enter: ret
  11. when greeted with “Make selected stack frame return now? (y or n)” enter: y
  12. enter: c
  13. when greeted with “Breakpoint 1, 0x90a34f6d in -[NSWindow setMinSize:] ()”, enter: ret
  14. when greeted with “Make selected stack frame return now? (y or n)” enter: y
  15. enter: c
  16. Enjoy Skype 5 with a completely resizable window

Below are my original notes, they are not complete, readable, or coherent:

NOTES:


r = run
bt = backtrace /show the stack
info functions setContentMinSize  - gets address for the set window size function, or other...
info functions set.*Size - get all functions that have set ... Size
info functions NS.*set.*MinSize
info frame - information about current frame in stack

b *0x90990fc8 - set a breakpoint at a function address (from info functions)
x/10i 0x90990fc8 - show next 10 instructions NOTE no * in the address...
x/10i - show next ten instructions
si (step single instruction including function calls)
ni (step single instruction don't include function calls)
return (return immediately from function)

Action:

Find all functions that set the MinSize: info functions NSW.*set.*MinSize

(gdb) info functions NSW.*set.*MinSize
All functions matching regular expression "NSW.*set.*MinSize":

Non-debugging symbols:
0x90990fc8  -[NSWindow setContentMinSize:]
0x90a34f5b  -[NSWindow setMinSize:]
0x90f3ac9b  -[NSWindowTemplate setMinSize:]
0x90f3ad8e  -[NSWindowTemplate setContentMinSize:]

Set a break for each of those:
b *0x90990fc8
b *0x90a34f5b
b *0x90f3ac9b
b *0x90f3ad8e

maybe write a "ret" at 0x90a34f5b?  if only I could find this call in the actual disassembled code (i can't).

There are two calls for setMinSize and one for setContentMinSize.  Apparently all three need to be skipped.  Break on the addresses, and type "ret" to skip their work.

To find out what is calling them, break on the calling function address after checking with 'bt'.

(gdb) bt 2
#0  0x90a34f5b in -[NSWindow setMinSize:] ()
#1  0x9092facd in -[NSWindowTemplate nibInstantiate] ()
(More stack frames follow...)

(gdb) b *0x9092facd
Breakpoint 14 at 0x9092facd
(gdb) 

sudo port install binutils (which gets us objdump)

Breakpoint 2, 0x90a34f5b in -[NSWindow setMinSize:] ()
(gdb) ret
Make selected stack frame return now? (y or n) y
#0  0x9092facd in -[NSWindowTemplate nibInstantiate] ()
(gdb) c
Continuing.

Breakpoint 1, 0x90990fc8 in -[NSWindow setContentMinSize:] ()
(gdb) ret
Make selected stack frame return now? (y or n) y 
#0  0x9092fcac in -[NSWindowTemplate nibInstantiate] ()
(gdb) c
Continuing.

Breakpoint 2, 0x90a34f5b in -[NSWindow setMinSize:] ()
(gdb) ret
Make selected stack frame return now? (y or n) y
#0  0x00160c78 in ?? ()
(gdb) c
Continuing.
unix/osx/skype5_gdb.txt · Last modified: 2013/03/19 05:28 by ben