aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-arch.c56
-rw-r--r--gdb/python/py-bpevent.c8
-rw-r--r--gdb/python/py-event.c4
-rw-r--r--gdb/python/py-event.h8
-rw-r--r--gdb/python/py-finishbreakpoint.c124
-rw-r--r--gdb/python/py-frame.c2
-rw-r--r--gdb/python/py-framefilter.c4
-rw-r--r--gdb/python/py-inferior.c4
-rw-r--r--gdb/python/py-infthread.c2
-rw-r--r--gdb/python/py-objfile.c4
-rw-r--r--gdb/python/py-prettyprint.c8
-rw-r--r--gdb/python/py-registers.c4
-rw-r--r--gdb/python/py-signalevent.c4
-rw-r--r--gdb/python/py-stopevent.c28
-rw-r--r--gdb/python/py-stopevent.h2
-rw-r--r--gdb/python/py-threadevent.c4
-rw-r--r--gdb/python/py-tui.c4
-rw-r--r--gdb/python/py-unwind.c158
-rw-r--r--gdb/python/py-value.c36
-rw-r--r--gdb/python/py-xmethods.c2
-rw-r--r--gdb/python/python-internal.h20
-rw-r--r--gdb/python/python.c24
22 files changed, 255 insertions, 255 deletions
diff --git a/gdb/python/py-arch.c b/gdb/python/py-arch.c
index 3f8e769..ec955e7 100644
--- a/gdb/python/py-arch.c
+++ b/gdb/python/py-arch.c
@@ -138,41 +138,41 @@ archpy_disassemble (PyObject *self, PyObject *args, PyObject *kw)
to be done first to ensure we do not lose information in the
conversion process. */
if (PyLong_Check (end_obj))
- end = PyLong_AsUnsignedLongLong (end_obj);
+ end = PyLong_AsUnsignedLongLong (end_obj);
#if PY_MAJOR_VERSION == 2
else if (PyInt_Check (end_obj))
- /* If the end_pc value is specified without a trailing 'L', end_obj will
- be an integer and not a long integer. */
- end = PyInt_AsLong (end_obj);
+ /* If the end_pc value is specified without a trailing 'L', end_obj will
+ be an integer and not a long integer. */
+ end = PyInt_AsLong (end_obj);
#endif
else
- {
- PyErr_SetString (PyExc_TypeError,
- _("Argument 'end_pc' should be a (long) integer."));
+ {
+ PyErr_SetString (PyExc_TypeError,
+ _("Argument 'end_pc' should be a (long) integer."));
- return NULL;
- }
+ return NULL;
+ }
if (end < start)
- {
- PyErr_SetString (PyExc_ValueError,
- _("Argument 'end_pc' should be greater than or "
- "equal to the argument 'start_pc'."));
+ {
+ PyErr_SetString (PyExc_ValueError,
+ _("Argument 'end_pc' should be greater than or "
+ "equal to the argument 'start_pc'."));
- return NULL;
- }
+ return NULL;
+ }
}
if (count_obj)
{
count = PyInt_AsLong (count_obj);
if (PyErr_Occurred () || count < 0)
- {
- PyErr_SetString (PyExc_TypeError,
- _("Argument 'count' should be an non-negative "
- "integer."));
+ {
+ PyErr_SetString (PyExc_TypeError,
+ _("Argument 'count' should be an non-negative "
+ "integer."));
- return NULL;
- }
+ return NULL;
+ }
}
gdbpy_ref<> result_list (PyList_New (0));
@@ -200,14 +200,14 @@ archpy_disassemble (PyObject *self, PyObject *args, PyObject *kw)
string_file stb;
try
- {
- insn_len = gdb_print_insn (gdbarch, pc, &stb, NULL);
- }
+ {
+ insn_len = gdb_print_insn (gdbarch, pc, &stb, NULL);
+ }
catch (const gdb_exception &except)
- {
+ {
gdbpy_convert_exception (except);
return NULL;
- }
+ }
gdbpy_ref<> pc_obj = gdb_py_object_from_ulongest (pc);
if (pc_obj == nullptr)
@@ -224,8 +224,8 @@ archpy_disassemble (PyObject *self, PyObject *args, PyObject *kw)
return nullptr;
if (PyDict_SetItemString (insn_dict.get (), "addr", pc_obj.get ())
- || PyDict_SetItemString (insn_dict.get (), "asm", asm_obj.get ())
- || PyDict_SetItemString (insn_dict.get (), "length", len_obj.get ()))
+ || PyDict_SetItemString (insn_dict.get (), "asm", asm_obj.get ())
+ || PyDict_SetItemString (insn_dict.get (), "length", len_obj.get ()))
return NULL;
pc += insn_len;
diff --git a/gdb/python/py-bpevent.c b/gdb/python/py-bpevent.c
index d88c6a0..59849a0 100644
--- a/gdb/python/py-bpevent.c
+++ b/gdb/python/py-bpevent.c
@@ -33,12 +33,12 @@ create_breakpoint_event_object (PyObject *breakpoint_list, PyObject *first_bp)
return NULL;
if (evpy_add_attribute (breakpoint_event_obj.get (),
- "breakpoint",
- first_bp) < 0)
+ "breakpoint",
+ first_bp) < 0)
return NULL;
if (evpy_add_attribute (breakpoint_event_obj.get (),
- "breakpoints",
- breakpoint_list) < 0)
+ "breakpoints",
+ breakpoint_list) < 0)
return NULL;
return breakpoint_event_obj;
diff --git a/gdb/python/py-event.c b/gdb/python/py-event.c
index fb6672a..64b4178 100644
--- a/gdb/python/py-event.c
+++ b/gdb/python/py-event.c
@@ -67,7 +67,7 @@ gdbpy_initialize_event (void)
int
gdbpy_initialize_event_generic (PyTypeObject *type,
- const char *name)
+ const char *name)
{
if (PyType_Ready (type) < 0)
return -1;
@@ -81,7 +81,7 @@ gdbpy_initialize_event_generic (PyTypeObject *type,
int
evpy_emit_event (PyObject *event,
- eventregistry_object *registry)
+ eventregistry_object *registry)
{
Py_ssize_t i;
diff --git a/gdb/python/py-event.h b/gdb/python/py-event.h
index 37426f6..92a71f6 100644
--- a/gdb/python/py-event.h
+++ b/gdb/python/py-event.h
@@ -28,7 +28,7 @@
/* Declare all event types. */
#define GDB_PY_DEFINE_EVENT_TYPE(name, py_name, doc, base) \
extern PyTypeObject name##_event_object_type \
- CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("event_object");
+ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("event_object");
#include "py-event-types.def"
#undef GDB_PY_DEFINE_EVENT_TYPE
@@ -56,10 +56,10 @@ typedef enum
extern int emit_inferior_call_event (inferior_call_kind kind,
ptid_t thread, CORE_ADDR addr);
extern int emit_register_changed_event (struct frame_info *frame,
- int regnum);
+ int regnum);
extern int emit_memory_changed_event (CORE_ADDR addr, ssize_t len);
extern int evpy_emit_event (PyObject *event,
- eventregistry_object *registry);
+ eventregistry_object *registry);
extern gdbpy_ref<> create_event_object (PyTypeObject *py_type);
@@ -78,7 +78,7 @@ extern int emit_clear_objfiles_event (void);
extern void evpy_dealloc (PyObject *self);
extern int evpy_add_attribute (PyObject *event,
- const char *name, PyObject *attr)
+ const char *name, PyObject *attr)
CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION;
int gdbpy_initialize_event_generic (PyTypeObject *type, const char *name)
CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION;
diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c
index 4badcd5..3844af6 100644
--- a/gdb/python/py-finishbreakpoint.c
+++ b/gdb/python/py-finishbreakpoint.c
@@ -78,7 +78,7 @@ static void
bpfinishpy_dealloc (PyObject *self)
{
struct finish_breakpoint_object *self_bpfinish =
- (struct finish_breakpoint_object *) self;
+ (struct finish_breakpoint_object *) self;
Py_XDECREF (self_bpfinish->function_value);
Py_XDECREF (self_bpfinish->return_type);
@@ -94,7 +94,7 @@ void
bpfinishpy_pre_stop_hook (struct gdbpy_breakpoint_object *bp_obj)
{
struct finish_breakpoint_object *self_finishbp =
- (struct finish_breakpoint_object *) bp_obj;
+ (struct finish_breakpoint_object *) bp_obj;
/* Can compute return_value only once. */
gdb_assert (!self_finishbp->return_value);
@@ -105,22 +105,22 @@ bpfinishpy_pre_stop_hook (struct gdbpy_breakpoint_object *bp_obj)
try
{
struct value *function =
- value_object_to_value (self_finishbp->function_value);
+ value_object_to_value (self_finishbp->function_value);
struct type *value_type =
- type_object_to_type (self_finishbp->return_type);
+ type_object_to_type (self_finishbp->return_type);
struct value *ret = get_return_value (function, value_type);
if (ret)
- {
- self_finishbp->return_value = value_to_value_object (ret);
- if (!self_finishbp->return_value)
- gdbpy_print_stack ();
- }
+ {
+ self_finishbp->return_value = value_to_value_object (ret);
+ if (!self_finishbp->return_value)
+ gdbpy_print_stack ();
+ }
else
- {
- Py_INCREF (Py_None);
- self_finishbp->return_value = Py_None;
- }
+ {
+ Py_INCREF (Py_None);
+ self_finishbp->return_value = Py_None;
+ }
}
catch (const gdb_exception &except)
{
@@ -221,7 +221,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
if (inferior_ptid == null_ptid)
{
PyErr_SetString (PyExc_ValueError,
- _("No thread currently selected."));
+ _("No thread currently selected."));
return -1;
}
@@ -231,11 +231,11 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
{
internal_bp = PyObject_IsTrue (internal);
if (internal_bp == -1)
- {
- PyErr_SetString (PyExc_ValueError,
- _("The value of `internal' must be a boolean."));
- return -1;
- }
+ {
+ PyErr_SetString (PyExc_ValueError,
+ _("The value of `internal' must be a boolean."));
+ return -1;
+ }
}
/* Find the function we will return from. */
@@ -245,28 +245,28 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
try
{
if (get_frame_pc_if_available (frame, &pc))
- {
- function = find_pc_function (pc);
- if (function != NULL)
- {
- struct type *ret_type =
+ {
+ function = find_pc_function (pc);
+ if (function != NULL)
+ {
+ struct type *ret_type =
check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (function)));
- /* Remember only non-void return types. */
- if (ret_type->code () != TYPE_CODE_VOID)
- {
- struct value *func_value;
-
- /* Ignore Python errors at this stage. */
- self_bpfinish->return_type = type_to_type_object (ret_type);
- PyErr_Clear ();
- func_value = read_var_value (function, NULL, frame);
- self_bpfinish->function_value =
- value_to_value_object (func_value);
- PyErr_Clear ();
- }
- }
- }
+ /* Remember only non-void return types. */
+ if (ret_type->code () != TYPE_CODE_VOID)
+ {
+ struct value *func_value;
+
+ /* Ignore Python errors at this stage. */
+ self_bpfinish->return_type = type_to_type_object (ret_type);
+ PyErr_Clear ();
+ func_value = read_var_value (function, NULL, frame);
+ self_bpfinish->function_value =
+ value_to_value_object (func_value);
+ PyErr_Clear ();
+ }
+ }
+ }
}
catch (const gdb_exception &except)
{
@@ -294,14 +294,14 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
event_location_up location
= new_address_location (get_frame_pc (prev_frame), NULL, 0);
create_breakpoint (python_gdbarch,
- location.get (), NULL, thread, NULL,
- 0,
- 1 /*temp_flag*/,
- bp_breakpoint,
- 0,
- AUTO_BOOLEAN_TRUE,
- &bkpt_breakpoint_ops,
- 0, 1, internal_bp, 0);
+ location.get (), NULL, thread, NULL,
+ 0,
+ 1 /*temp_flag*/,
+ bp_breakpoint,
+ 0,
+ AUTO_BOOLEAN_TRUE,
+ &bkpt_breakpoint_ops,
+ 0, 1, internal_bp, 0);
}
catch (const gdb_exception &except)
{
@@ -353,24 +353,24 @@ bpfinishpy_detect_out_scope_cb (struct breakpoint *b,
if (py_bp != NULL && b->py_bp_object->is_finish_bp)
{
struct finish_breakpoint_object *finish_bp =
- (struct finish_breakpoint_object *) py_bp;
+ (struct finish_breakpoint_object *) py_bp;
/* Check scope if not currently stopped at the FinishBreakpoint. */
if (b != bp_stopped)
- {
- try
- {
- if (b->pspace == current_inferior ()->pspace
- && (!target_has_registers ()
- || frame_find_by_id (b->frame_id) == NULL))
- bpfinishpy_out_of_scope (finish_bp);
- }
- catch (const gdb_exception &except)
- {
- gdbpy_convert_exception (except);
- gdbpy_print_stack ();
- }
- }
+ {
+ try
+ {
+ if (b->pspace == current_inferior ()->pspace
+ && (!target_has_registers ()
+ || frame_find_by_id (b->frame_id) == NULL))
+ bpfinishpy_out_of_scope (finish_bp);
+ }
+ catch (const gdb_exception &except)
+ {
+ gdbpy_convert_exception (except);
+ gdbpy_print_stack ();
+ }
+ }
}
return 0;
diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c
index 24d4fae..6f0bb8e 100644
--- a/gdb/python/py-frame.c
+++ b/gdb/python/py-frame.c
@@ -264,7 +264,7 @@ frapy_read_register (PyObject *self, PyObject *args)
val = value_of_register (regnum, frame);
if (val == NULL)
- PyErr_SetString (PyExc_ValueError, _("Can't read register."));
+ PyErr_SetString (PyExc_ValueError, _("Can't read register."));
}
catch (const gdb_exception &except)
{
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
index d0348b5..944a0ee 100644
--- a/gdb/python/py-framefilter.c
+++ b/gdb/python/py-framefilter.c
@@ -1013,8 +1013,8 @@ py_print_frame (PyObject *filter, frame_filter_flags flags,
}
}
if (out->is_mi_like_p ())
- out->field_string ("arch",
- (gdbarch_bfd_arch_info (gdbarch))->printable_name);
+ out->field_string ("arch",
+ (gdbarch_bfd_arch_info (gdbarch))->printable_name);
}
bool source_print
diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c
index 7204356..102a427 100644
--- a/gdb/python/py-inferior.c
+++ b/gdb/python/py-inferior.c
@@ -756,7 +756,7 @@ infpy_is_valid (PyObject *self, PyObject *args)
}
/* Implementation of gdb.Inferior.thread_from_handle (self, handle)
- -> gdb.InferiorThread. */
+ -> gdb.InferiorThread. */
static PyObject *
infpy_thread_from_thread_handle (PyObject *self, PyObject *args, PyObject *kw)
@@ -801,7 +801,7 @@ infpy_thread_from_thread_handle (PyObject *self, PyObject *args, PyObject *kw)
struct thread_info *thread_info;
thread_info = find_thread_by_handle
- (gdb::array_view<const gdb_byte> (bytes, bytes_len),
+ (gdb::array_view<const gdb_byte> (bytes, bytes_len),
inf_obj->inferior);
if (thread_info != NULL)
return thread_to_thread_object (thread_info).release ();
diff --git a/gdb/python/py-infthread.c b/gdb/python/py-infthread.c
index fec7bca..089ea22 100644
--- a/gdb/python/py-infthread.c
+++ b/gdb/python/py-infthread.c
@@ -286,7 +286,7 @@ thpy_thread_handle (PyObject *self, PyObject *args)
}
PyObject *object = PyBytes_FromStringAndSize ((const char *) hv.data (),
- hv.size());
+ hv.size());
return object;
}
diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c
index 205da8b..a006eb3 100644
--- a/gdb/python/py-objfile.c
+++ b/gdb/python/py-objfile.c
@@ -453,7 +453,7 @@ objfpy_lookup_global_symbol (PyObject *self, PyObject *args, PyObject *kw)
try
{
struct symbol *sym = lookup_global_symbol_from_objfile
- (obj->objfile, GLOBAL_BLOCK, symbol_name, (domain_enum) domain).symbol;
+ (obj->objfile, GLOBAL_BLOCK, symbol_name, (domain_enum) domain).symbol;
if (sym == nullptr)
Py_RETURN_NONE;
@@ -487,7 +487,7 @@ objfpy_lookup_static_symbol (PyObject *self, PyObject *args, PyObject *kw)
try
{
struct symbol *sym = lookup_global_symbol_from_objfile
- (obj->objfile, STATIC_BLOCK, symbol_name, (domain_enum) domain).symbol;
+ (obj->objfile, STATIC_BLOCK, symbol_name, (domain_enum) domain).symbol;
if (sym == nullptr)
Py_RETURN_NONE;
diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
index 7cb20df..8eaa41f 100644
--- a/gdb/python/py-prettyprint.c
+++ b/gdb/python/py-prettyprint.c
@@ -438,10 +438,10 @@ print_children (PyObject *printer, const char *hint,
3. Other. Always print a ",". */
if (i == 0)
{
- if (is_py_none)
- fputs_filtered ("{", stream);
- else
- fputs_filtered (" = {", stream);
+ if (is_py_none)
+ fputs_filtered ("{", stream);
+ else
+ fputs_filtered (" = {", stream);
}
else if (! is_map || i % 2 == 0)
diff --git a/gdb/python/py-registers.c b/gdb/python/py-registers.c
index 516d43d..d7b876b 100644
--- a/gdb/python/py-registers.c
+++ b/gdb/python/py-registers.c
@@ -395,13 +395,13 @@ gdbpy_parse_register_id (struct gdbarch *gdbarch, PyObject *pyo_reg_id,
{
long value;
if (gdb_py_int_as_long (pyo_reg_id, &value) && (int) value == value)
- {
+ {
if (user_reg_map_regnum_to_name (gdbarch, value) != NULL)
{
*reg_num = (int) value;
return true;
}
- }
+ }
}
/* The register could be a gdb.RegisterDescriptor object. */
else if (PyObject_IsInstance (pyo_reg_id,
diff --git a/gdb/python/py-signalevent.c b/gdb/python/py-signalevent.c
index 7b0b5e2..69db8ce 100644
--- a/gdb/python/py-signalevent.c
+++ b/gdb/python/py-signalevent.c
@@ -35,8 +35,8 @@ create_signal_event_object (enum gdb_signal stop_signal)
if (signal_name_obj == NULL)
return NULL;
if (evpy_add_attribute (signal_event_obj.get (),
- "stop_signal",
- signal_name_obj.get ()) < 0)
+ "stop_signal",
+ signal_name_obj.get ()) < 0)
return NULL;
return signal_event_obj;
diff --git a/gdb/python/py-stopevent.c b/gdb/python/py-stopevent.c
index 98c8b20..e83d85f 100644
--- a/gdb/python/py-stopevent.c
+++ b/gdb/python/py-stopevent.c
@@ -49,24 +49,24 @@ emit_stop_event (struct bpstats *bs, enum gdb_signal stop_signal)
for (current_bs = bs; current_bs != NULL; current_bs = current_bs->next)
{
if (current_bs->breakpoint_at
- && current_bs->breakpoint_at->py_bp_object)
- {
- PyObject *current_py_bp =
- (PyObject *) current_bs->breakpoint_at->py_bp_object;
-
- if (list == NULL)
- {
- list.reset (PyList_New (0));
- if (list == NULL)
+ && current_bs->breakpoint_at->py_bp_object)
+ {
+ PyObject *current_py_bp =
+ (PyObject *) current_bs->breakpoint_at->py_bp_object;
+
+ if (list == NULL)
+ {
+ list.reset (PyList_New (0));
+ if (list == NULL)
return -1;
- }
+ }
- if (PyList_Append (list.get (), current_py_bp))
+ if (PyList_Append (list.get (), current_py_bp))
return -1;
- if (first_bp == NULL)
- first_bp = current_py_bp;
- }
+ if (first_bp == NULL)
+ first_bp = current_py_bp;
+ }
}
if (list != NULL)
diff --git a/gdb/python/py-stopevent.h b/gdb/python/py-stopevent.h
index 9a5ab02..fdb16fd 100644
--- a/gdb/python/py-stopevent.h
+++ b/gdb/python/py-stopevent.h
@@ -26,7 +26,7 @@ extern gdbpy_ref<> create_stop_event_object (PyTypeObject *py_type);
extern void stop_evpy_dealloc (PyObject *self);
extern int emit_stop_event (struct bpstats *bs,
- enum gdb_signal stop_signal);
+ enum gdb_signal stop_signal);
extern gdbpy_ref<> create_breakpoint_event_object (PyObject *breakpoint_list,
PyObject *first_bp);
diff --git a/gdb/python/py-threadevent.c b/gdb/python/py-threadevent.c
index 3be86b7..e33c228 100644
--- a/gdb/python/py-threadevent.c
+++ b/gdb/python/py-threadevent.c
@@ -48,8 +48,8 @@ create_thread_event_object (PyTypeObject *py_type, PyObject *thread)
return NULL;
if (evpy_add_attribute (thread_event_obj.get (),
- "inferior_thread",
- thread) < 0)
+ "inferior_thread",
+ thread) < 0)
return NULL;
return thread_event_obj;
diff --git a/gdb/python/py-tui.c b/gdb/python/py-tui.c
index 58f9c5e..87065ea 100644
--- a/gdb/python/py-tui.c
+++ b/gdb/python/py-tui.c
@@ -345,8 +345,8 @@ gdbpy_register_tui_window (PyObject *self, PyObject *args, PyObject *kw)
#define REQUIRE_WINDOW(Window) \
do { \
if ((Window)->window == nullptr) \
- return PyErr_Format (PyExc_RuntimeError, \
- _("TUI window is invalid.")); \
+ return PyErr_Format (PyExc_RuntimeError, \
+ _("TUI window is invalid.")); \
} while (0)
/* Python function which checks the validity of a TUI window
diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c
index 55d6a31..4571ef6 100644
--- a/gdb/python/py-unwind.c
+++ b/gdb/python/py-unwind.c
@@ -112,11 +112,11 @@ pyuw_value_obj_to_pointer (PyObject *pyo_value, CORE_ADDR *addr)
try
{
if ((value = value_object_to_value (pyo_value)) != NULL)
- {
- *addr = unpack_pointer (value_type (value),
- value_contents (value));
- rc = 1;
- }
+ {
+ *addr = unpack_pointer (value_type (value),
+ value_contents (value));
+ rc = 1;
+ }
}
catch (const gdb_exception &except)
{
@@ -133,7 +133,7 @@ pyuw_value_obj_to_pointer (PyObject *pyo_value, CORE_ADDR *addr)
static int
pyuw_object_attribute_to_pointer (PyObject *pyo, const char *attr_name,
- CORE_ADDR *addr)
+ CORE_ADDR *addr)
{
int rc = 0;
@@ -142,14 +142,14 @@ pyuw_object_attribute_to_pointer (PyObject *pyo, const char *attr_name,
gdbpy_ref<> pyo_value (PyObject_GetAttrString (pyo, attr_name));
if (pyo_value != NULL && pyo_value != Py_None)
- {
- rc = pyuw_value_obj_to_pointer (pyo_value.get (), addr);
- if (!rc)
- PyErr_Format (
- PyExc_ValueError,
- _("The value of the '%s' attribute is not a pointer."),
- attr_name);
- }
+ {
+ rc = pyuw_value_obj_to_pointer (pyo_value.get (), addr);
+ if (!rc)
+ PyErr_Format (
+ PyExc_ValueError,
+ _("The value of the '%s' attribute is not a pointer."),
+ attr_name);
+ }
}
return rc;
}
@@ -173,24 +173,24 @@ unwind_infopy_str (PyObject *self)
stb.printf ("\nSaved registers: (");
for (const saved_reg &reg : *unwind_info->saved_regs)
{
- struct value *value = value_object_to_value (reg.value.get ());
-
- stb.printf ("%s(%d, ", sep, reg.number);
- if (value != NULL)
- {
- try
- {
- value_print (value, &stb, &opts);
- stb.puts (")");
- }
- catch (const gdb_exception &except)
- {
- GDB_PY_HANDLE_EXCEPTION (except);
- }
- }
- else
- stb.puts ("<BAD>)");
- sep = ", ";
+ struct value *value = value_object_to_value (reg.value.get ());
+
+ stb.printf ("%s(%d, ", sep, reg.number);
+ if (value != NULL)
+ {
+ try
+ {
+ value_print (value, &stb, &opts);
+ stb.puts (")");
+ }
+ catch (const gdb_exception &except)
+ {
+ GDB_PY_HANDLE_EXCEPTION (except);
+ }
+ }
+ else
+ stb.puts ("<BAD>)");
+ sep = ", ";
}
stb.puts (")");
}
@@ -203,7 +203,7 @@ unwind_infopy_str (PyObject *self)
static PyObject *
pyuw_create_unwind_info (PyObject *pyo_pending_frame,
- struct frame_id frame_id)
+ struct frame_id frame_id)
{
unwind_info_object *unwind_info
= PyObject_New (unwind_info_object, &unwind_info_object_type);
@@ -211,7 +211,7 @@ pyuw_create_unwind_info (PyObject *pyo_pending_frame,
if (((pending_frame_object *) pyo_pending_frame)->frame_info == NULL)
{
PyErr_SetString (PyExc_ValueError,
- "Attempting to use stale PendingFrame");
+ "Attempting to use stale PendingFrame");
return NULL;
}
unwind_info->frame_id = frame_id;
@@ -237,11 +237,11 @@ unwind_infopy_add_saved_register (PyObject *self, PyObject *args)
if (pending_frame->frame_info == NULL)
{
PyErr_SetString (PyExc_ValueError,
- "UnwindInfo instance refers to a stale PendingFrame");
+ "UnwindInfo instance refers to a stale PendingFrame");
return NULL;
}
if (!PyArg_UnpackTuple (args, "previous_frame_register", 2, 2,
- &pyo_reg_id, &pyo_reg_value))
+ &pyo_reg_id, &pyo_reg_value))
return NULL;
if (!gdbpy_parse_register_id (pending_frame->gdbarch, pyo_reg_id, &regnum))
{
@@ -255,19 +255,19 @@ unwind_infopy_add_saved_register (PyObject *self, PyObject *args)
if (pyo_reg_value == NULL
|| (value = value_object_to_value (pyo_reg_value)) == NULL)
{
- PyErr_SetString (PyExc_ValueError, "Bad register value");
- return NULL;
+ PyErr_SetString (PyExc_ValueError, "Bad register value");
+ return NULL;
}
data_size = register_size (pending_frame->gdbarch, regnum);
if (data_size != TYPE_LENGTH (value_type (value)))
{
- PyErr_Format (
- PyExc_ValueError,
- "The value of the register returned by the Python "
- "sniffer has unexpected size: %u instead of %u.",
- (unsigned) TYPE_LENGTH (value_type (value)),
- (unsigned) data_size);
- return NULL;
+ PyErr_Format (
+ PyExc_ValueError,
+ "The value of the register returned by the Python "
+ "sniffer has unexpected size: %u instead of %u.",
+ (unsigned) TYPE_LENGTH (value_type (value)),
+ (unsigned) data_size);
+ return NULL;
}
}
{
@@ -275,12 +275,12 @@ unwind_infopy_add_saved_register (PyObject *self, PyObject *args)
bool found = false;
for (saved_reg &reg : *unwind_info->saved_regs)
{
- if (regnum == reg.number)
- {
+ if (regnum == reg.number)
+ {
found = true;
reg.value = std::move (new_value);
- break;
- }
+ break;
+ }
}
if (!found)
unwind_info->saved_regs->emplace_back (regnum, std::move (new_value));
@@ -339,7 +339,7 @@ pending_framepy_read_register (PyObject *self, PyObject *args)
if (pending_frame->frame_info == NULL)
{
PyErr_SetString (PyExc_ValueError,
- "Attempting to read register from stale PendingFrame");
+ "Attempting to read register from stale PendingFrame");
return NULL;
}
if (!PyArg_UnpackTuple (args, "read_register", 1, 1, &pyo_reg_id))
@@ -359,9 +359,9 @@ pending_framepy_read_register (PyObject *self, PyObject *args)
handle the user register case. */
val = value_of_register (regnum, pending_frame->frame_info);
if (val == NULL)
- PyErr_Format (PyExc_ValueError,
- "Cannot read register %d from frame.",
- regnum);
+ PyErr_Format (PyExc_ValueError,
+ "Cannot read register %d from frame.",
+ regnum);
}
catch (const gdb_exception &except)
{
@@ -387,7 +387,7 @@ pending_framepy_create_unwind_info (PyObject *self, PyObject *args)
if (!pyuw_object_attribute_to_pointer (pyo_frame_id, "sp", &sp))
{
PyErr_SetString (PyExc_ValueError,
- _("frame_id should have 'sp' attribute."));
+ _("frame_id should have 'sp' attribute."));
return NULL;
}
@@ -406,7 +406,7 @@ pending_framepy_create_unwind_info (PyObject *self, PyObject *args)
return pyuw_create_unwind_info (self, frame_id_build (sp, pc));
else
return pyuw_create_unwind_info (self,
- frame_id_build_special (sp, pc, special));
+ frame_id_build_special (sp, pc, special));
}
/* Implementation of PendingFrame.architecture (self) -> gdb.Architecture. */
@@ -419,7 +419,7 @@ pending_framepy_architecture (PyObject *self, PyObject *args)
if (pending_frame->frame_info == NULL)
{
PyErr_SetString (PyExc_ValueError,
- "Attempting to read register from stale PendingFrame");
+ "Attempting to read register from stale PendingFrame");
return NULL;
}
return gdbarch_to_arch_object (pending_frame->gdbarch);
@@ -429,7 +429,7 @@ pending_framepy_architecture (PyObject *self, PyObject *args)
static void
pyuw_this_id (struct frame_info *this_frame, void **cache_ptr,
- struct frame_id *this_id)
+ struct frame_id *this_id)
{
*this_id = ((cached_frame_info *) *cache_ptr)->frame_id;
if (pyuw_debug >= 1)
@@ -444,18 +444,18 @@ pyuw_this_id (struct frame_info *this_frame, void **cache_ptr,
static struct value *
pyuw_prev_register (struct frame_info *this_frame, void **cache_ptr,
- int regnum)
+ int regnum)
{
cached_frame_info *cached_frame = (cached_frame_info *) *cache_ptr;
cached_reg_t *reg_info = cached_frame->reg;
cached_reg_t *reg_info_end = reg_info + cached_frame->reg_count;
TRACE_PY_UNWIND (1, "%s (frame=%p,...,reg=%d)\n", __FUNCTION__, this_frame,
- regnum);
+ regnum);
for (; reg_info < reg_info_end; ++reg_info)
{
if (regnum == reg_info->num)
- return frame_unwind_got_bytes (this_frame, regnum, reg_info->data);
+ return frame_unwind_got_bytes (this_frame, regnum, reg_info->data);
}
return frame_unwind_got_optimized (this_frame, regnum);
@@ -465,7 +465,7 @@ pyuw_prev_register (struct frame_info *this_frame, void **cache_ptr,
static int
pyuw_sniffer (const struct frame_unwind *self, struct frame_info *this_frame,
- void **cache_ptr)
+ void **cache_ptr)
{
struct gdbarch *gdbarch = (struct gdbarch *) (self->unwind_data);
cached_frame_info *cached_frame;
@@ -473,8 +473,8 @@ pyuw_sniffer (const struct frame_unwind *self, struct frame_info *this_frame,
gdbpy_enter enter_py (gdbarch, current_language);
TRACE_PY_UNWIND (3, "%s (SP=%s, PC=%s)\n", __FUNCTION__,
- paddress (gdbarch, get_frame_sp (this_frame)),
- paddress (gdbarch, get_frame_pc (this_frame)));
+ paddress (gdbarch, get_frame_sp (this_frame)),
+ paddress (gdbarch, get_frame_pc (this_frame)));
/* Create PendingFrame instance to pass to sniffers. */
pending_frame_object *pfo = PyObject_New (pending_frame_object,
@@ -494,8 +494,8 @@ pyuw_sniffer (const struct frame_unwind *self, struct frame_info *this_frame,
|| ! PyObject_HasAttrString (gdb_python_module, "_execute_unwinders"))
{
PyErr_SetString (PyExc_NameError,
- "Installation error: gdb._execute_unwinders function "
- "is missing");
+ "Installation error: gdb._execute_unwinders function "
+ "is missing");
gdbpy_print_stack ();
return 0;
}
@@ -522,7 +522,7 @@ pyuw_sniffer (const struct frame_unwind *self, struct frame_info *this_frame,
/* Received UnwindInfo, cache data. */
if (PyObject_IsInstance (pyo_unwind_info.get (),
- (PyObject *) &unwind_info_object_type) <= 0)
+ (PyObject *) &unwind_info_object_type) <= 0)
error (_("A Unwinder should return gdb.UnwindInfo instance."));
{
@@ -543,17 +543,17 @@ pyuw_sniffer (const struct frame_unwind *self, struct frame_info *this_frame,
{
saved_reg *reg = &(*unwind_info->saved_regs)[i];
- struct value *value = value_object_to_value (reg->value.get ());
- size_t data_size = register_size (gdbarch, reg->number);
+ struct value *value = value_object_to_value (reg->value.get ());
+ size_t data_size = register_size (gdbarch, reg->number);
cached_frame->reg[i].num = reg->number;
- /* `value' validation was done before, just assert. */
- gdb_assert (value != NULL);
- gdb_assert (data_size == TYPE_LENGTH (value_type (value)));
+ /* `value' validation was done before, just assert. */
+ gdb_assert (value != NULL);
+ gdb_assert (data_size == TYPE_LENGTH (value_type (value)));
cached_frame->reg[i].data = (gdb_byte *) xmalloc (data_size);
- memcpy (cached_frame->reg[i].data, value_contents (value), data_size);
+ memcpy (cached_frame->reg[i].data, value_contents (value), data_size);
}
}
@@ -600,7 +600,7 @@ pyuw_on_new_gdbarch (struct gdbarch *newarch)
if (!data->unwinder_registered)
{
struct frame_unwind *unwinder
- = GDBARCH_OBSTACK_ZALLOC (newarch, struct frame_unwind);
+ = GDBARCH_OBSTACK_ZALLOC (newarch, struct frame_unwind);
unwinder->type = NORMAL_FRAME;
unwinder->stop_reason = default_frame_unwind_stop_reason;
@@ -622,12 +622,12 @@ gdbpy_initialize_unwind (void)
int rc;
add_setshow_zuinteger_cmd
("py-unwind", class_maintenance, &pyuw_debug,
- _("Set Python unwinder debugging."),
- _("Show Python unwinder debugging."),
- _("When non-zero, Python unwinder debugging is enabled."),
- NULL,
- NULL,
- &setdebuglist, &showdebuglist);
+ _("Set Python unwinder debugging."),
+ _("Show Python unwinder debugging."),
+ _("When non-zero, Python unwinder debugging is enabled."),
+ NULL,
+ NULL,
+ &setdebuglist, &showdebuglist);
pyuw_gdbarch_data
= gdbarch_data_register_post_init (pyuw_gdbarch_data_init);
gdb::observers::architecture_changed.attach (pyuw_on_new_gdbarch);
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index 6e29284..4e8d93e 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -122,7 +122,7 @@ convert_buffer_and_type_to_value (PyObject *obj, struct type *type)
&& PyObject_GetBuffer (obj, &py_buf, PyBUF_SIMPLE) == 0)
{
/* Got a buffer, py_buf, out of obj. Cause it to be released
- when it goes out of scope. */
+ when it goes out of scope. */
buffer_up.reset (&py_buf);
}
else
@@ -161,7 +161,7 @@ valpy_new (PyTypeObject *subtype, PyObject *args, PyObject *kwargs)
{
type = type_object_to_type (type_obj);
if (type == nullptr)
- {
+ {
PyErr_SetString (PyExc_TypeError,
_("type argument must be a gdb.Type."));
return nullptr;
@@ -252,18 +252,18 @@ valpy_referenced_value (PyObject *self, PyObject *args)
self_val = ((value_object *) self)->value;
switch (check_typedef (value_type (self_val))->code ())
- {
- case TYPE_CODE_PTR:
- res_val = value_ind (self_val);
- break;
- case TYPE_CODE_REF:
- case TYPE_CODE_RVALUE_REF:
- res_val = coerce_ref (self_val);
- break;
- default:
- error(_("Trying to get the referenced value from a value which is "
- "neither a pointer nor a reference."));
- }
+ {
+ case TYPE_CODE_PTR:
+ res_val = value_ind (self_val);
+ break;
+ case TYPE_CODE_REF:
+ case TYPE_CODE_RVALUE_REF:
+ res_val = coerce_ref (self_val);
+ break;
+ default:
+ error(_("Trying to get the referenced value from a value which is "
+ "neither a pointer nor a reference."));
+ }
result = value_to_value_object (res_val);
}
@@ -963,7 +963,7 @@ valpy_getitem (PyObject *self, PyObject *key)
{
PyErr_SetString (PyExc_AttributeError,
_("gdb.Field object has no name and no "
- "'bitpos' attribute."));
+ "'bitpos' attribute."));
return NULL;
}
@@ -1001,10 +1001,10 @@ valpy_getitem (PyObject *self, PyObject *key)
res_val = value_cast (lookup_pointer_type (base_class_type), tmp);
else if (val_type->code () == TYPE_CODE_REF)
res_val = value_cast (lookup_lvalue_reference_type (base_class_type),
- tmp);
+ tmp);
else if (val_type->code () == TYPE_CODE_RVALUE_REF)
res_val = value_cast (lookup_rvalue_reference_type (base_class_type),
- tmp);
+ tmp);
else
res_val = value_cast (base_class_type, tmp);
}
@@ -1856,7 +1856,7 @@ convert_value_from_python (PyObject *obj)
if (PyErr_Occurred ())
{
/* If the error was an overflow, we can try converting to
- ULONGEST instead. */
+ ULONGEST instead. */
if (PyErr_ExceptionMatches (PyExc_OverflowError))
{
gdbpy_err_fetch fetched_error;
diff --git a/gdb/python/py-xmethods.c b/gdb/python/py-xmethods.c
index d223d49..0b41dae 100644
--- a/gdb/python/py-xmethods.c
+++ b/gdb/python/py-xmethods.c
@@ -435,7 +435,7 @@ python_xmethod_worker::do_get_result_type (value *obj,
else if (TYPE_IS_REFERENCE (obj_type))
{
struct type *this_ref
- = lookup_reference_type (this_type, obj_type->code ());
+ = lookup_reference_type (this_type, obj_type->code ());
if (!types_equal (obj_type, this_ref))
obj = value_cast (this_ref, obj);
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index 36c1ab2..cc113cb 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -338,9 +338,9 @@ typedef struct gdbpy_breakpoint_object
#define BPPY_REQUIRE_VALID(Breakpoint) \
do { \
if ((Breakpoint)->bp == NULL) \
- return PyErr_Format (PyExc_RuntimeError, \
- _("Breakpoint %d is invalid."), \
- (Breakpoint)->number); \
+ return PyErr_Format (PyExc_RuntimeError, \
+ _("Breakpoint %d is invalid."), \
+ (Breakpoint)->number); \
} while (0)
/* Require that BREAKPOINT be a valid breakpoint ID; throw a Python
@@ -348,11 +348,11 @@ typedef struct gdbpy_breakpoint_object
#define BPPY_SET_REQUIRE_VALID(Breakpoint) \
do { \
if ((Breakpoint)->bp == NULL) \
- { \
- PyErr_Format (PyExc_RuntimeError, _("Breakpoint %d is invalid."), \
- (Breakpoint)->number); \
- return -1; \
- } \
+ { \
+ PyErr_Format (PyExc_RuntimeError, _("Breakpoint %d is invalid."), \
+ (Breakpoint)->number); \
+ return -1; \
+ } \
} while (0)
@@ -675,7 +675,7 @@ extern const struct language_defn *python_language;
if (Exception.reason < 0) \
{ \
gdbpy_convert_exception (Exception); \
- return NULL; \
+ return NULL; \
} \
} while (0)
@@ -684,7 +684,7 @@ extern const struct language_defn *python_language;
#define GDB_PY_SET_HANDLE_EXCEPTION(Exception) \
do { \
if (Exception.reason < 0) \
- { \
+ { \
gdbpy_convert_exception (Exception); \
return -1; \
} \
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 8786027..74fee00 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -380,7 +380,7 @@ python_run_simple_file (FILE *file, const char *filename)
if (return_value == nullptr)
{
/* Use PyErr_PrintEx instead of gdbpy_print_stack to better match the
- behavior of the non-Windows codepath. */
+ behavior of the non-Windows codepath. */
PyErr_PrintEx(0);
}
@@ -1208,20 +1208,20 @@ gdbpy_write (PyObject *self, PyObject *args, PyObject *kw)
try
{
switch (stream_type)
- {
- case 1:
- {
+ {
+ case 1:
+ {
fprintf_filtered (gdb_stderr, "%s", arg);
break;
- }
- case 2:
- {
+ }
+ case 2:
+ {
fprintf_filtered (gdb_stdlog, "%s", arg);
break;
- }
- default:
- fprintf_filtered (gdb_stdout, "%s", arg);
- }
+ }
+ default:
+ fprintf_filtered (gdb_stdout, "%s", arg);
+ }
}
catch (const gdb_exception &except)
{
@@ -2142,7 +2142,7 @@ struct PyModuleDef python_GdbModuleDef =
/* Define all the event objects. */
#define GDB_PY_DEFINE_EVENT_TYPE(name, py_name, doc, base) \
PyTypeObject name##_event_object_type \
- CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("event_object") \
+ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("event_object") \
= { \
PyVarObject_HEAD_INIT (NULL, 0) \
"gdb." py_name, /* tp_name */ \