100% found this document useful (2 votes)
421 views

Instant Download Advanced Apple Debugging and Reverse Engineering Second Edition Derek Selander PDF All Chapters

Selander

Uploaded by

kobergsideeg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
421 views

Instant Download Advanced Apple Debugging and Reverse Engineering Second Edition Derek Selander PDF All Chapters

Selander

Uploaded by

kobergsideeg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Experience Seamless Full Ebook Downloads for Every Genre at textbookfull.

com

Advanced Apple Debugging and Reverse Engineering


Second Edition Derek Selander

https://textbookfull.com/product/advanced-apple-debugging-
and-reverse-engineering-second-edition-derek-selander/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Advanced Apple Debugging Reverse Engineering Third Edition


Derek Selander

https://textbookfull.com/product/advanced-apple-debugging-reverse-
engineering-third-edition-derek-selander/

textboxfull.com

Designed by Apple In California 1st Edition Apple

https://textbookfull.com/product/designed-by-apple-in-california-1st-
edition-apple/

textboxfull.com

Bioinspiration and Biomimicry in Chemistry Reverse


Engineering Nature 1st Edition Gerhard Swiegers

https://textbookfull.com/product/bioinspiration-and-biomimicry-in-
chemistry-reverse-engineering-nature-1st-edition-gerhard-swiegers/

textboxfull.com

NGINX Cookbook: Advanced Recipes for High Performance Load


Balancing 1st Edition Derek Dejonghe

https://textbookfull.com/product/nginx-cookbook-advanced-recipes-for-
high-performance-load-balancing-1st-edition-derek-dejonghe/

textboxfull.com
NGINX Cookbook: Advanced Recipes for High-performance Load
Balancing 3rd Edition Derek Dejonghe

https://textbookfull.com/product/nginx-cookbook-advanced-recipes-for-
high-performance-load-balancing-3rd-edition-derek-dejonghe/

textboxfull.com

Apple Watch Book Coll.

https://textbookfull.com/product/apple-watch-book-coll/

textboxfull.com

Functional Reverse Engineering of Machine Tools 1st


Edition Wasim Ahmed Khan (Editor)

https://textbookfull.com/product/functional-reverse-engineering-of-
machine-tools-1st-edition-wasim-ahmed-khan-editor/

textboxfull.com

Reverse Engineering the Mind Consciously Acting Machines


and Accelerated Evolution 1st Edition Florian Neukart
(Auth.)
https://textbookfull.com/product/reverse-engineering-the-mind-
consciously-acting-machines-and-accelerated-evolution-1st-edition-
florian-neukart-auth/
textboxfull.com

Advanced Engineering and Technology III Proceedings of the


3rd Annual Congress on Advanced Engineering and Technology
1st Edition Liquan Xie
https://textbookfull.com/product/advanced-engineering-and-technology-
iii-proceedings-of-the-3rd-annual-congress-on-advanced-engineering-
and-technology-1st-edition-liquan-xie/
textboxfull.com
Advanced Apple Debugging

Advanced Apple Debugging & Reverse Engineering


Derek Selander

Copyright ©2017 Razeware LLC.

Notice of Rights
All rights reserved. No part of this book or corresponding materials (such as text,
images, or source code) may be reproduced or distributed by any means without prior
written permission of the copyright owner.

Notice of Liability
This book and all corresponding materials (such as source code) are provided on an “as
is” basis, without warranty of any kind, express of implied, including but not limited to
the warranties of merchantability, fitness for a particular purpose, and
noninfringement. In no event shall the authors or copyright holders be liable for any
claim, damages or other liability, whether in action of contract, tort or otherwise,
arising from, out of or in connection with the software or the use of other dealing in the
software.

Trademarks
All trademarks and registered trademarks appearing in this book are the property of
their own respective owners.

raywenderlich.com 2
Advanced Apple Debugging

Dedications
"I would like to thank my wife, Brittany, for all her love and support
while I silently wept in the fetal position trying to get this book out
the door"

— Derek Selander

raywenderlich.com 3
Advanced Apple Debugging

About the author


Derek Selander is the author of this book. His interest with
debugging grew when he started exploring how to make (the now
somewhat obsolete) Xcode plugins and iOS tweaks on his jailbroken
phone, both of which required exploring and augmenting programs
with no source available. In his free time, he enjoys pickup soccer,
guitar, and playing with his two doggies, Jake & Squid.

About the editors


Chris Belanger is the editor of this book. Chris Belanger is the Book
Team Lead and Lead Editor for raywenderlich.com. If there are words
to wrangle or a paragraph to ponder, he‘s on the case. When he kicks
back, you can usually find Chris with guitar in hand, looking for the
nearest beach, or exploring the lakes and rivers in his part of the
world in a canoe.

Matt Galloway is a software engineer with a passion for excellence.


He stumbled into iOS programming when it first was a thing, and has
never looked back. When not coding, he likes to brew his own beer.

Darren Ferguson is the final pass editor of this book. He is a


Software Developer, with a passion for mobile development, for a
leading systems integration provider based out of Northern Virginia
in the D.C. metro area. When he's not coding, you can find him
enjoying life with his wife and daughter trying to travel as much as
possible.

raywenderlich.com 4
Advanced Apple Debugging

Table of Contents: Overview


Introduction ............................................................. 15
Section I: Beginning LLDB Commands .............. 20
Chapter 1: Getting Started ............................... 21
Chapter 2: Help & Apropos.............................. 36
Chapter 3: Attaching with LLDB ...................... 41
Chapter 4: Stopping in Code ........................... 48
Chapter 5: Expression ..................................... 66
Chapter 6: Thread, Frame & Stepping
Around .............................................................. 80
Chapter 7: Image ............................................. 90
Chapter 8: Persisting & Customizing
Commands ..................................................... 105
Chapter 9: Regex Commands ........................ 110
Section II: Understanding Assembly................. 119
Chapter 10: Assembly Register Calling
Convention ..................................................... 120
Chapter 11: Assembly & Memory ................... 141
Chapter 12: Assembly and the Stack ............ 157
Section III: Low Level ........................................ 178
Chapter 13: Hello, Ptrace ............................... 179

raywenderlich.com 5
Advanced Apple Debugging

Chapter 14: Dynamic Frameworks ................ 189


Chapter 15: Hooking & Executing Code
with dlopen & dlsym ...................................... 203
Chapter 16: Exploring and Method
Swizzling Objective-C Frameworks .............. 220
Section IV: Custom LLDB Commands .............. 242
Chapter 17: Hello Script Bridging .................. 243
Chapter 18: Debugging Script Bridging ........ 253
Chapter 19: Script Bridging Classes and
Hierarchy ........................................................ 268
Chapter 20: Script Bridging with Options &
Arguments...................................................... 288
Chapter 21: Script Bridging with SBValue &
Memory .......................................................... 314
Chapter 22: SB Examples, Improved
Lookup ........................................................... 339
Chapter 23: SB Examples, Resymbolicating
a Stripped ObjC Binary .................................. 356
Chapter 24: SB Examples, Malloc Logging ... 372
Section V: DTrace ............................................. 397
Chapter 25: Hello, DTrace ............................. 398
Chapter 26: Intermediate DTrace .................. 417
Chapter 27: DTrace vs objc_msgSend .......... 435

raywenderlich.com 6
Advanced Apple Debugging

Appendix A: LLDB Cheatsheet ...................... 463


Appendix B: Python Environment Setup ....... 470
Conclusion ............................................................ 474

raywenderlich.com 7
Advanced Apple Debugging

Table of Contents: Extended


Introduction ............................................................. 15
What you need ..................................................................................... 16
Who this book is for ............................................................................. 16
Book source code and forums ............................................................. 17
Book updates ....................................................................................... 17
Custom LLDB scripts repo ................................................................... 17
License ................................................................................................. 18
Acknowledgments ............................................................................... 19
About the cover ................................................................................... 19

Section I: Beginning LLDB Commands .............. 20


Chapter 1: Getting Started ...................................... 21
Getting around Rootless ...................................................................... 22
Attaching LLDB to Xcode .................................................................... 24
Where to go from here? ...................................................................... 35

Chapter 2: Help & Apropos .................................... 36


The "help" command ........................................................................... 37
The "apropos" command .................................................................... 39
Where to go from here? ...................................................................... 40

Chapter 3: Attaching with LLDB ............................. 41


Where to go from here?....................................................................... 47

Chapter 4: Stopping in Code ................................. 48


Signals ................................................................................................. 49
LLDB breakpoint syntax ...................................................................... 52
Finally... creating breakpoints.............................................................. 56
Where to go from here? ...................................................................... 64

Chapter 5: Expression ............................................ 66


Formatting p & po................................................................................ 67
Swift vs Objective-C debugging contexts ........................................... 71

raywenderlich.com 8
Advanced Apple Debugging

User defined variables ......................................................................... 72


Where to go from here?....................................................................... 79

Chapter 6: Thread, Frame & Stepping Around ...... 80


Stack 101 .............................................................................................. 81
Examining the stackʼs frames.............................................................. 82
Stepping .............................................................................................. 85
Examining data in the stack................................................................. 87
Where to go from here? ...................................................................... 89

Chapter 7: Image .................................................... 90


Wait... modules? .................................................................................. 91
Snooping around ................................................................................. 99
Where to go from here? ..................................................................... 104

Chapter 8: Persisting & Customizing


Commands ............................................................ 105
Persisting... how?............................................................................... 106
Creating the .lldbinit file .................................................................... 106
Command aliases with arguments..................................................... 108
Where to go from here? ..................................................................... 109

Chapter 9: Regex Commands ............................... 110


command regex .................................................................................. 111
Executing complex logic..................................................................... 112
Chaining regex inputs......................................................................... 114
Supplying multiple parameters .......................................................... 116
Where to go from here? ..................................................................... 118

Section II: Understanding Assembly................. 119


Chapter 10: Assembly Register Calling
Convention ............................................................ 120
Assembly 101 ...................................................................................... 121
x86_64 register calling convention .................................................... 123
Objective-C and registers .................................................................. 125

raywenderlich.com 9
Advanced Apple Debugging

Putting theory to practice .................................................................. 126


Swift and registers ............................................................................. 131
RAX, the return register ..................................................................... 133
Changing around values in registers ................................................. 134
Registers and SDK ............................................................................. 137
Where to go from here? ..................................................................... 139

Chapter 11: Assembly & Memory .......................... 141


Setting up the Intel-Flavored Assembly Experience™ ...................... 142
The RIP register ................................................................................. 145
Registers and breaking up the bits .................................................... 148
Breaking down the memory ............................................................... 151
Endianness... this stuff is reversed? .................................................. 154
Where to go from here? ..................................................................... 156

Chapter 12: Assembly and the Stack ................... 157


The stack, revisited ........................................................................... 158
Stack pointer & base pointer registers .............................................. 159
Stack related opcodes ....................................................................... 161
Observing RBP & RSP in action ......................................................... 163
The stack and 7+ parameters ............................................................ 170
The stack and debugging info ........................................................... 172
Stack exploration takeaways.............................................................. 175
Where to go from here? ..................................................................... 176

