Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tim Wiederhake <tim.wiederhake@intel.com>
To: gdb-patches@sourceware.org
Cc: markus.t.metzger@intel.com, brobecker@adacore.com, qiyaoltc@gmail.com
Subject: [PATCH v2 1/8] Python: Fix indentation in py-record-btrace.c
Date: Fri, 21 Apr 2017 10:50:00 -0000	[thread overview]
Message-ID: <1492771786-26372-2-git-send-email-tim.wiederhake@intel.com> (raw)
In-Reply-To: <1492771786-26372-1-git-send-email-tim.wiederhake@intel.com>

2017-04-21  Tim Wiederhake  <tim.wiederhake@intel.com>

gdb/ChangeLog:
	* python/py-record-btrace.c (BTPY_REQUIRE_VALID_INSN,
	BTPY_REQUIRE_VALID_CALL, recpy_bt_function_call_history): Fix
	indentation.

---
 gdb/python/py-record-btrace.c | 60 +++++++++++++++++++++----------------------
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/gdb/python/py-record-btrace.c b/gdb/python/py-record-btrace.c
index c816332..0f8d7ef 100644
--- a/gdb/python/py-record-btrace.c
+++ b/gdb/python/py-record-btrace.c
@@ -36,24 +36,24 @@
 #endif
 
 #define BTPY_REQUIRE_VALID_INSN(obj, iter)				\
-    do {								\
-      struct thread_info *tinfo = find_thread_ptid (obj->ptid);		\
-      if (tinfo == NULL || btrace_is_empty (tinfo))			\
-	return PyErr_Format (gdbpy_gdb_error, _("Empty branch trace."));\
-      if (0 == btrace_find_insn_by_number (&iter, &tinfo->btrace,	\
-					   obj->number))		\
-	return PyErr_Format (gdbpy_gdb_error, _("No such instruction."));\
-    } while (0)
+  do {									\
+    struct thread_info *tinfo = find_thread_ptid (obj->ptid);		\
+    if (tinfo == NULL || btrace_is_empty (tinfo))			\
+      return PyErr_Format (gdbpy_gdb_error, _("Empty branch trace."));	\
+    if (0 == btrace_find_insn_by_number (&iter, &tinfo->btrace,		\
+					 obj->number))			\
+      return PyErr_Format (gdbpy_gdb_error, _("No such instruction."));	\
+  } while (0)
 
 #define BTPY_REQUIRE_VALID_CALL(obj, iter)				\
-    do {								\
-      struct thread_info *tinfo = find_thread_ptid (obj->ptid);		\
-      if (tinfo == NULL || btrace_is_empty (tinfo))			\
-	return PyErr_Format (gdbpy_gdb_error, _("Empty branch trace."));\
-      if (0 == btrace_find_call_by_number (&iter, &tinfo->btrace,	\
-					   obj->number))		\
-	return PyErr_Format (gdbpy_gdb_error, _("No such call segment."));\
-    } while (0)
+  do {									\
+    struct thread_info *tinfo = find_thread_ptid (obj->ptid);		\
+    if (tinfo == NULL || btrace_is_empty (tinfo))			\
+      return PyErr_Format (gdbpy_gdb_error, _("Empty branch trace."));	\
+    if (0 == btrace_find_call_by_number (&iter, &tinfo->btrace,		\
+					 obj->number))			\
+      return PyErr_Format (gdbpy_gdb_error, _("No such call segment."));\
+  } while (0)
 
 /* This can either be a btrace instruction or a function call segment,
    depending on the chosen type.  */
@@ -842,26 +842,26 @@ recpy_bt_instruction_history (PyObject *self, void *closure)
 PyObject *
 recpy_bt_function_call_history (PyObject *self, void *closure)
 {
-    struct thread_info * const tinfo = find_thread_ptid (inferior_ptid);
-    struct btrace_call_iterator iterator;
-    unsigned long first = 0;
-    unsigned long last = 0;
+  struct thread_info * const tinfo = find_thread_ptid (inferior_ptid);
+  struct btrace_call_iterator iterator;
+  unsigned long first = 0;
+  unsigned long last = 0;
 
-    if (tinfo == NULL)
-      Py_RETURN_NONE;
+  if (tinfo == NULL)
+    Py_RETURN_NONE;
 
-    btrace_fetch (tinfo);
+  btrace_fetch (tinfo);
 
-    if (btrace_is_empty (tinfo))
-      Py_RETURN_NONE;
+  if (btrace_is_empty (tinfo))
+    Py_RETURN_NONE;
 
-    btrace_call_begin (&iterator, &tinfo->btrace);
-    first = btrace_call_number (&iterator);
+  btrace_call_begin (&iterator, &tinfo->btrace);
+  first = btrace_call_number (&iterator);
 
-    btrace_call_end (&iterator, &tinfo->btrace);
-    last = btrace_call_number (&iterator);
+  btrace_call_end (&iterator, &tinfo->btrace);
+  last = btrace_call_number (&iterator);
 
-    return btpy_list_new (inferior_ptid, first, last, 1, &btpy_call_type);
+  return btpy_list_new (inferior_ptid, first, last, 1, &btpy_call_type);
 }
 
 /* Implementation of BtraceRecord.goto (self, BtraceInstruction) -> None.  */
-- 
2.7.4


  parent reply	other threads:[~2017-04-21 10:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 10:50 [PATCH v2 0/8] Python bindings for GDB record Tim Wiederhake
2017-04-21 10:50 ` [PATCH v2 2/8] Python: Fix exception handling in py-record-btrace.c Tim Wiederhake
2017-04-21 18:08   ` Yao Qi
2017-04-27 16:35   ` Pedro Alves
2017-04-21 10:50 ` [PATCH v2 5/8] Python: Introduce gdb.RecordGap class Tim Wiederhake
2017-04-21 12:25   ` Eli Zaretskii
2017-04-21 14:50   ` Yao Qi
2017-04-21 10:50 ` [PATCH v2 6/8] Python: Move and rename gdb.BtraceInstruction Tim Wiederhake
2017-04-21 12:23   ` Eli Zaretskii
2017-04-21 15:21   ` Yao Qi
2017-04-21 10:50 ` [PATCH v2 3/8] Python: Use correct ptid in btrace recording Tim Wiederhake
2017-04-21 14:49   ` Yao Qi
2017-04-21 10:50 ` Tim Wiederhake [this message]
2017-04-21 10:50 ` [PATCH v2 8/8] Python: Introduce gdb.Instruction class Tim Wiederhake
2017-04-21 12:19   ` Eli Zaretskii
2017-04-24  5:34     ` Wiederhake, Tim
2017-04-21 18:10   ` Yao Qi
2017-04-21 10:50 ` [PATCH v2 4/8] Python: Remove ptid from gdb.Record interface Tim Wiederhake
2017-04-21 12:20   ` Eli Zaretskii
2017-04-21 10:50 ` [PATCH v2 7/8] Python: Move and rename gdb.BtraceFunction Tim Wiederhake
2017-04-21 12:22   ` Eli Zaretskii
2017-04-21 16:41   ` Yao Qi

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=1492771786-26372-2-git-send-email-tim.wiederhake@intel.com \
    --to=tim.wiederhake@intel.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=markus.t.metzger@intel.com \
    --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