aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-08-11 13:24:32 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-08-11 13:24:32 +0000
commit39d7b0e29259dcf5cf966530ac416d1eb287ccbb (patch)
tree04a22b736e0581b3314ab29b5bd5c5ed2fcadd44 /gdb
parent9f9a8002f04316add32d6f20538aaaaa3951b9c9 (diff)
downloadgdb-39d7b0e29259dcf5cf966530ac416d1eb287ccbb.zip
gdb-39d7b0e29259dcf5cf966530ac416d1eb287ccbb.tar.gz
gdb-39d7b0e29259dcf5cf966530ac416d1eb287ccbb.tar.bz2
gdb/
Code cleanup. * dummy-frame.c (dummy_frame_unwinder): Remove its static qualifier. Rename to dummy_frame_unwind. (dummy_frame_unwind): Remove. * dummy-frame.h (dummy_frame_unwind): Reference directly the struct. * frame-unwind.c (frame_unwind_init): Use address of dummy_frame_unwind and inline_frame_unwind. * frame.c (create_sentinel_frame): Use address of sentinel_frame_unwind. * inline-frame.c (inline_frame_unwinder): Rename to inline_frame_unwind. (inline_frame_unwind): Remove. * inline-frame.h (inline_frame_unwind): Reference directly the struct. * sentinel-frame.c (sentinel_frame_unwinder): Rename to sentinel_frame_unwind. (sentinel_frame_unwind): Remove. * sentinel-frame.h (sentinel_frame_unwind): Reference directly the struct.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog21
-rw-r--r--gdb/dummy-frame.c6
-rw-r--r--gdb/dummy-frame.h2
-rw-r--r--gdb/frame-unwind.c4
-rw-r--r--gdb/frame.c2
-rw-r--r--gdb/inline-frame.c4
-rw-r--r--gdb/inline-frame.h2
-rw-r--r--gdb/sentinel-frame.c4
-rw-r--r--gdb/sentinel-frame.h2
9 files changed, 30 insertions, 17 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 84b1d66..72e614a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,6 +1,27 @@
2010-08-11 Jan Kratochvil <jan.kratochvil@redhat.com>
Code cleanup.
+ * dummy-frame.c (dummy_frame_unwinder): Remove its static qualifier.
+ Rename to dummy_frame_unwind.
+ (dummy_frame_unwind): Remove.
+ * dummy-frame.h (dummy_frame_unwind): Reference directly the struct.
+ * frame-unwind.c (frame_unwind_init): Use address of
+ dummy_frame_unwind and inline_frame_unwind.
+ * frame.c (create_sentinel_frame): Use address of
+ sentinel_frame_unwind.
+ * inline-frame.c (inline_frame_unwinder): Rename to
+ inline_frame_unwind.
+ (inline_frame_unwind): Remove.
+ * inline-frame.h (inline_frame_unwind): Reference directly the struct.
+ * sentinel-frame.c (sentinel_frame_unwinder): Rename to
+ sentinel_frame_unwind.
+ (sentinel_frame_unwind): Remove.
+ * sentinel-frame.h (sentinel_frame_unwind): Reference directly the
+ struct.
+
+2010-08-11 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Code cleanup.
* frame-unwind.c (frame_unwind_find_by_frame): Remove the return type
and returned value. New comment from frame-unwind.h.
* frame-unwind.h (frame_unwind_find_by_frame): Remove the return type.
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index d6a7241..66f4c8c 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -274,7 +274,7 @@ dummy_frame_this_id (struct frame_info *this_frame,
(*this_id) = cache->this_id;
}
-static const struct frame_unwind dummy_frame_unwinder =
+const struct frame_unwind dummy_frame_unwind =
{
DUMMY_FRAME,
dummy_frame_this_id,
@@ -283,10 +283,6 @@ static const struct frame_unwind dummy_frame_unwinder =
dummy_frame_sniffer,
};
-const struct frame_unwind *const dummy_frame_unwind = {
- &dummy_frame_unwinder
-};
-
static void
fprint_dummy_frames (struct ui_file *file)
{
diff --git a/gdb/dummy-frame.h b/gdb/dummy-frame.h
index 80f36f8..c97301c 100644
--- a/gdb/dummy-frame.h
+++ b/gdb/dummy-frame.h
@@ -56,6 +56,6 @@ extern void dummy_frame_pop (struct frame_id dummy_id);
/* If the PC falls in a dummy frame, return a dummy frame
unwinder. */
-extern const struct frame_unwind *const dummy_frame_unwind;
+extern const struct frame_unwind dummy_frame_unwind;
#endif /* !defined (DUMMY_FRAME_H) */
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index bbb3e90..8df7adf 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -53,9 +53,9 @@ frame_unwind_init (struct obstack *obstack)
/* Start the table out with a few default sniffers. OSABI code
can't override this. */
table->list = OBSTACK_ZALLOC (obstack, struct frame_unwind_table_entry);
- table->list->unwinder = dummy_frame_unwind;
+ table->list->unwinder = &dummy_frame_unwind;
table->list->next = OBSTACK_ZALLOC (obstack, struct frame_unwind_table_entry);
- table->list->next->unwinder = inline_frame_unwind;
+ table->list->next->unwinder = &inline_frame_unwind;
/* The insertion point for OSABI sniffers. */
table->osabi_head = &table->list->next->next;
return table;
diff --git a/gdb/frame.c b/gdb/frame.c
index 64c6444..53d2fba 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -1100,7 +1100,7 @@ create_sentinel_frame (struct program_space *pspace, struct regcache *regcache)
information, such as the frame's thread will be added. */
frame->prologue_cache = sentinel_frame_cache (regcache);
/* For the moment there is only one sentinel frame implementation. */
- frame->unwind = sentinel_frame_unwind;
+ frame->unwind = &sentinel_frame_unwind;
/* Link this frame back to itself. The frame is self referential
(the unwound PC is the same as the pc), so make it so. */
frame->next = frame;
diff --git a/gdb/inline-frame.c b/gdb/inline-frame.c
index 706bcd9..1b19b5f 100644
--- a/gdb/inline-frame.c
+++ b/gdb/inline-frame.c
@@ -256,7 +256,7 @@ inline_frame_sniffer (const struct frame_unwind *self,
return 1;
}
-const struct frame_unwind inline_frame_unwinder = {
+const struct frame_unwind inline_frame_unwind = {
INLINE_FRAME,
inline_frame_this_id,
inline_frame_prev_register,
@@ -264,8 +264,6 @@ const struct frame_unwind inline_frame_unwinder = {
inline_frame_sniffer
};
-const struct frame_unwind *const inline_frame_unwind = &inline_frame_unwinder;
-
/* Return non-zero if BLOCK, an inlined function block containing PC,
has a group of contiguous instructions starting at PC (but not
before it). */
diff --git a/gdb/inline-frame.h b/gdb/inline-frame.h
index c48e8d7..97e8296 100644
--- a/gdb/inline-frame.h
+++ b/gdb/inline-frame.h
@@ -25,7 +25,7 @@ struct frame_unwind;
/* The inline frame unwinder. */
-extern const struct frame_unwind *const inline_frame_unwind;
+extern const struct frame_unwind inline_frame_unwind;
/* Skip all inlined functions whose call sites are at the current PC.
Frames for the hidden functions will not appear in the backtrace until the
diff --git a/gdb/sentinel-frame.c b/gdb/sentinel-frame.c
index 8c11d7b..ddb471d 100644
--- a/gdb/sentinel-frame.c
+++ b/gdb/sentinel-frame.c
@@ -86,7 +86,7 @@ sentinel_frame_prev_arch (struct frame_info *this_frame,
return get_regcache_arch (cache->regcache);
}
-const struct frame_unwind sentinel_frame_unwinder =
+const struct frame_unwind sentinel_frame_unwind =
{
SENTINEL_FRAME,
sentinel_frame_this_id,
@@ -96,5 +96,3 @@ const struct frame_unwind sentinel_frame_unwinder =
NULL,
sentinel_frame_prev_arch,
};
-
-const struct frame_unwind *const sentinel_frame_unwind = &sentinel_frame_unwinder;
diff --git a/gdb/sentinel-frame.h b/gdb/sentinel-frame.h
index 0c9f576..3346640 100644
--- a/gdb/sentinel-frame.h
+++ b/gdb/sentinel-frame.h
@@ -34,6 +34,6 @@ extern void *sentinel_frame_cache (struct regcache *regcache);
/* At present there is only one type of sentinel frame. */
-extern const struct frame_unwind *const sentinel_frame_unwind;
+extern const struct frame_unwind sentinel_frame_unwind;
#endif /* !defined (SENTINEL_FRAME_H) */