Section III: Low Level ........................................ 178


Chapter 13: Hello, Ptrace ...................................... 179
System calls ....................................................................................... 180
The foundation of attachment, ptrace............................................... 180
ptrace arguments .............................................................................. 182
Creating attachment issues ............................................................... 185
Getting around PT_DENY_ATTACH .................................................... 186
Other anti-debugging techniques ..................................................... 188
Where to go from here? ..................................................................... 188

raywenderlich.com 10
Advanced Apple Debugging

Chapter 14: Dynamic Frameworks ....................... 189


Why dynamic frameworks?................................................................ 190
Statically inspecting an executableʼs frameworks ............................. 190
Modifying the load commands .......................................................... 194
Loading frameworks at runtime ......................................................... 197
Exploring frameworks ........................................................................ 198
Loading frameworks on an actual iOS device .................................... 201
Where to go from here? .................................................................... 202

Chapter 15: Hooking & Executing Code with


dlopen & dlsym .................................................... 203
The Objective-C runtime vs. Swift & C ............................................. 204
Setting up your project ..................................................................... 204
Easy mode: hooking C functions....................................................... 205
Hard mode: hooking Swift methods .................................................. 213
Where to go from here? ..................................................................... 219

Chapter 16: Exploring and Method Swizzling


Objective-C Frameworks ..................................... 220
Between iOS 10 and 11 ....................................................................... 221
Sidestepping checks in prepareDebuggingOverlay .......................... 228
Introducing Method Swizzling ........................................................... 233
Where to go from here? .................................................................... 240

Section IV: Custom LLDB Commands .............. 242


Chapter 17: Hello Script Bridging ......................... 243
Credit where credit's due .................................................................. 244
Python 101 ......................................................................................... 244
Creating your first LLDB Python script ............................................. 248
Setting up commands efficiently ...................................................... 250
Where to go from here? .................................................................... 252

Chapter 18: Debugging Script Bridging ............... 253


Debugging your debugging scripts with pdb.................................... 254

raywenderlich.com 11
Advanced Apple Debugging

pdbʼs post mortem debugging .......................................................... 256


expressionʼs Debug Option................................................................ 261
How to handle problems ................................................................... 265
Where to go from here? .................................................................... 267

Chapter 19: Script Bridging Classes and


Hierarchy .............................................................. 268
The essential classes ........................................................................ 269
Learning & finding documentation on script bridging classes .......... 274
Creating the BreakAfterRegex command .......................................... 276
Where to go from here? .................................................................... 286

Chapter 20: Script Bridging with Options &


Arguments ............................................................ 288
Setting up .......................................................................................... 289
The optparse Python module ............................................................ 291
Adding options without params ......................................................... 291
Adding options with params ............................................................. 298
Passing parameters into the breakpoint callback function ............... 302
Real world example: exploring Swift return Strings with bar ............ 308
Where to go from here? ..................................................................... 313

Chapter 21: Script Bridging with SBValue &


Memory ................................................................. 314
A detour down memory layout lane ................................................... 315
SBValue ............................................................................................. 328
lldb.value ........................................................................................... 337
Where to go from here? .................................................................... 337

Chapter 22: SB Examples, Improved Lookup ...... 339


Automating script creation................................................................ 340
lldbinit directory structure suggestions ............................................ 342
Implementing the lookup command.................................................. 343
Adding options to lookup ................................................................... 351
Where to go from here? .................................................................... 354

raywenderlich.com 12
Advanced Apple Debugging

Chapter 23: SB Examples, Resymbolicating a


Stripped ObjC Binary ........................................... 356
So how are you doing this, exactly? .................................................. 357
50 Shades of Ray .............................................................................. 358
The "stripped" 50 Shades of Ray...................................................... 365
Building sbt.py .................................................................................. 368
Implementing the code ..................................................................... 369
Where to go from here? ..................................................................... 371

Chapter 24: SB Examples, Malloc Logging ......... 372


Setting up the scripts ........................................................................ 373
MallocStackLogging explained .......................................................... 374
Hunting in getenv .............................................................................. 377
Testing the functions ........................................................................ 382
Turning numbers into stack frames................................................... 387
Stack trace from a Swift object......................................................... 390
DRY Python code ............................................................................... 391
Where to go from here? .................................................................... 396

Section V: DTrace ............................................. 397


Chapter 25: Hello, DTrace .................................... 398
The bad news .................................................................................... 399
Jumping right in ................................................................................ 399
DTrace Terminology .......................................................................... 403
Learning while listing probes ............................................................ 406
A script that makes DTrace scripts ................................................... 408
Where to go from here? ..................................................................... 416

Chapter 26: Intermediate DTrace ......................... 417


Getting started .................................................................................. 418
DTrace & Swift in theory .................................................................... 418
DTrace variables & control flow ........................................................ 422
Inspecting process memory .............................................................. 426
Playing with open syscalls ................................................................ 428

raywenderlich.com 13
Advanced Apple Debugging

DTrace & destructive actions ............................................................ 430


Where to go from here? .................................................................... 433

Chapter 27: DTrace vs objc_msgSend ................ 435


Building your proof-of-concept ........................................................ 436
How to get around no probes in a stripped binary ........................... 440
Researching method calls using... DTrace! ....................................... 441
Scary assembly, part II ...................................................................... 449
Converting research into code .......................................................... 451
Limiting scope with LLDB.................................................................. 456
Fixing up the snoopie script .............................................................. 460
Where to go from here? ..................................................................... 461

Appendix A: LLDB Cheatsheet ............................ 463


Getting help ...................................................................................... 463
Finding code...................................................................................... 463
Breakpoints ....................................................................................... 464
Expressions ....................................................................................... 465
Stepping ............................................................................................ 466
GDB formatting ................................................................................. 467
Memory ............................................................................................. 467
Registers & assembly........................................................................ 468
Modules ............................................................................................ 469

Appendix B: Python Environment Setup.............. 470


Getting Python .................................................................................. 470
Python text editors ............................................................................ 470
Working with the LLDB Python module............................................. 473

Conclusion ............................................................ 474

raywenderlich.com 14
I Introduction

Debugging has a rather bad reputation. I mean, if the developer had a complete
understanding of the program, there wouldn’t be any bugs and they wouldn’t be
debugging in the first place, right?

Don’t think like that.

There are always going to be bugs in your software — or any software, for that matter.
No amount of test coverage imposed by your product manager is going to fix that. In
fact, viewing debugging as just a process of fixing something that’s broken is actually a
poisonous way of thinking that will mentally hinder your analytical abilities.

Instead, you should view debugging as simply a process to better understand a


program. It’s a subtle difference, but if you truly believe it, any previous drudgery of
debugging simply disappears.

The same negative connotation can also be applied to reverse engineering software.
Images of masked hackers stealing bank accounts and credit cards may come to mind,
but for this book, reverse engineering really is just debugging without source code —
which in turn helps you gain a better understanding of a program or system.

There's nothing wrong with reverse engineering in itself. In fact if debugging was a
game, then reverse engineering is simply debugging on the “difficult” setting — which is
quite a fun setting if you’ve been playing the game for a while. :]

In this book, you'll come to realize debugging is an enjoyable process to help you better
understand software. Not only will you learn to find bugs faster, but you’ll also learn
how other developers have solved problems similar to yours. You'll also learn how to
create custom, powerful debugging scripts that will help you quickly find answers to
any item that piques your interest, whether it’s in your code — or someone else’s.

raywenderlich.com 15
Advanced Apple Debugging Introduction

What you need


To follow along with the tutorials in this book, you’ll need the following:

• A Mac running High Sierra (10.13) or later. Earlier versions might work, but they're
untested.

• Xcode 9.1 or later. Packaged with Xcode is the latest and greatest version of LLDB,
the debugger you’ll use extensively throughout this book. At the time of this writing,
the version of LLDB packaged with Xcode is lldb-900.0.57.

• Python 2.7. LLDB uses Python 2.7 to run its Python scripts. Fortunately, Python 2.7
automatically ships with macOS, as well as with Xcode. You can verify you have the
correct version installed by typing python --version in Terminal.

• A 64 bit iOS device running iOS 10 or later, and a paid membership to the iOS
development program [optional]. For most chapters in the book, you can run any
iOS programs in the Simulator. However, you’ll get more out of this book by using a
64-bit iOS device to test out certain ideas or suggestions littered throughout the
book.

Once you have these items in place, you’ll be able to follow along with almost every
chapter in this book. For certain sections, you'll need to disable the Rootless security
feature in order to use some of the tools (i.e. DTrace). This is discussed in Chapter 1.

Who this book is for


The art of debugging code should really be studied by every developer. However, there
will be some of you that will get more out of this book. This book is written for:

• Developers who want to become better at debugging with LLDB

• Developers who want to build complex debugging commands with LLDB

• Developers who want to take a deeper dive into internals of Swift and Objective-C

• Developers who are interested in understanding what they can do to their program
through reverse engineering

• Developers who are interested in modern, proactive reverse engineering strategies

• Developers who want to be confident in finding answers to questions they have about
their computer or software

raywenderlich.com 16
Advanced Apple Debugging Introduction

This book is for intermediate to advanced developers who want to take their debugging
and code exploration game to the next level.

Book source code and forums


This book comes with the source code, Python scripts, starter and completed projects
for each chapter. These resources are shipped with the PDF.

We’ve also set up an official forum for the book at forums.raywenderlich.com. This is a
great place to ask questions about the book, discuss debugging strategies or to submit
any errors you may find.

Book updates
Great news: since you purchased the PDF version of this book, you’ll receive free
updates of the book’s content!

The best way to receive update notifications is to sign up for our weekly newsletter. This
includes a list of the tutorials published on raywenderlich.com in the past week,
important news items such as book updates or new books, and a few of our favorite
developer links. Sign up here:

• www.raywenderlich.com/newsletter

Custom LLDB scripts repo


Finally, you can find a repo of interesting LLDB Python scripts here:

https://github.com/DerekSelander/LLDB

These scripts will help aid in your debugging/reverse engineering sessions and provide
novel ideas for your own LLDB scripts.

raywenderlich.com 17
Advanced Apple Debugging Introduction

License
By purchasing Advanced Apple Debugging & Reverse Engineering, you have the following
license:

• You're allowed to use and/or modify the source code in Advanced Apple Debugging &
Reverse Engineering in as many applications as you want, with no attribution
required.

• You're allowed to use and/or modify all art, images, or designs that are included in
Advanced Apple Debugging & Reverse Engineering in as many applications as you
want, but must include this attribution line somewhere inside your game: “Artwork/
images/designs: from the Advanced Apple Debugging & Reverse Engineering book,
available at www.raywenderlich.com”.

• The source code included in Advanced Apple Debugging & Reverse Engineering is for
your own personal use only. You're NOT allowed to distribute or sell the source code
in Advanced Apple Debugging & Reverse Engineering without prior authorization.

• This book is for your own personal use only. You're NOT allowed to sell this book
without prior authorization, or distribute it to friends, co-workers, or students; they
must to purchase their own copy instead.

All materials provided with this book are provided on an “as is” basis, without warranty
of any kind, express or implied, including but not limited to the warranties of
merchantability, fitness for a particular purpose and noninfringement. In no event shall
the authors or copyright holders be liable for any claim, damages or other liability,
whether in an action of contract, tort or otherwise, arising from, out of or in connection
with the software or the use or other dealings in the software.

All trademarks and registered trademarks appearing in this guide are the property of
their respective owners.

raywenderlich.com 18
Advanced Apple Debugging Introduction

Acknowledgments
We would like to thank many people for their assistance in making this possible:

• Our families: For bearing with us in this crazy time as we worked all hours of the
night to get this book ready for publication!

• Everyone at Apple: For developing an amazing platform, for constantly inspiring us


to improve our games and skill sets and for making it possible for many developers to
make a living doing what they love!

• And most importantly, the readers of raywenderlich.com — especially you!


Thank you so much for reading our site and purchasing this book. Your continued
readership and support is what makes all of this possible!

About the cover


The Wana (pronounced “vah-na”) is a sea urchin native to the Indo-West Pacific region.
This sea urchin has two types of spines: a longer hollow spine and a shorter, toxin
producing spine. The Wana contains light-sensitive nerves on its skin which can detect
potential threats and can move its spines accordingly towards the threat.

Much like finding bugs in a program, stepping on one of these creatures really, really
sucks. Pain settles in (inflicted by either your product manager or the sea urchin) and
can last up to several hours, even though the issue may remain for an extended period
of time. In addition, just like bugs in a program, if you find one of these lovely creatures,
there are usually many more in close proximity!

raywenderlich.com 19
Section I: Beginning LLDB
Commands

This section will cover the basics of using LLDB, Apple’s software debugger. You’ll
explore an application named Signals, an Objective-C/Swift application that illustrates
how Unix signals can be processed within an application. You’ll learn some strategies to
find and create Swift syntax-style breakpoints as well as Objective-C style breakpoints.

By the end of this section, you’ll be able to wield the debugger to perform most of the
basic tasks needed for debugging, as well as create your own simple custom commands.

Chapter 1: Getting Started


Chapter 2: Help & Apropos
Chapter 3: Attaching with LLDB
Chapter 4: Stopping in Code
Chapter 5: Expression
Chapter 6: Thread, Frame and Stepping Around
Chapter 7: Image
Chapter 8: Persisting & Customizing Commands
Chapter 9: Regex Commands

raywenderlich.com 20
1 Chapter 1: Getting Started

In this chapter, you’re going to get acquainted with LLDB and investigate the process of
introspecting and debugging a program. You’ll start off by introspecting a program you
didn’t even write — Xcode!

You’ll take a whirlwind tour of a debugging session using LLDB and discover the
amazing changes you can make to a program you’ve absolutely zero source code for.
This first chapter heavily favors doing over learning, so a lot of the concepts and deep
dives into certain LLDB functionality will be saved for later chapters.

Let’s get started.

raywenderlich.com 21
Advanced Apple Debugging Chapter 1: Getting Started

Getting around Rootless


Before you can start working with LLDB, you need to learn about a feature introduced
by Apple to thwart malware. Unfortunately, this feature will also thwart your attempts
to introspect and debug using LLDB and other tools like DTrace. Never fear though,
because Apple included a way to turn this feature off — for those who know what
they’re doing. And you’re going to become one of these people who knows what they’re
doing!

The feature blocking your introspection and debugging attempts is System Integrity
Protection, also known as Rootless. This system restricts what programs can do —
even if they have root access — to stop malware from planting itself deep inside your
system.

Although Rootless is a substantial leap forward in security, it introduces some


annoyances as it makes programs harder to debug. Specifically, it prevents other
processes from attaching a debugger to programs Apple signs.

Since this book involves debugging not only your own applications, but any application
you’re curious about, it’s important that you to remove this feature while you learn
about debugging so you can inspect any application of your choosing.

If you currently have Rootless enabled, you’ll be unable to attach to the majority of
Apple’s programs. There are exceptions however, such as any apps shipped on the iOS
Simulator.

For example, try attaching LLDB to the Finder application.

Open up a Terminal window and look for the Finder process, like so:

lldb -n Finder

You’ll notice the following error:

error: attach failed: cannot attach to process due to System Integrity


Protection

Note: There are many ways to attach to a process, as well as specific


configurations when LLDB attaches successfully. To learn more about attaching to
a process, check out Chapter 3, “Attaching with LLDB”.

raywenderlich.com 22
Advanced Apple Debugging Chapter 1: Getting Started

Disabling Rootless
To disable Rootless, perform the following steps:

1. Restart your macOS machine.

2. When the screen turns blank, hold down Command + R until the Apple boot logo
appears. This will put your computer into Recovery Mode.

3. Now, find the Utilities menu from the top and then select Terminal.

4. With the Terminal window open, type:

csrutil disable; reboot

5. Your computer will restart with Rootless disabled.

Note: A safer way to follow along with this book would be to create a dedicated
virtual machine using VMWare or VirtualBox and only disable Rootless on this.

You can verify if you’ve successfully disabled Rootless by trying the same command in
Terminal again once you log into your account.

lldb -n Finder

LLDB should now attach itself to the current Finder process. The output of a successful
attach should look like this:

After verifying a successful attach, detach LLDB by either killing the Terminal window,
or typing quit and confirming in the LLDB console.

raywenderlich.com 23
Advanced Apple Debugging Chapter 1: Getting Started

Attaching LLDB to Xcode


Now that you’ve disabled Rootless, you can attach LLDB to any process on your macOS
machine (some hurdles may apply, such as with ptrace, but we’ll get to that later).
You’re first going to look into an application you frequently use in your day-to-day
development: Xcode! Make sure you have the latest version of Xcode 9 installed on
your computer before continuing.

Open a new Terminal window. Next, edit the Terminal tab’s title by pressing ⌘ + Shift +
I. A new popup window will appear. Edit the Tab Title to be LLDB.

Next, make sure Xcode isn’t running, or you’ll end up with multiple running instances
of Xcode, which could cause confusion.

In Terminal, type the following:

lldb

This launches LLDB.

Create a new Terminal tab by pressing ⌘ + T. Edit the tab’s title again using ⌘ + Shift +
I and name the tab Xcode stderr. This Terminal tab will contain all output when you
print content from the debugger.

Make sure you are on the Xcode stderr Terminal tab and type the following:

~ $ tty

raywenderlich.com 24
Advanced Apple Debugging Chapter 1: Getting Started

You should see something similar to below:

/dev/ttys027

Don’t worry if yours is different; I’d be surprised if it wasn’t. Think of this as the
address to your Terminal session.

To illustrate what you’ll do with the Xcode stderr tab, create yet another tab and type
the following into it:

echo "hello debugger" 1>/dev/ttys027

Be sure to replace your Terminal path with your unique one obtained from the tty
command.

Now switch back to the Xcode stderr tab. The words hello debugger should have
popped up. You’ll use the same trick to pipe the output of Xcode’s stderr to this tab.

Finally, close the third, unnamed tab and navigate back to the LLDB tab.

To summarize: You should now have two Terminal tabs: a tab named "LLDB", which
contains an instance of LLDB running, and another tab named "Xcode stderr", which
contains the tty command you performed earlier.

From there, enter the following into LLDB:

(lldb) file /Applications/Xcode.app/Contents/MacOS/Xcode

This will set the executable target to Xcode.

Note: If you are using a prerelease version of Xcode, then the name and path of
Xcode could be different.
You can check the path of the Xcode you are currently running by launching Xcode
and typing the following in Terminal:
$ ps -ef `pgrep -x Xcode`

Once you have the path of Xcode, use that new path instead.

Now launch the Xcode process from LLDB, replacing /dev/ttys027 with your Xcode
stderr tab’s tty address again:

(lldb) process launch -e /dev/ttys027 --

raywenderlich.com 25
Advanced Apple Debugging Chapter 1: Getting Started

The launch argument e specifies the location of stderr. Common logging functionality,
such as Objective-C’s NSLog or Swift’s print function, outputs to stderr — yes, not
stdout! You will print your own logging to stderr later.

Xcode will launch after a moment. Switch over to Xcode and click File ▸ New ▸
Project.... Next, select iOS ▸ Application ▸ Single View Application and click Next.
Name the product Hello Debugger. Make sure to select Swift as the programming
language and deselect any options for Unit or UI tests. Click Next and save the project
wherever you wish.

You now have a new Xcode project. Arrange the windows so you can see both Terminal
and Xcode.

Navigate to Xcode and open ViewController.swift.

Note: You might notice some output on the Xcode stderr Terminal window; this is
due to content logged by the authors of Xcode via NSLog or another stderr console
printing function.

A "Swiftly" changing landscape


Apple has been cautious in its adoption of Swift in its own software — and
understandably so. No matter one’s (seemingly religious) beliefs on Swift, for better or
worse, it’s still an immature language moving at an incredible pace with breaking
changes. I still have flashbacks of the “great” Swift 2.2 -> 3.0 migration and I am sure
many of you do too.

raywenderlich.com 26
Advanced Apple Debugging Chapter 1: Getting Started

These large codebase migrations do not sit well in enterprise environments where
frameworks with different dependencies have to play nicely with each other. If one
framework containing Swift code has breaking changes, it can bring down a whole
codebase. Then imagine if hundreds of frameworks contained Swift; it would be a
dependency hell to migrate each framework without breaking the many different repos
that depend upon on these frameworks.

However, things are a changin’ at Apple. Apple is now more aggressively adopting Swift
in their own applications such as the iOS Simulator... and even Xcode!

At last count, Xcode 9 includes over 40 frameworks which contain Swift.

You can query this information yourself by typing the following into LLDB:

(lldb) script print "\n".join([i.file.basename for i in


lldb.target.modules if i.FindSection("__swift3_typeref")])

This will dump out all the dynamically loaded modules Xcode has loaded into the
process that contain or link to Swift code.

This is using Python along with LLDB’s Python module (confusingly also called "lldb").
You’ll get very accustomed to working with this module in section IV of this book as
you learn to build custom, advanced LLDB scripts.

From this list of dynamic Swift libraries, one is a particular module of interest:
IDEPegasusSourceEditor. This is a dynamic library (just like UIKit or Foundation) that
contains some interesting Swift classes pertaining to the code editing views in Xcode.

Note: Apple frequently uses code names for internal development features. For
example, an iPad’s picture-on-picture feature is commonly referred to as
“Medusa” in internal methods — and no, not all Apple code names are Greek code
names. So, what’s up with this Pegasus name? There’s often specific reasoning to
the Apple development team (or manager/s?) assigning these names. Your guess is
as good as mine, but I can see a logical connection between a mythological
creature that symbolizes wisdom and the visual display to your source code.

Remember this module name, as you’ll be seeing it quite a bit in a second.

Finding a class with a click


Now that Xcode is set up and your Terminal debugging windows are correctly created
and positioned, it’s time to start exploring Xcode using the help of the debugger.

raywenderlich.com 27
Advanced Apple Debugging Chapter 1: Getting Started

