From: Pedro Alves <palves@redhat.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2 v2] Add unit test to aarch64 prologue analyzer
Date: Fri, 02 Dec 2016 11:11:00 -0000 [thread overview]
Message-ID: <3b8cc428-0b99-ce5e-9937-1f0a73bca6ce@redhat.com> (raw)
In-Reply-To: <20161202094012.GD19289@E107787-LIN>
On 12/02/2016 09:40 AM, Yao Qi wrote:
> On Thu, Dec 01, 2016 at 06:05:30PM +0000, Pedro Alves wrote:
>>>
>>> I managed to get emacs indent at column 0 with the following changes in
>>> gdb/.dir-locals.el.
>>
>> That unfortunately somehow makes emacs indent members of classes
>> (even if not in a namespace) at column 0, like:
>>
>> struct foo
>> {
>> int a;
>> };
>>
>> Do you get that too?
>>
>
> Yes, :(
>
>> BTW, the don't-indent-body-of-namespace guideline is here:
>>
>> https://gcc.gnu.org/codingconventions.html#Namespace_Form
>>
>> and it does look like GCC generally follows it.
>
> I still can't get me emacs indent code inside namespace that way, but
> I manually fixed it. I'll ask gcc people how do they set emacs.
I have a custom c-mode on my ~/.emacs (predating gdb/.dir-locals.el),
and adding the namespace tweak there works correctly. Eh.
Like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(defun gdb-c-mode ()
"C mode with adjusted defaults for use with GDB."
(interactive)
(c++-mode)
(c-set-style "gnu")
(setq tab-width 8)
(setq indent-tabs-mode 1)
(setq c-basic-offset 2)
(c-set-offset 'innamespace 0)
)
(setq auto-mode-alist (cons '(".*/gdb.*/.*\\.[ch]$" . gdb-c-mode)
auto-mode-alist))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So if .dir-locals.el can't work for some reason, we could put
something like that in gdb/gdb-code-style.el.
Thanks,
Pedro Alves
prev parent reply other threads:[~2016-12-02 11:11 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-29 14:12 [PATCH 1/2] " Yao Qi
2016-11-29 14:12 ` [PATCH 2/2] [AArch64] Recognize STR instruction in prologue Yao Qi
2016-11-30 18:33 ` Pedro Alves
2016-11-29 14:58 ` [PATCH 1/2] Add unit test to aarch64 prologue analyzer Antoine Tremblay
2016-11-30 11:15 ` Yao Qi
2016-11-30 11:53 ` Antoine Tremblay
2016-11-30 16:35 ` Yao Qi
2016-11-30 16:42 ` Antoine Tremblay
2016-11-30 18:16 ` Pedro Alves
2016-11-30 18:29 ` Pedro Alves
2016-11-30 18:38 ` Pedro Alves
2016-11-30 19:30 ` Luis Machado
2016-12-01 12:53 ` Pedro Alves
2016-12-01 11:17 ` [PATCH 1/2 v2] " Yao Qi
2016-12-01 11:17 ` [PATCH 2/2 v2] [AArch64] Recognize STR instruction in prologue Yao Qi
2016-12-01 13:07 ` Pedro Alves
2016-12-02 9:42 ` Yao Qi
2016-12-01 12:57 ` [PATCH 1/2 v2] Add unit test to aarch64 prologue analyzer Pedro Alves
2016-12-01 15:21 ` Yao Qi
2016-12-01 16:04 ` Yao Qi
2016-12-01 18:05 ` Pedro Alves
2016-12-02 9:40 ` Yao Qi
2016-12-02 11:11 ` Pedro Alves [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3b8cc428-0b99-ce5e-9937-1f0a73bca6ce@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox