This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/3] MIPS h/w watchpoint in GDBserver
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 13 Jun 2013 15:44:30 +0100
- Subject: Re: [PATCH 3/3] MIPS h/w watchpoint in GDBserver
- References: <1369881867-11372-1-git-send-email-yao at codesourcery dot com> <1369881867-11372-4-git-send-email-yao at codesourcery dot com> <51B9468A dot 5070900 at codesourcery dot com>
On 06/13/2013 05:11 AM, Yao Qi wrote:
> On 05/30/2013 10:44 AM, Yao Qi wrote:
>> @@ -20,6 +20,7 @@
>> #include "linux-low.h"
>>
>> #include <sys/ptrace.h>
>> +#include "mips-linux-watch.h"
>> #include <endian.h>
>>
>> #include "gdb_proc_service.h"
>
> Pedro mentioned that there are "unexplained odd placements for
> includes", however, the only 'oddity' I can see is the order of include
> mips-linux-watch.h and endian.h. In this version, I exchange the order
> of them.
Thanks. Yes, that's the oddity I was referring to, specifically:
#include <system header>
#include "local header"
#include <system header>
#include "local header"
IMO, it's better to keep system header includes all together, and
local includes all together (though we're not that good at doing that).
With that in mind, given the odd placement for "mips-linux-watch.h" between
two system headers, I wondered whether there was something
in "mips-linux-watch.h" or <endian.h> that made that particular placement
necessary, and if so, that should be explained, hence my "unexplained".
(IMO2, I'd go as far as saying that it's better to put system includes
after local includes, in order to prevent hidden dependencies in our
headers, following the principle that headers should be self contained,
but pull in the least dependencies possible with forward declarations
for opaque types, etc., and compileable on their own.)
--
Pedro Alves