While debugging, knowledge of the Cocoa SDK can be extremely helpful. For example, -
[NSView hitTest:] is a useful Objective-C method that returns the class responsible for
the handled click or gesture for an event in the run loop. This method will first be
triggered on the containing NSView and recursively drill into the furthest subview that
handles this touch. You can use this knowledge of the Cocoa SDK to help determine the
class of the view you’ve clicked on.

In your LLDB tab, type Ctrl + C to pause the debugger. From there, type:

(lldb) b -[NSView hitTest:]


Breakpoint 1: where = AppKit`-[NSView hitTest:], address =
0x000000010338277b

This is your first breakpoint of many to come. You’ll learn the details of how to create,
modify, and delete breakpoints in Chapter 4, “Stopping in Code”, but for now simply
know you’ve created a breakpoint on -[NSView hitTest:].

Xcode is now paused thanks to the debugger. Resume the program:

(lldb) continue

Click anywhere in the Xcode window (or in some cases even moving your cursor over
Xcode will do the same); Xcode will instantly pause and LLDB will indicate a breakpoint
has been hit.

The hitTest: breakpoint has fired. You can inspect which view was hit by inspecting
the RDI CPU register. Print it out in LLDB:

(lldb) po $rdi

This command instructs LLDB to print out the contents of the object at the memory
address referenced by what’s stored in the RDI assembly register.

raywenderlich.com 28
Advanced Apple Debugging Chapter 1: Getting Started

Note: Wondering why the command is po? po stands for print object. There’s also p,
which simply prints the contents of RDI. po is usually more useful as it gives the
NSObject’s description or debugDescription methods, if available.

Assembly is an important skill to learn if you want to take your debugging to the next
level. It will give you insight into Apple’s code — even when you don’t have any source
code to read from. It will give you a greater appreciation of how the Swift compiler team
danced in and out of Objective-C with Swift, and it will give you a greater appreciation
of how everything works on your Apple devices.You will learn more about registers and
assembly in Chapter 10, “Assembly Register Calling Convention”.

For now, simply know the $rdi register in the above LLDB command contains the
instance of the subclass NSView the hitTest: method was called upon.

Note the output will produce different results depending on where you clicked and what
version of Xcode you’re using. It could give a private class specific to Xcode, or it could
give you a public class belonging to Cocoa.

In LLDB, type the following to resume the program:

(lldb) continue

Instead of continuing, Xcode will likely hit another breakpoint for hitTest: and pause
exection. This is due to the fact that the hitTest: method is recursively calling this
method for all subviews contained within the parent view that was clicked. You can
inspect the contents of this breakpoint, but this will soon become tedious since there
are so many views that make up Xcode.

Filter breakpoints for important content


Since there are so many NSViews that make up Xcode, you need a way to filter out some
of the noise and only stop on the NSView relevant to what you’re looking for. This is an
example of debugging a frequently-called method, where you want to find a unique case
that helps pinpoint what you’re really looking for.

As of Xcode 9, the class responsible for visually displaying your code in the Xcode IDE is
a private Swift class belonging to the IDEPegasusSourceEditor module, named
SourceCodeEditorView. This class acts as the visual coordinator to hand off all your
code to other private classes to help compile and create your applications.

Let’s say you want to break only when you click an instance of NSView. You can modify
the existing breakpoint to stop only on a NSView click by using breakpoint conditions.

raywenderlich.com 29
Exploring the Variety of Random
Documents with Different Content
The only too notable quarrel of the Ancients and Moderns
produced some deservedly famous literature of the critical kind in
England, but its greatest result in that way, The Battle of the Books,
will be best noticed, together with its author’s other works, and in
the order rather of its own publication than of its composition. Nor
Temple. need the earlier protagonists, Temple and Bentley,
occupy us much; though the latter will give an
opportunity of paying at least respects to a kind of Criticism of which
we have perforce said little. Temple, a charming writer, and the
author, at the close of his critical Essay on Poetry, of one of the most
exquisite sentences in English, is simply a critic pour rire. The
hundred pages of his Works[529] which are devoted to literature,
invited the exercise of Macaulay’s favourite methods by the enormity
of their ignorance, the complacency of their dogmatism, and the
blandness of their superficiality. Temple has glimmerings—he
intimates pretty plainly some contempt of at least the French “rules”;
but he will still be talking of what he has given himself hardly the
slightest pains to know.
This could not be said of Bentley, and the Phalaris Dissertation has
been not undeservedly ranked as one of the representative pieces of
Bentley. critical literature. It is only unfortunate that Bentley
has meddled so little with the purely literary side of
the matter; and the sense of this misfortune may be tempered by
remembrance of his dealings with Milton. He is, however, perfectly
right in at least hinting[530] that the Pseudo-Phalaris might have been
convicted on literary counts, as well as on linguistic and
chronological, and that, on grounds of style, the theory of those
half-sceptics who attributed the Letters to Lucian was almost worse
than the error of the true believers. That Lucian could have written a
line of this skimble-skamble stuff is simply impossible; and it must
always remain an instance of the slight sense of style possessed by
the Humanists that a really great man of letters, like Politian, should
have given countenance to the absurdity.
From any point of critical consideration Collier’s famous book[531]
must be a most important document in the History of Criticism; and
though from some such points it may be of even greater importance
Collier’s than it is to us, we can in no wise omit it. For it is
Short View. probably the earliest instance in our history where a
piece of criticism has apparently changed, to a very great extent, the
face of an important department of literature, and has really had no
small part in bringing about this change. It is, however, indirectly
rather than directly that it concerns us; for it is only here and there
that Collier takes the literary way of attack, and in that way he is not
always, though he is sometimes, happy. Curiously enough, one of his
felicities in this kind has been imputed to him for foolishness by his
great panegyrist. It is not necessary to feel that sympathy with his
opinions on ecclesiastical and political affairs which Macaulay
naturally disclaimed, and which some others may cheerfully avow, in
order to see that the Tory critic was quite right, and the Whig critic
quite wrong, in regard to the dissertations on the Greek and Latin
Drama. What may be thought of their technical scholarship does not
matter. But Macaulay’s undoubted familiarity with the classics must
have had a gap in it, and his wide knowledge of modern literature
several much greater gaps, if he did not know—first, that Collier had
ancient criticism on his side, and secondly, that the allegation of
ancient authority and practice where favourable, the arguing-off of it
where inconvenient, were exactly the things to influence his
generation. When everybody was looking back on the Vossian
precept, “Imitate the Ancients, but imitate them only in what is
good,” and drawing forward to the Popian axiom,
“To copy Nature is to copy them,”

“dissertations on the Greek and Latin Drama” were not otiose at


all, they were absolutely necessary.
But for the most part, as is notorious, Collier is as ethical as
Plutarch or Plato. It was desirable that he should be so, and nobody
but a paradoxer will ever defend the style of play-writing which
produced such things as Limberham, and The Old Bachelor, and
even The Relapse—though the first be Dryden’s, and contain some
good things in the characters of Prudence and Brainsick, though the
second show us the dawn of Congreve’s wit, and though the third
contain handfuls of the sprightliest things in the English language. It
is in reference to this last, by the way, that Collier chiefly quits the
path of ethical criticism, and takes to that of literary, or at least
dramatic. There is hardly a sharper and more well-deserved beating-
up of the quarters of a ragged dramatic regiment anywhere than
that (at p. 212 sq.) on the glaring improbabilities of Vanbrugh’s plot,
the absolute want of connection between the title part of it and the
real fable—Tom Fashion’s cheating his brother of Hoyden—and the
way in which the characters are constantly out of character in order
that the author may say clever things. But Collier has serious
matters on his mind too much to give us a great deal of this; and
the other definitely literary points which I have noted, in a very
careful re-reading of the piece for this book, are not numerous. I
wish he had not called Love’s Labour’s Lost (p. 125) “a very silly
play”; but how many people were there then living who would have
thought differently? I wish he had worked out his statement (rather
rash from his own point of view) at p. 148, “Poets are not always
exactly in rule.” He might have developed his views on the Chorus
(p. 150) interestingly. I have some other places; but they are not
important. The sum is, that though Collier evidently knew most
critical authorities, from Aristotle and Horace, through Heinsius and
Jonson, to Rapin, and Rymer, and Dryden himself, very well; though
he could (pp. 228, 229) state the Unities, and even argue for them—
this was not his present purpose, which was simply to cleanse the
stage. His interest in other matters in fact blunted what might have
been a keen interest in literature proper. And this is thoroughly
confirmed by study of his interesting and characteristic Essays,[532]
where, out of more than five hundred pages, exactly four are
devoted to literature, and these give us nothing but generalities.
That Collier’s victory was very mainly due to the fact that he
struck in at the right moment, as spokesman of an already formed
popular opinion, would be a matter of reasonable certainty in any
Sir T. P. case; but the certainty is here historical. One of
Blount. many proofs at hand is in the curious lighterfull of
critical lumber which Sir Thomas Pope Blount launched four (or
eight?) years before Collier let his fireship drive into the fleet of the
naughty playwrights. In this book,[533] dedicated to Mulgrave, that
noble poet himself, Roscommon, Cowley, and the lately published
and immensely influential Whole Duty of Man, are quoted to support
the argument that “A poet may write upon the subject of Love, but
he must avoid obscenity.”[534]
Sir Thomas, however, comes within the inner, and not merely the
outer, circle of criticism for his aims and his collections, though
certainly not for any critical genius that he displays. His “Remarks
upon Poetry,” no less than the “Characters and Censures” which
make up the other part of his work, are the purest compilation: and
though we are certainly not without compilers in these days (what
indeed can a Historian of Criticism do but compile to a great
extent?), there are very few of us who are at once honest enough
and artless enough to follow the method of Blount. Whether he is
arguing that good humour is essentially necessary to a poet (how
about the genus irritabile?) or that a poet should not be addicted to
flattery, or discussing the “Eglogue, Bucholic [sic], or Pastoral,”
whether he is following Phillips and Winstanley and borrowing from
both, in compiling a dictionary of poets, he simply empties out his
common place-book. “Dryden remarks,” “Rapin observes,” “Mr
Cowley tells us,” “Mr Rymer can nowise allow” (this is happy, for it
was habitual with Mr Rymer “nowise to allow”), such are the
usherings of his paragraphs. He is not uninteresting when he is
original (cf. his remarks on Waller); but one is almost more grateful
to him for his collections, which put briefly, and together, the critical
dicta of a vast number of people. Here we may read, with minimum
of trouble, how Julius Scaliger could not see anything in Catullus but
what is common and ordinary; how Dr Sprat said that till the time of
Henry the Eighth there was nothing wrote in the English language
except Chaucer that a man would care to read twice; how Scaliger
once more, and Petrus Crinitus, and Johannes Ludovicus Vives, and
Eustatius Swartius, thought Claudian quite in the first rank of poets;
how Tanneguy le Fèvre shook his head over Pindar as having
“something too much the air of the Dithyrambick”; and how Cœlius
Rhodiginus was good enough to find that same Dantes Aligerus, who
displeased others, a “poet not contemptible.”[535] These things are
infinitely pleasant to read, and give one a positive affection for Sir
Thomas Pope Blount as one turns them in the big black print of his
handy quarto; yet perhaps it would be excessive to call him a great
critic. What he does, besides providing this gazophylacium for the
connoisseur, is to show how wide the interest in criticism was.
A further turn, and the last in this walk, may be furnished to us by
one of his own quotations (p. 137 of the Characters and Censures)
of an answer to the question, “Whether Milton and Waller were not
the best English poets, and which was the better of the two?” from
Periodicals: The Athenian Mercury, vol. v., No. 4. For this curious
The Athenian and interesting medley of Dunton’s, and Samuel
Mercury, &c. Wesley’s, and others’, was almost the first to provide
something in English answering, or that might have answered, to the
Journal des Savants and the Mercure Galant. Actually, the Mercury
was not very literary. I do not pretend to have examined the original
volumes with any very great care. But in the three copious books
which were either directly compiled out of it, or composed in
imitation—the Athenian Oracle,[536] Athenian Sport, and The British
Apollo—literature holds no very large place. The Oracle does indeed
give at p. 438 a very elaborate answer to the question, “Whether the
Dramatic Poets of the Last Age exceeded those of this?” and the
Apollo, besides a versification of the identical query and answer
which Blount had quoted, contains a long descant on the Origin of
Poetry, and a remarkably shrewd answer to the question, “Which is
the best poet—Boileau, Molière, or La Fontaine?” But the time of
literary periodicals in England was not yet, though this was the very
eve of it: and they must therefore be postponed.[537]

484. The chief critical loci in Milton are all among the best known
passages of his work. They are the peremptory anathema on rhyme
in the prose note added to Paradise Lost, in what Professor Masson
has settled to be the “Fifth Form of the First Edition”; the short
Defence of Tragedy, wholly on Italian principles but adapted to
Puritan understandings, prefixed to Samson Agonistes; the first
description of his own studies in The Reason of Church Government;
the more elaborate return upon that subject—a singular mixture of
exquisite phrasing and literary appreciation with insolent abuse—in
the Apology for Smectymnuus (which is not, as some have thought,
the same thing as The [Platonic] Apology) and divers clauses in the
Tractate of Education, especially the reference to “Castelvetro, Tasso,
and Mazzoni,” whom he credits with “sublime art,” and puts on a
level with Aristotle and Horace. We might add a few casual girds,
such as that at the supposed cacophony of Hall’s “Teach each” in the
Apology for Smectymnuus, which has been compared to Malherbe’s
vellications of Desportes (cf. sup., p. 245). A complete critical
treatise from him (if only he could have been prevailed upon to write
in a good temper) would have been of supreme interest: it is not so
certain that it would have been of supreme value, even if he had
been in that temper.

485. He has practically given us nothing but a slight apology for


sacred verse (common in his time and natural from the author of the
Davideis); with a slighter seasoning of the also familiar defence of
poetry from being mere “lying,” in the Preface to the folio edition of
his Poems; some still slighter remarks on Comedy in that to Cutter of
Coleman Street; and hardly more than a glance at literary education
in his Proposition for the Advancement of Experimental Philosophy.
In this last we may feel a sort of gust of the same spirit which
appears in his disciple Sprat’s History of the Royal Society (v. infra).
486. Both these will be found in Chalmers’ Poets, vi. 349-372.
Hobbes’s Answer is also in Molesworth’s ed. of the Works, iv. 443-
458. It is there followed by a short literary letter to Edward Howard
of the British Princes, the most egregious of Dryden’s egregious
leash of brothers-in-law. To these may be added the brief literary
passage in the chapter of “Intellectual Virtues” in the First Part of
Leviathan (ibid., iii. 58) and the “Brief” of the Rhetoric (referred to
supra, vol. i. p. 40); ibid., vi. 416-510. I have a copy of the first
edition of this, anonymous and undated, but assigned to 1655-57 by
bibliographers. It does not contain the shorter Art of Rhetoric, which
follows in Molesworth.

487. This Boojum, I fear, will disturb some of my friends. But I put
him under the protection of the Powder of Pimperlimpimp, and of
the Equinoctials of Queubus.

488. See the Discourse on Satire—Scott (in the edition revised by


the present writer) (London, 1882-93), xiii. 24 sq., or Ker (ed. cit.
post), ii. 33 sq.

489. I do not smile so much as some may over “no, not Du


Bartas.” But though oases are far from rare in what may seem, to
those who know it not, this thirsty land of criticism, I hardly know a
more delightful “diamond of the desert” than the refusal to admit
somebody else lest you should have to admit Dante, and the
subsequent “Dante, Marino, and others.” When the eye is weary of
italic print, or of a too closely packed quarto page, or of François
Hédelin, Abbé d’Aubignac, in any type or format, it is pleasant half to
shut it, and let the dream of these “others” wave before one. I see
that they must have written in Italian; but other common measure,
other link to bind them both to the Commedia and to the Adone, is
yet to seek for me.

490. Lest the last note should lead any one to think that I wish to
make inept and ignoble game of Davenant, let me observe that he
can write admirable things, worthy a son, in double sense, of
Oxford. Could anything be happier than this of Spenser: “His noble
and most artful hands”? The mere selection of the epithets is good,
the combination of them famously so.

491. This attempt to get Epic as close as possible to Drama—to


work all the kinds of Imitation back into one arch-kind—appears
more or less fitfully in the whole Neo-Classic school. And we shall
never quite understand the much discussed “Heroic Play,” till we take
it in conjunction with the “Heroic Poem.”

492. There is, of course, critical matter in Howell’s Letters, and in


a score or scores of other places; but it is of the kind that we must
now neglect, or select from with the most jealous hand.

493. Of the great critical men of letters of 1800-1850 only Leigh


Hunt—the least of them—was just to Dryden; even Hazlitt is
inadequate on him. Among our preceptistas of the same or a little
later date, Keble (Præl. v.) mildly perstringes Dryden’s inconsistency
(“male sibi constat D.”), but rather as poet than as critic. Garbett, his
successor and opponent, a great admirer of Dryden’s style, and one
who expresses just regret at the want of common knowledge of it, is
very severe (Præl. x.) on his want of philosophical profundity and
sincerity. But the reverend Professor had found nearly as much fault
on this score with Longinus.

494. Dryden made no mistake about Longinus. He calls him, in the


Apology prefixed to The State of Innocence, “the greatest critic
among the Greeks after Aristotle,” cites him often, and parades and
uses a long passage of the Περὶ Ὕψους in the Preface to Troilus and
Cressida. The references are conveniently collected in Mr Ker’s index
(v. inf.)

495. Dryden’s critical work, which until recently was accessible


with ease only in Scott’s elaborate edition of his works, or in
Malone’s less bulky, but still bulky and not excessively common,
edition of the Prose, has recently been given, with quite admirable
editorial matter, by Professor Ker (2 vols., Oxford, 1900). I wish he
had included one or two more things, especially the Heads of an
answer to Rymer; but it must be admitted that the authenticity of
these, though I think not doubtful, is not absolutely certain, and the
correct text still less so. See note on Rymer infra, and my edition of
Scott, xv. 378 sq., for text and history.

496. Defence of an Essay of Dramatic Poesy. Scott, ed. cit., xi.


295: Ker, i. 113.

497. Preface to Miscellanies, ii.; Scott, ed. cit., xii. 295; Ker, i. 263.
I wish that Dryden were alive for many reasons: not least because
he would certainly pay the debt that he owes to my friend Mr Ker
magnificentissime. No one has vindicated him better against the
half-witted blunderers. But I am not quite so much inclined as even
Mr Ker is to father his critical style on Chapelain and La Mesnardière,
Sarrasin and Scudéry, or on Corneille himself. It is not till Saint-
Evremond, perhaps even till Fénelon, that I can find in French the
indescribable omne tulit punctum as in him. And both, are his
inferiors.

498. I have not thought it necessary to encumber the page with


references in the case of the shorter Essays, where any one can
discover the passages cited, whether he uses Scott, Malone, the
originals, or Mr Ker’s special collection, with no more labour than is
good for him and deserved by them. In the case of the longer pieces
the references will be given at least sufficiently often to make the
locating of the others easy, without turning the lower part of the
page into a kind of arithmetical table.

499. As including Invention, Fancy, and Elocution, but in itself


merely considered as synonymous with “Wit.” It was probably from
this that Addison (see below) started that Imagination theory of his
which has been so much overrated.
500. When the present writer began his revision of Scott’s Dryden
in the year 1881 there were no separate editions of the Essay since
the originals. There are now, of annotated issues of it, either by
itself or with more or less of its author’s related work, no less than
five known to me,—those of Mr Thomas Arnold (Oxford, 1886), Mr
Strunk (New York, 1898), Mr Low (London, n. d.), Mr Nichol Smith
(Glasgow, 1900), and Professor Ker’s. The study of English literature
in schools and colleges has been much abused, very foolishly talked
about by some of its advocates, and no doubt not always wisely
directed. But it is at least something to be said for it that it has
made such a masterpiece as this known to probably a hundred
persons for every one who knew it twenty years ago.

501. One of the very earliest evidences of the interest in dramatic


criticism felt in England, immediately after the Restoration, must be
Pepys’ note that on September 1, 1660, when he was dining at the
Bullhead, there “rose ... a dispute between Mr Moore and Dr Clerke
—the former affirming that it was essential to a tragedy to have the
argument of it true, which the Doctor denied.” The question, on the
very English terms of another dinner and a bet, was to be settled by
Pepys himself three days later. He does not tell us whether he read
up for it; but on the 4th he decided for the Doctor (Diary, ed.
Wheatley, i. 233).

502. Here, to glance at the matter of Dryden and the Spaniards (v.
sup., p. 332, and inf., on Spence), is a possible reminiscence of
Lope’s Arte Nuevo, 178-180—

Que aquesta variedad deleyta mucho:


Buen exemplo nos da naturaleza,
Que por tal variedad tiene belleza.

503. Scott, xv. 337; Ker, i. 75.

504. In the Discourse on Satire. Scott, xiii. 3; Ker, ii. 17.


505. “I have further to add that I seldom use the wit and
language of any romance or play which I undertake to alter;
because my own invention, as bad as it is, can furnish me with
nothing so dull as what is there.” These invocations of Nemesis are
seldom unheard by the acute ears of that satiric Goddess.

506. Lesser, but far from negligible; for the Character of Saint-
Evremond is both personally and critically interesting, and the critical
biographies of Lucian and Plutarch lead straight to Johnson.

507. “In his Juvenilia ... his rhyme is always constrained or


forced.”—Discourse on Satire.

508. Chapelain might like the early romances (v. supra, p. 260).
But here Boileau was the spokesman of France.

509. They have deceived the very elect, e.g., M. Rigault, who in
not altogether unnatural amazement at the dictum, “Spenser wanted
only to have read the rules of Bossu,” classes (Q. des A. et des M., p.
311) Dryden as an ancien enragé. But M. Rigault is at a wrong angle
in most of the English part of his book,—so much so as to strike a
chill into any one who has to criticise a foreign literature, lest,
lacking the grace of the Muses, he too go astray.

510. A phrase of Blake’s.

511. The fact is that the two are parts of the same book; and that
a second edition of the first appeared in 1692, just before the first of
the second next year.

512. Vol. ii. pp. 107-130 of the 1706 edition of Rapin in English. At
p. 113 Rymer says that he will not here examine the various qualities
which make English fit above all other languages for Heroic Poesy,
“the world expecting these matters learnedly and largely discussed
in a particular treatise on that subject.” This apparently important
announcement is marginally annotated “Sheringham.” I suppose this
was Robert S., a Norfolk man (as his name imports), of Caius
College, and Proctor at Cambridge just before the Commonwealth
ejection. He is described (see Dict. Nat. Biog.) as an “excellent
linguist,” but seems to have been more of an antiquary than of a
man of letters. As the D. N. B. says nothing of any such work as
Rymer glances at, I suppose the world was disappointed of it by his
sudden death in May 1678, four years after Rymer wrote.

513. I do not think that Rymer ever intended to be rude to


Dryden, though his clumsy allusions to “Bays” in the Short View
naturally rubbed the discrowned Laureate the wrong way for a time.

514. Rymer’s elaborate directions for removing the Romantic


offence of this play, and adjusting it to Classical correctness and
decorum, are among the most involuntarily funny things in criticism
(pp. 19-24).

515. Rymer knew something of Old French. How horrified he


would have been if he had come across the lines in Floriant et
Florete (2904, 2905)—

“Si samble qu' enfes voit disant


'Baise, baise, je voil baisier!”

516. It has (excluding an appended extract from the Registers of


the Parliament of Paris about Mysteries) only 168 pages of perhaps
200 words each; and much of it is quotation. But it is far longer than
The Tragedies of the Last Age.

517. Short View, p. 94.

518. Ibid., p. 144.

519. It is curious to read the deliberately stupid misunderstanding


of Aristotle by which this is justified.

520. It may be not unamusing to give an instance or two of the


way in which Nemesis has made poor Tom speak truth
unconsciously,—
“They who like this author’s writing will not be offended to find so
much repeated from him” [Shakespeare].—P. 108.
“Never in the world had any pagan Poet his brains turned at this
monstrous rate.”—P. 111.
“No Pagan poet but would have found some machine for her
deliverance.”—P. 134.
“Portia is ... scarce one remove from a Natural. She is the own
cousin-german ... with Desdemona.”—P. 156.

521. His best deed was to elicit from Dryden, in Heads of an


Answer to Rymer (Works, xv. 390), the memorable observation that
"if Aristotle had seen ours [i.e., "our plays"] he might have changed
his mind." One may add that, if Dryden had worked these “Heads”
out, he might have solved the whole mystery of criticism as far as in
all probability it ever can be solved, or at the very least as far as it
could be solved with the knowledge of literature at his disposal.

522. History of the Royal Society, 4to, London, 1667, p. 111 sq. It
may be found conveniently extracted at vol. iii. pp. 271, 272 of Sir
Henry Craik’s English Prose Selections (London, 1894).

523. It is well known that Thomas Heywood, the dramatist, had


planned, if he did not actually execute, a Lives of the Poets very
much earlier, and some sanguine souls have hoped that it may yet
turn up. But the famous passage about poets’ nicknames, as well as
the whole cast of Heywood’s work, suggests that, though biography
may have lost something, criticism has not lost much.

524. London 12mo.

525. 8vo, London, 1686.

526. 1691: but pirated earlier.

527. I do not know whether this was cause or consequence of his


being a friend of Shadwell. But I am bound to note, though with
much surprise, that my friend Mr Sidney Lee finds (D. N. B.) “no
malice” in Langbaine.

528. This is the odder, and the more discreditable, because one of
the few things to be counted to Langbaine for righteousness is a
distinct admiration of Shakespeare.

529. Ed. 1757, vol. iii., pp. 394-501, containing the Poetry, the
Ancient and Modern Learning, and the Thoughts upon Reviewing
that Essay. Some have charitably found in Temple better knowledge
of the Moderns, whom he scorned, than of the Ancients, whom he
championed, on the strength of his references to “Runes” and
“Gothic Dithyrambics.” I cannot be so amiable. It is all a mere
parade of pretentious sciolism varnished by style.

530. Diss., § xvi. My copy is the London ed. of 1817.

531. A Short View of the Profaneness and Immorality of the


English Stage. London, 1698. The great popularity of the book
caused it to be quickly reprinted: my copy, though of the first year, is
the third edition. Collier’s rejoinder to his victims next year contains
good things, but is of less importance. And it does not matter much
to us whether he originally drew anything from the Prince de Conti’s
pietist Traité Sur la Comédie (1667). The Ancients, and the Fathers,
and the Puritans were in any case quite sufficient sources.

532. Essays upon Several Moral Subjects (3rd ed., 2 vols., London,
1698). Nor can one make out an entirely good case (though
something may be done) for Collier in the matter of that description
of Shakespeare, which Mr Browning has maliciously chosen, as a
motto for Ferishtah’s Fancies, from the Historical Dictionary: “His
genius was jocular, but, when disposed, he could be very serious.”

533. De Re Poetica, or Remarks upon Poetry, &c., 4to, London,


1694. It is even said to have first appeared in 1690.
534. Both Roscommon and Mulgrave were critics in their way, and
the former’s Essay on Translated Verse is one of those numerous
documents which would have been of the utmost service to us in the
last volume, but which cannot receive detailed treatment in this.

535. The remark may with more proportion be made of Cœlius


himself, a very worthy Humanist, whom Lilius Giraldus pronounces to
be multifariam eruditus, parum tamen in pangendis versibus
versatus.

536. The Athenian Mercury (1690-97) ran to twenty volumes. The


Oracle, from which the late Mr Underhill made his interesting
selection (London, n. d.), was issued in four. I have one (London,
1703), which calls itself an “Entire Collection,” as well as Athenian
Sport (London, 1707), and The British Apollo, (3rd ed., London,
1718).

537. An exception may perhaps be made in favour of J. [Cornand]


de La Croze’s Works of the Learned, which, translated wholly or
mainly by its author from the French, began to appear monthly in
August 1691, and was collected before long in a thin quarto volume.
Its contents are real reviews in almost every point—down to some
sharp remarks by the editor-reviewer on plagiarisms by the Athenian
Mercury, and complaints of the absence of indices to lessen the
labour of reviewing. The books reviewed are, as a rule, of no great
interest; but the summaries of their contents are generally good,
and the views advanced are at least sometimes made the subject of
passably argumentative discussion.
INTERCHAPTER V.

In the present Interchapter we come to a sort of Omphalos of the


whole projected History. Here and here only, up to the present day,
do we find a Catholic Faith of criticism, not merely at last
constituted, but practically accepted over the whole literary world. In
ancient times, though it is not difficult to discern a creed of a not
wholly dissimilar character, yet that creed was arrived at in
roundabout fashion, and was never applied universally to poetry and
prose as literature. In the Middle Ages there was no such creed at
all. In the century which—or rather a certain aspect of it—will furnish
us with the subject of the last Book of the present volume, the
catholic faith still maintains, and even, as is the wont of such things,
rather tightens, its hold as received orthodoxy; but there are
grumblings, and threatenings, and upheavals on the one hand, and
on the other the tendency to a dangerous latitudinarianism. In that
which, with the permission of the fates, will, with the Dissidents of
the Eighteenth, give the subject of the next volume, there is no
parallel consensus even of a prevailing party. Take a dozen critics of
any distinction, at different times and in different countries of the
seventeenth century in Europe, and ask them to enunciate some
general laws and principles of literary criticism. The results, if not
slavishly identical, would be practically the same, putting aside
particular and half unreal squabbles of Ancient and Modern and the
like. Do the same at any time for the last hundred—certainly for the
last seventy or eighty—years, and the result would be a Babel. If any
two of the utterances did not betray direct contradiction, it would
probably be because the speakers began at entirely different facets
of the subject.
Whether this literary unanimity—which resembles the ecclesiastical
unanimity, on the ruins of which it grew, not least in being a little
unreal—was a good thing or a bad thing in itself, is one of those
larger questions which we do not purpose to argue out here. The
point for us is that it existed. It was compatible, as in the other case,
with a good deal of minor difference: there might be literary Scotists
and Thomists; there might even (as in the Ancient and Modern case)
be a Great Schism of the most apparently important kind. But this
was as a rule mere jangling; and the more serious of the Moderns
generally tried to make out little more than that their favourites
could claim as much, or more, of the graces which both esteemed,
as the other people’s favourites possessed.
We have seen in the last Interchapter how something like this
creed had been achieved—though not without a good deal of
opposition, and hardly, in any case, with the result of authoritative
and complete statement—in Italy, and to some extent borrowed
thence, in other countries, before the end of the sixteenth century
itself. The seventeenth did little more than crystallise it, lay stress on
particular points, fill up some gaps, arrange, codify, illustrate. The
absence of dissidence, except on the minor points, is most
remarkable. In regard to Aristotle, in particular, there are no Patrizzis
and hardly any Castelvetros. Men tack on a considerable body of
Apocrypha to the canonical books of the Stagirite, and misinterpret
not a little that he actually said. But they never take his general
authority in question, seldom the authority of any ancient, and that
of Horace least of all. The two great artificial conceptions of the
elaborate “Unities” drama, with Acts and Scenes taking the place of
the choric divisions, and of the still more artificial “Heroic Poem,”
with its Fable, its Epic Unity, its Machines, and so forth, acquire in
theory—if luckily, as, for instance, in England, by no means in
practice—greater and greater dignity. It becomes a sort of truism
that the drama is the most beautiful and ingenious, the heroic poem
the noblest, thing on which the human mind can exercise itself. But
they are difficult things, sir! very difficult things. Each is sharply
isolated as a Kind: and the other Kinds are ranged around and below
them. You never criticise any thing first in itself, but with immediate
reference to its Kind. If it does not fulfil the specifications of that
Kind, it is either cast out at once or regarded with the deepest
suspicion.
Further, all the Kinds in particular, as well as Poetry itself in
general, possess, and are distinguished by, Qualities which are, in
the same way, rigidly demanded and inquired into. It is generally, if
not quite universally, admitted that a poem must please: though
critics are not quite agreed whether you are bound to please only so
as to instruct. But you must please in the Kind, by the Quality,
according to the Rule. There is no room for nondescripts; or, if they
are admitted at all, they must cease to be nondescripts, and become
Heroi-comic, Heroi-satiric, “Tragical-comical-historical-pastoral,”[538]
or what not.
This general view may seem unorthodox to those who put faith in
the notion—to be found in some books of worth, as well as of
worship—that there was a “Romantic revolt” in the beginning of the
seventeenth century—that there was even a kind of irruption or
recrudescence of mediæval barbarism, and that the pronounced and
hardened classicism of the later century was a fresh reaction—a case
of Boileau à la rescousse! The texts, and the facts, and the dates, do
not, to my thinking, justify this view of history, in so far, at least, as
criticism is concerned. The crystallising of the classical creed goes on
regardless of Euphuism, earlier and later, in England, of Marinism in
Italy, of Culteranism and Conceptism in Spain, of the irregular
outburst of similar tastes in France, which marks the reign of Louis
XIII. As we have seen, Ogier, in the last named country, at the very
moment of striking a blow for Romantic drama, admits that the
critics are against him; and we have also seen how they were. In
England, Sidney, at the beginning of the great Elizabethan period,
holds out hands to Jonson at the end. The very Spanish Romantics,
when they come to consider the matter critically, make an
unblushing transaction between conscientious theory and popular
practice: and such an Italian iconoclast as Beni is classical, in the
very act and process of belittling the classics.
At the same time, this accepted faith of Criticism, when we come
to examine it, is a very peculiar Catholicity. Uncompromisingly
Aristotelian in profession, its Aristotelianism, as has been recognised
by an increasing number of experts from the time of Lessing
downwards, is hopelessly adulterated. Many of the insertions and
accretions are purely arbitrary: others come from a combination of
inability to forget, and obstinate refusal frankly to recognise, the fact
that the case is quite a different case from that which Aristotle was
diagnosing. But, by the time at least when the creed became
triumphant, a new Pope, a new Court of Appeal, has been foisted in,
styling itself Good Sense, Reason, or even (though quite Antiphysic)
Nature. That this anti-Pope, this Antiphysis, was partly created by
the excesses of the Euphuist-Gongorist movements, need not be
denied; but this is comparatively irrelevant. We have traced above,
in almost all their principal exponents, the curious, and sometimes
very ludicrous, attempt to conciliate that furor poeticus which the
ancients had never denied, with those dictates of good sense which
the ancients were presumed to have accepted and embodied. A
professed satirist could evolve, in his happiest moments, nothing
more comic than the eirenicon of Mambrun,[539] or, rather, than his
clinical examination of the poet in fury, and his observation of the
poet in his right mind.
The survey of the development of this phenomenon, or group of
phenomena, in different countries, requires less minuteness than
was needed in the last Interchapter, because the central stage of the
movement is both of less importance and of less complexity than the
beginnings of it: but it is essential to the scheme of these
Interchapters, and to that of the whole book, that some such survey
should be given.
In Italy, as we have seen, the results of the period were almost
insignificant—a fact no doubt connected with, though in no sense
necessarily caused by, the declension of the Italian creative genius
after Tasso. We have, it may be hoped, established, by the slow but
irresistible process of reciting the actual history, the truth that no
constant ratio exists between periods of creation and periods of
criticism—that they may go hand in hand, or that one may follow the
other, or that both may fail to put in any important appearance, as
Fate and metaphysical aid may determine. This, for Italy, was a
period of the last kind, though not one of its very worst examples.
The Italians continued both to play at criticism in their Academies,
and to accumulate solid though second-hand work in such
laboratories as those of Aromatari. They fought out the half-mock
battle of the Ancients and Moderns, as became them, before other
nations meddled with it: and they still maintained, for long, though
not for the whole time, that position of supremacy, as masters in
title to Europe, which the great achievements of the preceding
century had given them. But they added nothing to their claims, and
by degrees the supremacy passed from them.[540]
That it passed to France is an accepted truth, and like most,
though not all, accepted truths, this has so much of the real quality
that it is idle to cavil at it. That it has been abused there can be little
doubt—or could be little if people would take the small trouble
necessary to ascertain the facts. I do not know who first invented
the term “Gallo-Classic,” which, to judge by those Röntgen rays
which the reader of examination-papers can apply, has sunk deep
into the youthful mind of this country. It is a bad word. I have taken
leave to call it “question-begging, clumsy, and incomplete,” before
now; and I repeat those epithets with a fresh emphasis here. It begs
the question whether “Italo-Classic” would not, in its own kind, be
the properer term: it is clumsy because the two parts of it are not
used in the same sense; and it is incomplete because it does not
intimate that much beside French influence, and that a very peculiar
and sophisticated kind of Classical influence, went to the making of
the thing. But there was French influence: and for some three-
quarters of a century France was the head manufactory in which
Italian, Classical, and other ideas were torn up and remade into a
sort of critical shoddy with which (as with other French shoddy in
that and other times) Europe was rather too eager to clothe itself.
Some pains have been taken in the foregoing Book to put the reader
in a position to appreciate the real rise, progress, and history of
French criticism of the Neo-classic[541] type. The survey, whatever
difference may exist as to its justice in matter of opinion, will not, I
think, be found erring in matters of fact: and it will show that the
position usually accorded to Boileau requires some reconsideration.
But Boileau was undoubtedly the greatest man of letters who,
holding these views, devoted himself specially and definitely to the
expression of them; and, for good or for ill, his name is associated
with the movement. I agree with Keats,[542] who here, as in so many
other matters, came right by genius. Those of us who do not
possess this royal key can, at any rate, if we choose to take the
trouble, come right by knowledge.
The Quarrel of the Ancients and Moderns—though we have
spoken hard words of it—might look like revolt against the tyranny of
Despréaux, and it undoubtedly spread seeds of the more successful
revolution which followed; but the more one studies it, the more one
sees that the revolt was in the main unconscious. As we have partly
shown, and as might be shown much more fully, the Moderns were,
as a rule, just as “classical” in their ideas as the Ancients. They were
as incapable of catholic judgment; they were even more ignorant of
literature as a whole: they were at least as apt to introduce non-
literary criteria; they were as much under the obsession of the Kind,
the Rule (cast-iron, not leaden), the sweeping generalisation. Too
commonly the thing comes to this—that the man who can conjugate
tupto will not hear of anything which lessens the importance of that
gift, and that the man who cannot conjugate tupto will not hear of
any virtue attaching to it.
Most other countries require little notice here. The Germans make
practically no figure; the Dutch confine themselves to classical study
and the popularisation of reviewing; and the Spaniards, with
characteristic indolence, refuse to work out the interesting problem
presented to them by the recalcitrance of their national drama to the
consecrated ideas of the general creed. England is of more
importance. I have tried to show that it is of very much more; but
this importance belongs entirely to one man. This one man in his
time played many parts: and as the main aim of literature is to give
pleasure, and to produce original sources thereof, we cannot
perhaps say that his critical part was the greatest. But we may
almost say that it was the most important. We can imagine English
literature without the poetry of Dryden: it would be wofully
impoverished, but somebody would take up the burden, probably
before Pope. Certainly Pope would take it up, though with much
more to do. But English criticism, and, what is more, European
criticism of the best and most fruitful kind, would have had, if
Dryden had been absent, to seek some totally new source: and it is
impossible to tell where that source would have been found. There is
no precedent—Lilius Giraldus and Patrizzi between them might have
produced one in Italy, but it is of the highest significance that they
did not—for Dryden’s peculiar way of shaking different literatures
and different examples of literature together, of indicating the things
that please him in all, and of at least attempting to find out why they
please him. It is this, not his parade of Rules, and his gleanings from
the books, that makes his critical glory: and it is this in which,
among critics up to his own time, he is alone.
Yet even he does parade “rules”; even he does belaud Rapin, and
Le Bossu, and even Rymer; even he would have been, no doubt,
quite as ready to take the oath to Boileau as he was nobly
determined not to take it to William. His genius is recalcitrant to the
orthodoxy of the time; but something else in him accepts it. It is not
for nothing that he never published that word of power which
dissolves all the spells of Duessa—“Had Aristotle seen our plays he
might have changed his mind.”
That, however, there was, at any rate in the earlier part of the
time, much blind, and even a little conscious revolt against
classicism, independent of the Ancient and Modern quarrel, is not to
be wholly denied. I have hinted doubts as to the correctness of
regarding the Euphuist-Metaphysical extravagances in England,
Marinism in Italy, Gongorism in Spain, and the fantastic and
“precious” fancies which mark the reign of Louis XIII. and the
Fronde in France, as either deliberate reactions against classicism, or
abortive births and false dawns of Romance. They are in almost
every case direct results of the Romantic or mediæval side of the
earlier Renaissance—last things, not first. But, by the end of the
century, they were almost everywhere got well under; though in
Spain, their greatest stronghold, it was not till the eighteenth
century itself was some way advanced that Luzán administered the
critical miséricorde, or, if we must use the language of the country,
played despeñador to them. Any other interpretation of the
phenomena seems to me to distort them and make them
unintelligible, while the procession of the Metaphysical from the
Spenserian stage, of Marinism from Tasso, of Gongorism from the
great Spanish age, and of the French extravagants from the
Spaniards and Marino, working not a little on the Pléiade itself, is
natural, historical, and consistent with logic. But these very facts
prepare and lead up to the triumph of Neo-Classicism.
By dint, however, of these actions and interactions, there was
actually evolved, towards the end of the century, a sort of false
Florimel or Duessa, who was called Taste. She was rather a Protean
Goddess, and reflected the knowledge or the want of it, the real
taste or the want of it, possessed by her priests and worshippers.
The Taste of Dryden and the Taste of Rymer are two totally different
things; there is even a very considerable difference between the
taste of Hédelin and the taste of Bouhours. But in all save the very
happiest minds the Taste of this time, as far as Poetry is concerned
almost wholly, and to a great extent as regards prose, is vitiated by
all manner of mistaken assumptions, polluted by all manner of
foolish and hurtful idolatries. There is the Idol of the Kind which has
been noticed; the Idol of the Quality; the Idol of Good Sense, the
most devouring of all.[543] It is agreed, and agreed very pardonably,
that it is not well to write

“And periwig with snow the baldpate woods.”

But the baser folk go on from this—and all but the very noblest have
some difficulty in preventing themselves from going on—to think
that a man should not write

“The multitudinous seas incarnadine.”

There is a sense, and a very proper sense, that, in a certain general


way, style must suit subjects: that you ought not to write to a Child
of Quality, aged five, as you would do to Queen Anne, aged fifty.[544]
But this topples over into the most absurd limitations, so that, a little
later than our actual time, we shall find Pope taking modest credit to
himself with Spence for that, though Virgil in his Pastorals “has
sometimes six or eight lines together that are epic,” he had been so
scrupulous as “scarce ever to have two together, even in the
Messiah.” Indeed it is hardly possible to find a better reductio ad
absurdum of Neo-Classicism than this. You lay down (as we saw
long ago that Servius did lay it down), from a general induction of
the practice of a particular poet, such and such a rule about Virgil’s
styles in his various works. Then you turn this individual observation
into a general rule. And then you go near to find fault with the very
poet from whom you have derived it because he does not always
observe it—as if his unquestionable exceptions had not as much
authority as his supposed rules. Nor is there any doubt that this
fallacy derives colour and support from the false Good Sense, the
Pseudo-Reason. The induction from practice is hitched on to Reason
so as to become a deduction and a demonstration, and once
established as that, you deduce from it anything you like. Meanwhile
Good Sense, as complaisant to the critic as stern to the victim of his
criticism, will approve or disapprove anything that you choose to
approve or disapprove, will set her seal to any arbitrary decision, any
unjust or purblind whim, and can only be trusted with certainty to
set her face invariably against the highest poetry, and often against
certain kinds not so high.[545]
The result of all this is that, with the exception of Dryden and
somewhat later Fontenelle (see next Book), hardly any critics of the
time achieve, with any success, the highest function of the true critic
of literature, the discovery and celebration of beautiful literary
things. It is not their business, or their wish, to set free the “lovely
prisoned soul of Eucharis.” If Eucharis will get a ticket from the
patronesses of the contemporary Almack’s, and dress herself in the
prescribed uniform, and come up for judgment with the proper
courtesy, they will do her such justice as Minerva has enabled them
to do; but if not, not. Sometimes (as in the case of the immortal
Person of Quality who took the trouble to get Spenser into order[546])
they will good-naturedly endeavour to give her a better chance, poor
thing! But they will never kiss the Daughter of Hippocrates on the
mouth, and receive the reward thereto appropriated.[547]
That, on the other hand, there is observable, throughout the
century, a certain interpenetration of the older and more Romantic
spirit—in the creative work chiefly, but even there dying down, in the
critical overmastered from the first, and less and less perceptible,—
this opinion will meet with no contradiction here, but, on the
contrary, with the strongest support. All the eccentric phenomena, as
they may be called, which have been noticed from Euphuism to
Gongorism, are symptoms of this on the larger scale; and other
things—the fancy of Chapelain himself for the Romances, the
lingering attraction which Gongorism exercises even on such a man
as Bouhours—confirm it. Yet even this was, as has been said,
steadily dying down; and by the end of the century the old Phœnix
was nearly in ashes, though the new bird was to take slow rebirth
from them. I am myself inclined to think that the signs of Romantic
leaning in Dryden belong to the new, not to the old, chapter of
symptoms; and that in this way England, the last, save perhaps
Spain, to give up, was the first to feel again for, the standard of
Romanticism. But in this Dryden was in advance, not merely of all
his countrymen, but of all Europe; and he did not himself definitely
raise any flag of revolt. On the contrary, he always supposed himself
to be, and sometimes was, arguing for a reasonable and liberal
Classicism.
It was not in flippancy, but in logical connection with the present
subject, that attention was drawn above[548] to a certain aporia of
Tassoni’s on the admitted lovesomeness, body and soul, of le donne
brutte, and on the tricks which bruttezza and bellezza play to each
other. If that ingenious poet and polemic had but pushed his
inquiries a little further, and extended them in purview as well as
lineally, he might have come to great things in criticism. It might, for
instance, have struck him whether the accepted notions of literary
beauty were not peculiarly like those of physical beauty, which were
also those of his century. These laws laid it down that “from the chin
to the pit betwixt the collar-bones there must be two lengths of the
nose,” that the whole figure must be “ten faces high,” and that “the
inside of the arm, from the place where the muscle disappears to
the middle, is four noses”; while the careful calculators noted all the
while with dismay that both the Apollo Belvidere and the Medicean
Venus set these proportions at the most godlike defiance.[549] He
would (or he might) have observed that, just as when you have
settled exactly what a bella donna must not have, there is apt to
sail, or slip, into the room somebody with that particular
characteristic to whom you become a hopeless slave, so, when you
have settled the qualifications of the drama with the infallibility of
Hédelin, and those of the Epic with the finality of Le Bossu, there
comes you out some impudent production which is an admirable
poem, while the obedient begettings of your rules are worthless
rubbish. Tassoni, I say, might have done this; he seems to have had
quite the temper to do it; but he did it not. It was doubtless with
him, as with others, a case of Di terrent et Jupiter hostis—the gods
of their world and their time forbade them.
But the angry gods were not wholly able to maintain their anger;
and at the other end of the century, in that Quarrel of the Ancients
and Moderns which, for all its irritating ignorationes elenchi, did
certainly assist in the discussion of general æsthetic problems, we
find, among other glimpses, an advance, though only a partial
advance, on this suggestion of the Pensieri. Perrault, who doubtless
knew Tassoni (one of his brothers had translated the Secchia), has a
curious passage on the diversity of the forms of feminine beauty. He
had,[550] he says, visited the gallery of a connoisseur who had
collected portraits of the most famous beauties of Europe for a
century past. There were not two of the same type of loveliness;
and of the spectators there were not two who fixed on the same
portrait as the most beautiful. But Perrault, though he has had this
glimpse of the true path opened up to him, does not dare pursue it.
He is as convinced as the rest of them that you can reduce ideas of
beauty to a minimum which is always invariable, though you may
add others which vary; and he is perfectly arbitrary in his admissions
and exclusions of these latter. He hates Gothic architecture; it may
be strongly suspected that he would fall far short of Chapelain in
appreciating Romance, for all his fairy tales. His criticisms of the
Ancients belie his theory itself; for he will not open his eyes to see
the beauty of their peculiarity. His remarks on Homer are pitiable. My
always estimable and not seldom admirable predecessor, Blair, was
no doubt sadly “left to himself” when he selected,[551] as the awful
example of a man of bad taste, the person who said that Homer was
no better than “some old tale of chivalry.” But Perrault, I fear, is a
more terrible spectacle when he says that none of the Three
Tragedians will bear comparison with Corneille (and I think I may
claim the merit of not undervaluing Corneille), that nobody but
professed scholars can read Aristophanes, and that Ovid is the
inferior of Benserade. When we read these things—and except in
Fontenelle, the eternal exception, they are to be found in every
espouser of the Modern side, just as the corresponding absurdities
are to be found in every defender of the Ancients—there is nothing
to say but “This is all out of focus. Both of you see men as trees
walking.”
A summary of the whole merits and defects of neo-classicism
must again be postponed; though with no further prorogation than
to the end of the next Book and the present volume. As for the
special defects of this special period we have said enough; and we
may conclude this Interchapter with a glance at its special merits.
They are partly of a negative kind, but they certainly exist. In the
Middle Ages, as we have seen, there was no code of criticism at all;
in the sixteenth century only a growing approach to one, though the
approach had become very near at the last. Some outbreaks of
heterodoxy—the last stand of Romance for the time—had, as usually
happens, drawn the orthodox together, had made them sign a
definite, or almost definite, instrument or confession. Just or unjust,
adequate or inadequate, even consistent or inconsistent, as it may
be, from the point of view of a very searching and all-inspecting
logic, the neo-classicism of the late seventeenth century was a thing
about which there could be no mistake. It knew its own mind about
everything which it chose to consider, and valiantly shut its eyes to
everything which it chose to ignore. For a time—a short time only, of
course, for the triumph of a religion is always the signal for the
appearance of a heresy—the majority of people had not much more
doubt about what was the proper thing to believe in and admire in
literature, than they had about the multiplication table. It became
possible—and it was done, as we shall see, first in Italy, then
elsewhere—to write real literary histories: it became still more easily
possible to criticise new books on a certain basis of accepted
postulates. And it is by no means certain that this provisional
orthodoxy was not a necessary condition of the growth of the new
study of Æsthetic, which, though it has done criticism harm as well
as good, has certainly done it good as well as harm.
Nor is it possible to deny that there was something to admire in
the creed itself. It was weakest—it was in fact exceedingly weak—on
the poetical side; but the world happened to have accumulated a
remarkably good stock of poetry in the last two centuries or so, and
a fallow, or a cessation of manufacture, was not undesirable. Prose,
on the other hand, had never been got into proper order in the
vernaculars; and it was urgently desirable that it should be so got.
The very precepts of the classical creed which were most
mischievous in poetry were sovereign for prose. Here also they
might hinder the development of eccentric excellence; but it was not
eccentric excellence that was wanted. Unjust things have been said
about the poetry of the Augustan ages; just things may be said
against the criticism which mainly controlled that poetry. But it is
hardly excessive to say that every precept—not purely metrical—
contained in the Arts of Boileau and of Pope, is just and true for
Prose. You may fly in the face of almost every one of these precepts
and be the better poet for it; fly in the face of almost any one of
them in prose, and you must have extraordinary genius if you do not
rue it.
Even as to poetry itself some defence may be made. This poetry
needed these rules; or rather, to speak more critically, these rules
expressed the spirit of this poetry. The later and weaker
metaphysicals in England, and fantasts in France, the Marinists and
Gongorists in Spain and Italy, had shown what happens when Furor
[vere] Poeticus ceases to ply the oars, and Good Sense has not
come to take the helm. It is pretty certain that if this criticism had
not ruled we should not have had good or great Romantic poetry;
we should at best have had (to take England) a few more Dyers and
Lady Winchelseas. But if it had not ruled we should have had a less
perfect Pope and less presentable minorities of this kind, and have
been by no means consoled by a supply of eighteenth-century
Clevelands. Once more, the period has the criticism that it wants,
the criticism that will enable it to give us its own good things at their
own best, and to keep off things which must almost certainly have
been bad.

538. It may be doubted whether there is anything more wonderful


in Shakespeare than the way in which this Polonian speech, at one
slight side-blow, impales sixteenth-seventeenth-century criticism,
with the due pin, on the due piece of cork, for ever.

539. V. supra, p. 268.

540. The attitude of Milton and Dryden respectively illustrates this


well. There was scarcely more than twenty years between the two
poets. But Milton looks to the Italians first, if not also last, among
the moderns, for criticism. Dryden, though he knows and cites them,
does not.

541. “Neo-classic” itself is not a very “blessed” word; but it has


been long recognised, and the objections to it are mainly formal.

542. In the well-known and early lines on “Sleep and Poetry.”

543. Perhaps there is not a more unhappy gibe in literature (which


has many such) than that in The Rehearsal on Bayes, who is made
to say that “Spirits must not be confined to talk sense.” They
certainly must not; even Addison (Sp., 419) admits that “their sense
ought to be a little discoloured.” There is much virtue in this
“discolour.”

544. It may be said that this was later. But Prior was a man of
thirty-six in 1700.
545. Yet it is not for the twentieth century to throw stones at the
seventeenth, till we leave off laying down rules of our own
manufacture for still earlier ages, and reproving Marlowe and the
youthful Shakespeare for being “too lyrical” in tragedy.

546. See Spenser Redivivus. London, 1686-87. The Person of


Quality “delivers” Spenser “in Heroick numbers,” as per sample—

“Then to the lady gallant Arthur said,


All grief repeated is more grievous made.”
This is “what Spenser ought to have been instead of what is to be
found in himself.”

547. Dryden and Fontenelle themselves are of course not quite


sinless. The latter (v. infra, p. 505) proposes emendations in the
magnificent couplet which he cites from Saint-Louis; and Dryden, let
us say, does not improve Shakespeare and Chaucer. But it was on
Shakespeare and Chaucer as they were, not as he travestied them
for popular use, that Dryden passed the immortal eulogies; and
Fontenelle thought that the couplet even as it stood “might easily
not have been found by distinguished poets,” which is from him
equivalent to a blare of superlatives from our modern critics.

548. P. 325.

549. See the whole absurd scheme in the appendix-matter to


Dryden’s Translation of Du Fresnoy (ed. cit. sup., xvii. 429).

550. Parallèle, ii. 45; cf. Rigault, p. 187.

551. V. infra, p. 463.


Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like