I seem to recall hearing in the past that an x86 program can detect whether it is being debugged. This was related to malware analysis.
Yet researching registers, I read up on the DRs and found the statement:
The debug registers are privileged resources; the MOV instructions that access them can only be executed at privilege level zero. An attempt to read or write the debug registers when executing at any other privilege level causes a general protection fault.
So, could someone explain perhaps if there is some alternative feature in x86 that allows a program to become aware that it is being debugged? I think I recall reading something about debuggers actually patching things into a program's instruction memory, but I'm not yet sure (I haven't had time to study the inner workings of a debugger yet).
Could someone clarify whether there is a fundamental feature of x86 that leaks information suggesting the attachment of a debugger to a program? Or perhaps it's just due to something more invasive debuggers might be doing?