GNU Binutils with patches for OS216
修訂 | 479ab5a00d3aa5dba754b8231a4c9e0b03d33ded (tree) |
---|---|
時間 | 2003-01-10 03:53:21 |
作者 | Andrew Cagney <cagney@redh...> |
Commiter | Andrew Cagney |
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.
@@ -1,5 +1,17 @@ | ||
1 | 1 | 2003-01-09 Andrew Cagney <ac131313@redhat.com> |
2 | 2 | |
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 | + | |
3 | 15 | * somsolib.h: Fix function indentation. |
4 | 16 | * disasm.c, buildsym.c, buildsym.h: Eliminate PTR. |
5 | 17 | * gnu-v2-abi.c, f-typeprint.c, x86-64-linux-tdep.c: Eliminate STREQ. |
@@ -1148,8 +1148,7 @@ cris_frameless_function_invocation (struct frame_info *fi) | ||
1148 | 1148 | |
1149 | 1149 | /* See frame.h. Determines the address of all registers in the current stack |
1150 | 1150 | 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. */ | |
1153 | 1152 | |
1154 | 1153 | void |
1155 | 1154 | cris_frame_init_saved_regs (struct frame_info *fi) |
@@ -1770,9 +1770,9 @@ cfi_init_extra_frame_info (int fromleaf, struct frame_info *fi) | ||
1770 | 1770 | unwind_tmp_obstack_init (); |
1771 | 1771 | |
1772 | 1772 | 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))); | |
1774 | 1774 | UNWIND_CONTEXT (fi)->reg = |
1775 | - frame_obstack_alloc (sizeof (struct context_reg) * NUM_REGS); | |
1775 | + frame_obstack_zalloc (sizeof (struct context_reg) * NUM_REGS); | |
1776 | 1776 | memset (UNWIND_CONTEXT (fi)->reg, 0, |
1777 | 1777 | sizeof (struct context_reg) * NUM_REGS); |
1778 | 1778 |
@@ -456,17 +456,18 @@ static struct frame_info *current_frame; | ||
456 | 456 | static struct obstack frame_cache_obstack; |
457 | 457 | |
458 | 458 | void * |
459 | -frame_obstack_alloc (unsigned long size) | |
459 | +frame_obstack_zalloc (unsigned long size) | |
460 | 460 | { |
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; | |
462 | 464 | } |
463 | 465 | |
464 | 466 | CORE_ADDR * |
465 | 467 | frame_saved_regs_zalloc (struct frame_info *fi) |
466 | 468 | { |
467 | 469 | 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); | |
470 | 471 | return fi->saved_regs; |
471 | 472 | } |
472 | 473 |
@@ -605,14 +606,13 @@ frame_saved_regs_register_unwind (struct frame_info *frame, void **cache, | ||
605 | 606 | { |
606 | 607 | int sizeof_cache = ((NUM_REGS + NUM_PSEUDO_REGS) |
607 | 608 | * sizeof (void *)); |
608 | - regs = frame_obstack_alloc (sizeof_cache); | |
609 | - memset (regs, 0, sizeof_cache); | |
609 | + regs = frame_obstack_zalloc (sizeof_cache); | |
610 | 610 | (*cache) = regs; |
611 | 611 | } |
612 | 612 | if (regs[regnum] == NULL) |
613 | 613 | { |
614 | 614 | regs[regnum] |
615 | - = frame_obstack_alloc (REGISTER_RAW_SIZE (regnum)); | |
615 | + = frame_obstack_zalloc (REGISTER_RAW_SIZE (regnum)); | |
616 | 616 | read_memory (frame->saved_regs[regnum], regs[regnum], |
617 | 617 | REGISTER_RAW_SIZE (regnum)); |
618 | 618 | } |
@@ -847,12 +847,7 @@ create_new_frame (CORE_ADDR addr, CORE_ADDR pc) | ||
847 | 847 | struct frame_info *fi; |
848 | 848 | enum frame_type type; |
849 | 849 | |
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)); | |
856 | 851 | |
857 | 852 | fi->frame = addr; |
858 | 853 | fi->pc = pc; |
@@ -1018,10 +1013,7 @@ get_prev_frame (struct frame_info *next_frame) | ||
1018 | 1013 | return 0; |
1019 | 1014 | |
1020 | 1015 | /* 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)); | |
1025 | 1017 | |
1026 | 1018 | /* Link it in. */ |
1027 | 1019 | next_frame->prev = prev; |
@@ -1250,7 +1242,7 @@ deprecated_get_frame_saved_regs (struct frame_info *frame, | ||
1250 | 1242 | if (frame->saved_regs == NULL) |
1251 | 1243 | { |
1252 | 1244 | frame->saved_regs = (CORE_ADDR *) |
1253 | - frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS); | |
1245 | + frame_obstack_zalloc (SIZEOF_FRAME_SAVED_REGS); | |
1254 | 1246 | } |
1255 | 1247 | if (saved_regs_addr == NULL) |
1256 | 1248 | { |
@@ -1275,8 +1267,7 @@ get_frame_extra_info (struct frame_info *fi) | ||
1275 | 1267 | struct frame_extra_info * |
1276 | 1268 | frame_extra_info_zalloc (struct frame_info *fi, long size) |
1277 | 1269 | { |
1278 | - fi->extra_info = frame_obstack_alloc (size); | |
1279 | - memset (fi->extra_info, 0, size); | |
1270 | + fi->extra_info = frame_obstack_zalloc (size); | |
1280 | 1271 | return fi->extra_info; |
1281 | 1272 | } |
1282 | 1273 |
@@ -310,7 +310,7 @@ extern struct frame_id frame_id_unwind (struct frame_info *frame); | ||
310 | 310 | |
311 | 311 | UNWIND_CACHE is provided as mechanism for implementing a per-frame |
312 | 312 | 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(). | |
314 | 314 | |
315 | 315 | Register window architectures (eg SPARC) should note that REGNUM |
316 | 316 | identifies the register for the previous frame. For instance, a |
@@ -413,7 +413,7 @@ struct frame_info | ||
413 | 413 | |
414 | 414 | /* Anything extra for this structure that may have been defined |
415 | 415 | in the machine dependent files. */ |
416 | - /* Allocated by frame_obstack_alloc () which is called / | |
416 | + /* Allocated by frame_extra_info_zalloc () which is called / | |
417 | 417 | initialized by INIT_EXTRA_FRAME_INFO */ |
418 | 418 | struct frame_extra_info *extra_info; |
419 | 419 |
@@ -472,7 +472,11 @@ enum print_what | ||
472 | 472 | #define SIZEOF_FRAME_SAVED_REGS \ |
473 | 473 | (sizeof (CORE_ADDR) * (NUM_REGS+NUM_PSEUDO_REGS)) |
474 | 474 | |
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); | |
476 | 480 | |
477 | 481 | /* If FRAME_CHAIN_VALID returns zero it means that the given frame |
478 | 482 | is the outermost one and has no caller. */ |