• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂479ab5a00d3aa5dba754b8231a4c9e0b03d33ded (tree)
時間2003-01-10 03:53:21
作者Andrew Cagney <cagney@redh...>
CommiterAndrew Cagney

Log Message

2003-01-09 Andrew Cagney <ac131313@redhat.com>

* frame.h (frame_obstack_zalloc): Replace frame_obstack_alloc.
Update comments.
* frame.c (frame_obstack_zalloc): Replace frame_obstack_alloc.
(frame_saved_regs_zalloc): Update.
(frame_saved_regs_register_unwind): Update.
(create_new_frame): Update.
(get_prev_frame): Update.
(frame_extra_info_zalloc): Update.
(deprecated_get_frame_saved_regs): Update.
* dwarf2cfi.c (cfi_init_extra_frame_info): Update.
* cris-tdep.c: Update comment.

Change Summary

差異

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,17 @@
11 2003-01-09 Andrew Cagney <ac131313@redhat.com>
22
3+ * frame.h (frame_obstack_zalloc): Replace frame_obstack_alloc.
4+ Update comments.
5+ * frame.c (frame_obstack_zalloc): Replace frame_obstack_alloc.
6+ (frame_saved_regs_zalloc): Update.
7+ (frame_saved_regs_register_unwind): Update.
8+ (create_new_frame): Update.
9+ (get_prev_frame): Update.
10+ (frame_extra_info_zalloc): Update.
11+ (deprecated_get_frame_saved_regs): Update.
12+ * dwarf2cfi.c (cfi_init_extra_frame_info): Update.
13+ * cris-tdep.c: Update comment.
14+
315 * somsolib.h: Fix function indentation.
416 * disasm.c, buildsym.c, buildsym.h: Eliminate PTR.
517 * gnu-v2-abi.c, f-typeprint.c, x86-64-linux-tdep.c: Eliminate STREQ.
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -1148,8 +1148,7 @@ cris_frameless_function_invocation (struct frame_info *fi)
11481148
11491149 /* See frame.h. Determines the address of all registers in the current stack
11501150 frame storing each in frame->saved_regs. Space for frame->saved_regs shall
1151- be allocated by FRAME_INIT_SAVED_REGS using either frame_saved_regs_zalloc
1152- or frame_obstack_alloc. */
1151+ be allocated by FRAME_INIT_SAVED_REGS using frame_saved_regs_zalloc. */
11531152
11541153 void
11551154 cris_frame_init_saved_regs (struct frame_info *fi)
--- a/gdb/dwarf2cfi.c
+++ b/gdb/dwarf2cfi.c
@@ -1770,9 +1770,9 @@ cfi_init_extra_frame_info (int fromleaf, struct frame_info *fi)
17701770 unwind_tmp_obstack_init ();
17711771
17721772 fs = frame_state_alloc ();
1773- deprecated_set_frame_context (fi, frame_obstack_alloc (sizeof (struct context)));
1773+ deprecated_set_frame_context (fi, frame_obstack_zalloc (sizeof (struct context)));
17741774 UNWIND_CONTEXT (fi)->reg =
1775- frame_obstack_alloc (sizeof (struct context_reg) * NUM_REGS);
1775+ frame_obstack_zalloc (sizeof (struct context_reg) * NUM_REGS);
17761776 memset (UNWIND_CONTEXT (fi)->reg, 0,
17771777 sizeof (struct context_reg) * NUM_REGS);
17781778
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -456,17 +456,18 @@ static struct frame_info *current_frame;
456456 static struct obstack frame_cache_obstack;
457457
458458 void *
459-frame_obstack_alloc (unsigned long size)
459+frame_obstack_zalloc (unsigned long size)
460460 {
461- return obstack_alloc (&frame_cache_obstack, size);
461+ void *data = obstack_alloc (&frame_cache_obstack, size);
462+ memset (data, 0, size);
463+ return data;
462464 }
463465
464466 CORE_ADDR *
465467 frame_saved_regs_zalloc (struct frame_info *fi)
466468 {
467469 fi->saved_regs = (CORE_ADDR *)
468- frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
469- memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
470+ frame_obstack_zalloc (SIZEOF_FRAME_SAVED_REGS);
470471 return fi->saved_regs;
471472 }
472473
@@ -605,14 +606,13 @@ frame_saved_regs_register_unwind (struct frame_info *frame, void **cache,
605606 {
606607 int sizeof_cache = ((NUM_REGS + NUM_PSEUDO_REGS)
607608 * sizeof (void *));
608- regs = frame_obstack_alloc (sizeof_cache);
609- memset (regs, 0, sizeof_cache);
609+ regs = frame_obstack_zalloc (sizeof_cache);
610610 (*cache) = regs;
611611 }
612612 if (regs[regnum] == NULL)
613613 {
614614 regs[regnum]
615- = frame_obstack_alloc (REGISTER_RAW_SIZE (regnum));
615+ = frame_obstack_zalloc (REGISTER_RAW_SIZE (regnum));
616616 read_memory (frame->saved_regs[regnum], regs[regnum],
617617 REGISTER_RAW_SIZE (regnum));
618618 }
@@ -847,12 +847,7 @@ create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
847847 struct frame_info *fi;
848848 enum frame_type type;
849849
850- fi = (struct frame_info *)
851- obstack_alloc (&frame_cache_obstack,
852- sizeof (struct frame_info));
853-
854- /* Zero all fields by default. */
855- memset (fi, 0, sizeof (struct frame_info));
850+ fi = frame_obstack_zalloc (sizeof (struct frame_info));
856851
857852 fi->frame = addr;
858853 fi->pc = pc;
@@ -1018,10 +1013,7 @@ get_prev_frame (struct frame_info *next_frame)
10181013 return 0;
10191014
10201015 /* Create an initially zero previous frame. */
1021- prev = (struct frame_info *)
1022- obstack_alloc (&frame_cache_obstack,
1023- sizeof (struct frame_info));
1024- memset (prev, 0, sizeof (struct frame_info));
1016+ prev = frame_obstack_zalloc (sizeof (struct frame_info));
10251017
10261018 /* Link it in. */
10271019 next_frame->prev = prev;
@@ -1250,7 +1242,7 @@ deprecated_get_frame_saved_regs (struct frame_info *frame,
12501242 if (frame->saved_regs == NULL)
12511243 {
12521244 frame->saved_regs = (CORE_ADDR *)
1253- frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
1245+ frame_obstack_zalloc (SIZEOF_FRAME_SAVED_REGS);
12541246 }
12551247 if (saved_regs_addr == NULL)
12561248 {
@@ -1275,8 +1267,7 @@ get_frame_extra_info (struct frame_info *fi)
12751267 struct frame_extra_info *
12761268 frame_extra_info_zalloc (struct frame_info *fi, long size)
12771269 {
1278- fi->extra_info = frame_obstack_alloc (size);
1279- memset (fi->extra_info, 0, size);
1270+ fi->extra_info = frame_obstack_zalloc (size);
12801271 return fi->extra_info;
12811272 }
12821273
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -310,7 +310,7 @@ extern struct frame_id frame_id_unwind (struct frame_info *frame);
310310
311311 UNWIND_CACHE is provided as mechanism for implementing a per-frame
312312 local cache. It's initial value being NULL. Memory for that cache
313- should be allocated using frame_obstack_alloc().
313+ should be allocated using frame_obstack_zalloc().
314314
315315 Register window architectures (eg SPARC) should note that REGNUM
316316 identifies the register for the previous frame. For instance, a
@@ -413,7 +413,7 @@ struct frame_info
413413
414414 /* Anything extra for this structure that may have been defined
415415 in the machine dependent files. */
416- /* Allocated by frame_obstack_alloc () which is called /
416+ /* Allocated by frame_extra_info_zalloc () which is called /
417417 initialized by INIT_EXTRA_FRAME_INFO */
418418 struct frame_extra_info *extra_info;
419419
@@ -472,7 +472,11 @@ enum print_what
472472 #define SIZEOF_FRAME_SAVED_REGS \
473473 (sizeof (CORE_ADDR) * (NUM_REGS+NUM_PSEUDO_REGS))
474474
475-extern void *frame_obstack_alloc (unsigned long size);
475+/* Allocate zero initialized memory from the frame cache obstack.
476+ Appendices to the frame info (such as the unwind cache) should
477+ allocate memory using this method. */
478+
479+extern void *frame_obstack_zalloc (unsigned long size);
476480
477481 /* If FRAME_CHAIN_VALID returns zero it means that the given frame
478482 is the outermost one and has no caller. */