* [PATCH] Fix inconsistent usage of FRAME_OBSTACK_ZALLOC macro
@ 2006-07-24 21:05 Fred Fish
2006-07-24 21:10 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Fred Fish @ 2006-07-24 21:05 UTC (permalink / raw)
To: GDB Patches; +Cc: fnf
Of the 50+ places that reference frame_obstack_zalloc(), about 50 of
them use the FRAME_OBSTACK_ZALLOC macro. The rest call the function
directly.
This patch makes them all consistently use the macro.
-Fred
2006-07-24 Fred Fish <fnf@specifix.com>
* alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind_cache): Use
FRAME_OBSTACK_ZALLOC instead of calling frame_obstack_zalloc
directly.
* alpha-tdep.c (alpha_heuristic_frame_unwind_cache): Ditto.
* arm-tdep.c (arm_make_prologue_cache): Ditto.
(arm_make_stub_cache): Ditto.
* frame-unwind.h: Ditto.
* frame.c (create_new_frame): Ditto.
Index: alpha-mdebug-tdep.c
===================================================================
RCS file: /cvsroots/latest/src/gdb/gdb/alpha-mdebug-tdep.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 alpha-mdebug-tdep.c
--- alpha-mdebug-tdep.c 30 Dec 2005 18:53:02 -0000 1.1.1.2
+++ alpha-mdebug-tdep.c 24 Jul 2006 20:40:13 -0000
@@ -191,7 +191,7 @@ alpha_mdebug_frame_unwind_cache (struct
info->proc_desc = proc_desc;
gdb_assert (proc_desc != NULL);
- info->saved_regs = frame_obstack_zalloc (SIZEOF_FRAME_SAVED_REGS);
+ info->saved_regs = FRAME_OBSTACK_ZALLOC (SIZEOF_FRAME_SAVED_REGS);
/* The VFP of the frame is at FRAME_REG+FRAME_OFFSET. */
frame_unwind_unsigned_register (next_frame, PROC_FRAME_REG (proc_desc), &vfp);
Index: alpha-tdep.c
===================================================================
RCS file: /cvsroots/latest/src/gdb/gdb/alpha-tdep.c,v
retrieving revision 1.1.1.5
diff -u -p -r1.1.1.5 alpha-tdep.c
--- alpha-tdep.c 11 Jul 2006 02:27:20 -0000 1.1.1.5
+++ alpha-tdep.c 24 Jul 2006 20:40:23 -0000
@@ -1011,7 +1011,7 @@ alpha_heuristic_frame_unwind_cache (stru
info = FRAME_OBSTACK_ZALLOC (struct alpha_heuristic_unwind_cache);
*this_prologue_cache = info;
- info->saved_regs = frame_obstack_zalloc (SIZEOF_FRAME_SAVED_REGS);
+ info->saved_regs = FRAME_OBSTACK_ZALLOC (SIZEOF_FRAME_SAVED_REGS);
limit_pc = frame_pc_unwind (next_frame);
if (start_pc == 0)
Index: arm-tdep.c
===================================================================
RCS file: /cvsroots/latest/src/gdb/gdb/arm-tdep.c,v
retrieving revision 1.1.1.11
diff -u -p -r1.1.1.11 arm-tdep.c
--- arm-tdep.c 23 Jul 2006 08:47:10 -0000 1.1.1.11
+++ arm-tdep.c 24 Jul 2006 20:33:42 -0000
@@ -855,7 +855,7 @@ arm_make_prologue_cache (struct frame_in
struct arm_prologue_cache *cache;
CORE_ADDR unwound_fp;
- cache = frame_obstack_zalloc (sizeof (struct arm_prologue_cache));
+ cache = FRAME_OBSTACK_ZALLOC (struct arm_prologue_cache);
cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
arm_scan_prologue (next_frame, cache);
@@ -962,7 +962,7 @@ arm_make_stub_cache (struct frame_info *
struct arm_prologue_cache *cache;
CORE_ADDR unwound_fp;
- cache = frame_obstack_zalloc (sizeof (struct arm_prologue_cache));
+ cache = FRAME_OBSTACK_ZALLOC (struct arm_prologue_cache);
cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
cache->prev_sp = frame_unwind_register_unsigned (next_frame, ARM_SP_REGNUM);
Index: frame-unwind.h
===================================================================
RCS file: /cvsroots/latest/src/gdb/gdb/frame-unwind.h,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 frame-unwind.h
--- frame-unwind.h 30 Dec 2005 18:53:03 -0000 1.1.1.2
+++ frame-unwind.h 24 Jul 2006 20:39:49 -0000
@@ -72,7 +72,7 @@ typedef int (frame_sniffer_ftype) (const
THIS_PROLOGUE_CACHE can be used to share any prolog analysis data
with the other unwind methods. Memory for that cache should be
- allocated using frame_obstack_zalloc(). */
+ allocated using FRAME_OBSTACK_ZALLOC(). */
typedef void (frame_this_id_ftype) (struct frame_info *next_frame,
void **this_prologue_cache,
@@ -108,7 +108,7 @@ typedef void (frame_this_id_ftype) (stru
THIS_PROLOGUE_CACHE can be used to share any prolog analysis data
with the other unwind methods. Memory for that cache should be
- allocated using frame_obstack_zalloc(). */
+ allocated using FRAME_OBSTACK_ZALLOC(). */
typedef void (frame_prev_register_ftype) (struct frame_info *next_frame,
void **this_prologue_cache,
Index: frame.c
===================================================================
RCS file: /cvsroots/latest/src/gdb/gdb/frame.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 frame.c
--- frame.c 30 Dec 2005 18:53:17 -0000 1.1.1.2
+++ frame.c 24 Jul 2006 20:33:42 -0000
@@ -946,7 +946,7 @@ create_new_frame (CORE_ADDR addr, CORE_A
paddr_nz (addr), paddr_nz (pc));
}
- fi = frame_obstack_zalloc (sizeof (struct frame_info));
+ fi = FRAME_OBSTACK_ZALLOC (struct frame_info);
fi->next = create_sentinel_frame (current_regcache);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix inconsistent usage of FRAME_OBSTACK_ZALLOC macro
2006-07-24 21:05 [PATCH] Fix inconsistent usage of FRAME_OBSTACK_ZALLOC macro Fred Fish
@ 2006-07-24 21:10 ` Daniel Jacobowitz
2006-07-24 21:31 ` Fred Fish
2006-07-25 12:17 ` Fred Fish
0 siblings, 2 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2006-07-24 21:10 UTC (permalink / raw)
To: fnf; +Cc: GDB Patches
On Mon, Jul 24, 2006 at 05:05:37PM -0400, Fred Fish wrote:
> Of the 50+ places that reference frame_obstack_zalloc(), about 50 of
> them use the FRAME_OBSTACK_ZALLOC macro. The rest call the function
> directly.
>
> This patch makes them all consistently use the macro.
I gather you didn't test Alpha. This patch is wrong.
> - info->saved_regs = frame_obstack_zalloc (SIZEOF_FRAME_SAVED_REGS);
> + info->saved_regs = FRAME_OBSTACK_ZALLOC (SIZEOF_FRAME_SAVED_REGS);
That will probably allocate sizeof (int).
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix inconsistent usage of FRAME_OBSTACK_ZALLOC macro
2006-07-24 21:10 ` Daniel Jacobowitz
@ 2006-07-24 21:31 ` Fred Fish
2006-07-25 12:17 ` Fred Fish
1 sibling, 0 replies; 5+ messages in thread
From: Fred Fish @ 2006-07-24 21:31 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: GDB Patches
On Monday 24 July 2006 17:10, Daniel Jacobowitz wrote:
> I gather you didn't test Alpha. This patch is wrong.
Yes, it's pretty obviously wrong. My mistake. I started with a patch
that wasn't so obviously wrong and expanded it at the last minute to
include the alpha bits.
I'll revise and submit.
-Fred
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix inconsistent usage of FRAME_OBSTACK_ZALLOC macro
2006-07-24 21:10 ` Daniel Jacobowitz
2006-07-24 21:31 ` Fred Fish
@ 2006-07-25 12:17 ` Fred Fish
2006-07-25 12:21 ` Daniel Jacobowitz
1 sibling, 1 reply; 5+ messages in thread
From: Fred Fish @ 2006-07-25 12:17 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: GDB Patches
Here is a revised patch with the alpha bits removed.
-Fred
2006-07-24 Fred Fish <fnf@specifix.com>
* arm-tdep.c (arm_make_prologue_cache): Use FRAME_OBSTACK_ZALLOC
instead of calling frame_obstack_zalloc directly.
(arm_make_stub_cache): Ditto.
* frame-unwind.h: Ditto.
* frame.c (create_new_frame): Ditto.
Index: arm-tdep.c
===================================================================
RCS file: /cvsroots/latest/src/gdb/gdb/arm-tdep.c,v
retrieving revision 1.1.1.11
diff -u -p -r1.1.1.11 arm-tdep.c
--- arm-tdep.c 23 Jul 2006 08:47:10 -0000 1.1.1.11
+++ arm-tdep.c 24 Jul 2006 20:33:42 -0000
@@ -855,7 +855,7 @@ arm_make_prologue_cache (struct frame_in
struct arm_prologue_cache *cache;
CORE_ADDR unwound_fp;
- cache = frame_obstack_zalloc (sizeof (struct arm_prologue_cache));
+ cache = FRAME_OBSTACK_ZALLOC (struct arm_prologue_cache);
cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
arm_scan_prologue (next_frame, cache);
@@ -962,7 +962,7 @@ arm_make_stub_cache (struct frame_info *
struct arm_prologue_cache *cache;
CORE_ADDR unwound_fp;
- cache = frame_obstack_zalloc (sizeof (struct arm_prologue_cache));
+ cache = FRAME_OBSTACK_ZALLOC (struct arm_prologue_cache);
cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
cache->prev_sp = frame_unwind_register_unsigned (next_frame, ARM_SP_REGNUM);
Index: frame-unwind.h
===================================================================
RCS file: /cvsroots/latest/src/gdb/gdb/frame-unwind.h,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 frame-unwind.h
--- frame-unwind.h 30 Dec 2005 18:53:03 -0000 1.1.1.2
+++ frame-unwind.h 24 Jul 2006 20:39:49 -0000
@@ -72,7 +72,7 @@ typedef int (frame_sniffer_ftype) (const
THIS_PROLOGUE_CACHE can be used to share any prolog analysis data
with the other unwind methods. Memory for that cache should be
- allocated using frame_obstack_zalloc(). */
+ allocated using FRAME_OBSTACK_ZALLOC(). */
typedef void (frame_this_id_ftype) (struct frame_info *next_frame,
void **this_prologue_cache,
@@ -108,7 +108,7 @@ typedef void (frame_this_id_ftype) (stru
THIS_PROLOGUE_CACHE can be used to share any prolog analysis data
with the other unwind methods. Memory for that cache should be
- allocated using frame_obstack_zalloc(). */
+ allocated using FRAME_OBSTACK_ZALLOC(). */
typedef void (frame_prev_register_ftype) (struct frame_info *next_frame,
void **this_prologue_cache,
Index: frame.c
===================================================================
RCS file: /cvsroots/latest/src/gdb/gdb/frame.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 frame.c
--- frame.c 30 Dec 2005 18:53:17 -0000 1.1.1.2
+++ frame.c 24 Jul 2006 20:33:42 -0000
@@ -946,7 +946,7 @@ create_new_frame (CORE_ADDR addr, CORE_A
paddr_nz (addr), paddr_nz (pc));
}
- fi = frame_obstack_zalloc (sizeof (struct frame_info));
+ fi = FRAME_OBSTACK_ZALLOC (struct frame_info);
fi->next = create_sentinel_frame (current_regcache);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix inconsistent usage of FRAME_OBSTACK_ZALLOC macro
2006-07-25 12:17 ` Fred Fish
@ 2006-07-25 12:21 ` Daniel Jacobowitz
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2006-07-25 12:21 UTC (permalink / raw)
To: fnf; +Cc: GDB Patches
On Tue, Jul 25, 2006 at 08:16:37AM -0400, Fred Fish wrote:
> Here is a revised patch with the alpha bits removed.
>
> -Fred
>
> 2006-07-24 Fred Fish <fnf@specifix.com>
>
> * arm-tdep.c (arm_make_prologue_cache): Use FRAME_OBSTACK_ZALLOC
> instead of calling frame_obstack_zalloc directly.
> (arm_make_stub_cache): Ditto.
> * frame-unwind.h: Ditto.
> * frame.c (create_new_frame): Ditto.
OK, thanks.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-07-25 12:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-24 21:05 [PATCH] Fix inconsistent usage of FRAME_OBSTACK_ZALLOC macro Fred Fish
2006-07-24 21:10 ` Daniel Jacobowitz
2006-07-24 21:31 ` Fred Fish
2006-07-25 12:17 ` Fred Fish
2006-07-25 12:21 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox