• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

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

Revisión1c90d9f022469629c255d44664b4452998168359 (tree)
Tiempo2017-08-11 17:30:02
AutorYao Qi <yao.qi@lina...>
CommiterYao Qi

Log Message

Class-fy dwarf2_frame_state_reg_info

This patch adds dwarf2_frame_state_reg_info ctor, dtor, copy ctor,
assignment operator, and move assignment. This patch also adds unit test
to execute_cfa_program to cover the changes.

gdb:

2017-08-11 Yao Qi <yao.qi@linaro.org>

* dwarf2-frame.c (dwarf2_frame_state_alloc_regs): Remove.
(dwarf2_frame_state_copy_regs): Remove.
(dwarf2_frame_state_free_regs): Remove.
(dwarf2_frame_state::~dwarf2_frame_state): Remove.
(dwarf2_restore_rule): Call method .alloc_regs instead of
dwarf2_frame_state_alloc_regs.
(execute_cfa_program): Likewise. Call dwarf2_frame_state_reg_info
constructor. Call std::move.
(dwarf2_fetch_cfa_info): Don't call dwarf2_frame_state_copy_regs.
(dwarf2_frame_cache): Likewise.

[GDB_SELF_TEST]: Include selftest.h and
selftest-arch.h.
[GDB_SELF_TEST] (execute_cfa_program_test): New function.
(_initialize_dwarf2_frame) [GDB_SELF_TEST]: Register
execute_cfa_program_test.

* dwarf2-frame.h (dwarf2_frame_state_reg_info): Add ctor, dtor,
copy ctor, assignment operator, move assignment.
<alloc_regs>: New method.
<swap>: New method.
(struct dwarf2_frame_state): Delete dtor.
(dwarf2_frame_state_alloc_regs): Remove declaration.
* sparc-tdep.c (sparc_execute_dwarf_cfa_vendor_op): Don't call
dwarf2_frame_state_alloc_regs, use .alloc_regs instead.

Cambiar Resumen

Diferencia incremental

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,33 @@
11 2017-08-11 Yao Qi <yao.qi@linaro.org>
22
3+ * dwarf2-frame.c (dwarf2_frame_state_alloc_regs): Remove.
4+ (dwarf2_frame_state_copy_regs): Remove.
5+ (dwarf2_frame_state_free_regs): Remove.
6+ (dwarf2_frame_state::~dwarf2_frame_state): Remove.
7+ (dwarf2_restore_rule): Call method .alloc_regs instead of
8+ dwarf2_frame_state_alloc_regs.
9+ (execute_cfa_program): Likewise. Call dwarf2_frame_state_reg_info
10+ constructor. Call std::move.
11+ (dwarf2_fetch_cfa_info): Don't call dwarf2_frame_state_copy_regs.
12+ (dwarf2_frame_cache): Likewise.
13+
14+ [GDB_SELF_TEST]: Include selftest.h and
15+ selftest-arch.h.
16+ [GDB_SELF_TEST] (execute_cfa_program_test): New function.
17+ (_initialize_dwarf2_frame) [GDB_SELF_TEST]: Register
18+ execute_cfa_program_test.
19+
20+ * dwarf2-frame.h (dwarf2_frame_state_reg_info): Add ctor, dtor,
21+ copy ctor, assignment operator, move assignment.
22+ <alloc_regs>: New method.
23+ <swap>: New method.
24+ (struct dwarf2_frame_state): Delete dtor.
25+ (dwarf2_frame_state_alloc_regs): Remove declaration.
26+ * sparc-tdep.c (sparc_execute_dwarf_cfa_vendor_op): Don't call
27+ dwarf2_frame_state_alloc_regs, use .alloc_regs instead.
28+
29+2017-08-11 Yao Qi <yao.qi@linaro.org>
30+
331 * dwarf2-frame.c (dwarf2_frame_state_free): Remove.
432 (dwarf2_frame_state::dwarf2_frame_state): New.
533 (dwarf2_frame_state::~dwarf2_frame_state): New.
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -38,6 +38,10 @@
3838 #include "ax.h"
3939 #include "dwarf2loc.h"
4040 #include "dwarf2-frame-tailcall.h"
41+#if GDB_SELF_TEST
42+#include "selftest.h"
43+#include "selftest-arch.h"
44+#endif
4145
4246 struct comp_unit;
4347
@@ -169,69 +173,12 @@ static CORE_ADDR read_encoded_value (struct comp_unit *unit, gdb_byte encoding,
169173 which is unused in that case. */
170174 #define cfa_exp_len cfa_reg
171175
172-/* Assert that the register set RS is large enough to store gdbarch_num_regs
173- columns. If necessary, enlarge the register set. */
174-
175-void
176-dwarf2_frame_state_alloc_regs (struct dwarf2_frame_state_reg_info *rs,
177- int num_regs)
178-{
179- size_t size = sizeof (struct dwarf2_frame_state_reg);
180-
181- if (num_regs <= rs->num_regs)
182- return;
183-
184- rs->reg = (struct dwarf2_frame_state_reg *)
185- xrealloc (rs->reg, num_regs * size);
186-
187- /* Initialize newly allocated registers. */
188- memset (rs->reg + rs->num_regs, 0, (num_regs - rs->num_regs) * size);
189- rs->num_regs = num_regs;
190-}
191-
192-/* Copy the register columns in register set RS into newly allocated
193- memory and return a pointer to this newly created copy. */
194-
195-static struct dwarf2_frame_state_reg *
196-dwarf2_frame_state_copy_regs (struct dwarf2_frame_state_reg_info *rs)
197-{
198- size_t size = rs->num_regs * sizeof (struct dwarf2_frame_state_reg);
199- struct dwarf2_frame_state_reg *reg;
200-
201- reg = (struct dwarf2_frame_state_reg *) xmalloc (size);
202- memcpy (reg, rs->reg, size);
203-
204- return reg;
205-}
206-
207-/* Release the memory allocated to register set RS. */
208-
209-static void
210-dwarf2_frame_state_free_regs (struct dwarf2_frame_state_reg_info *rs)
211-{
212- if (rs)
213- {
214- dwarf2_frame_state_free_regs (rs->prev);
215-
216- xfree (rs->reg);
217- xfree (rs);
218- }
219-}
220-
221176 dwarf2_frame_state::dwarf2_frame_state (CORE_ADDR pc_, struct dwarf2_cie *cie)
222177 : pc (pc_), data_align (cie->data_alignment_factor),
223178 code_align (cie->code_alignment_factor),
224179 retaddr_column (cie->return_address_register)
225180 {
226181 }
227-
228-dwarf2_frame_state::~dwarf2_frame_state ()
229-{
230- dwarf2_frame_state_free_regs (initial.prev);
231- dwarf2_frame_state_free_regs (regs.prev);
232- xfree (initial.reg);
233- xfree (regs.reg);
234-}
235182
236183
237184 /* Helper functions for execute_stack_op. */
@@ -255,7 +202,7 @@ dwarf2_restore_rule (struct gdbarch *gdbarch, ULONGEST reg_num,
255202
256203 gdb_assert (fs->initial.reg);
257204 reg = dwarf2_frame_adjust_regnum (gdbarch, reg_num, eh_frame_p);
258- dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
205+ fs->regs.alloc_regs (reg + 1);
259206
260207 /* Check if this register was explicitly initialized in the
261208 CIE initial instructions. If not, default the rule to
@@ -409,7 +356,7 @@ execute_cfa_program (struct dwarf2_fde *fde, const gdb_byte *insn_ptr,
409356 reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
410357 insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &utmp);
411358 offset = utmp * fs->data_align;
412- dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
359+ fs->regs.alloc_regs (reg + 1);
413360 fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_OFFSET;
414361 fs->regs.reg[reg].loc.offset = offset;
415362 }
@@ -453,7 +400,7 @@ execute_cfa_program (struct dwarf2_fde *fde, const gdb_byte *insn_ptr,
453400 reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
454401 insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &utmp);
455402 offset = utmp * fs->data_align;
456- dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
403+ fs->regs.alloc_regs (reg + 1);
457404 fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_OFFSET;
458405 fs->regs.reg[reg].loc.offset = offset;
459406 break;
@@ -466,14 +413,14 @@ execute_cfa_program (struct dwarf2_fde *fde, const gdb_byte *insn_ptr,
466413 case DW_CFA_undefined:
467414 insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &reg);
468415 reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
469- dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
416+ fs->regs.alloc_regs (reg + 1);
470417 fs->regs.reg[reg].how = DWARF2_FRAME_REG_UNDEFINED;
471418 break;
472419
473420 case DW_CFA_same_value:
474421 insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &reg);
475422 reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
476- dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
423+ fs->regs.alloc_regs (reg + 1);
477424 fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAME_VALUE;
478425 break;
479426
@@ -482,7 +429,7 @@ execute_cfa_program (struct dwarf2_fde *fde, const gdb_byte *insn_ptr,
482429 reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
483430 insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &utmp);
484431 utmp = dwarf2_frame_adjust_regnum (gdbarch, utmp, eh_frame_p);
485- dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
432+ fs->regs.alloc_regs (reg + 1);
486433 fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_REG;
487434 fs->regs.reg[reg].loc.reg = utmp;
488435 break;
@@ -491,9 +438,7 @@ execute_cfa_program (struct dwarf2_fde *fde, const gdb_byte *insn_ptr,
491438 {
492439 struct dwarf2_frame_state_reg_info *new_rs;
493440
494- new_rs = XNEW (struct dwarf2_frame_state_reg_info);
495- *new_rs = fs->regs;
496- fs->regs.reg = dwarf2_frame_state_copy_regs (&fs->regs);
441+ new_rs = new dwarf2_frame_state_reg_info (fs->regs);
497442 fs->regs.prev = new_rs;
498443 }
499444 break;
@@ -509,11 +454,7 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
509454 paddress (gdbarch, fs->pc));
510455 }
511456 else
512- {
513- xfree (fs->regs.reg);
514- fs->regs = *old_rs;
515- xfree (old_rs);
516- }
457+ fs->regs = std::move (*old_rs);
517458 }
518459 break;
519460
@@ -560,7 +501,7 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
560501 case DW_CFA_expression:
561502 insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &reg);
562503 reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
563- dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
504+ fs->regs.alloc_regs (reg + 1);
564505 insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &utmp);
565506 fs->regs.reg[reg].loc.exp.start = insn_ptr;
566507 fs->regs.reg[reg].loc.exp.len = utmp;
@@ -573,14 +514,14 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
573514 reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
574515 insn_ptr = safe_read_sleb128 (insn_ptr, insn_end, &offset);
575516 offset *= fs->data_align;
576- dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
517+ fs->regs.alloc_regs (reg + 1);
577518 fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_OFFSET;
578519 fs->regs.reg[reg].loc.offset = offset;
579520 break;
580521
581522 case DW_CFA_val_offset:
582523 insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &reg);
583- dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
524+ fs->regs.alloc_regs (reg + 1);
584525 insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &utmp);
585526 offset = utmp * fs->data_align;
586527 fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_VAL_OFFSET;
@@ -589,7 +530,7 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
589530
590531 case DW_CFA_val_offset_sf:
591532 insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &reg);
592- dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
533+ fs->regs.alloc_regs (reg + 1);
593534 insn_ptr = safe_read_sleb128 (insn_ptr, insn_end, &offset);
594535 offset *= fs->data_align;
595536 fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_VAL_OFFSET;
@@ -598,7 +539,7 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
598539
599540 case DW_CFA_val_expression:
600541 insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &reg);
601- dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
542+ fs->regs.alloc_regs (reg + 1);
602543 insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &utmp);
603544 fs->regs.reg[reg].loc.exp.start = insn_ptr;
604545 fs->regs.reg[reg].loc.exp.len = utmp;
@@ -631,7 +572,7 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
631572 reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
632573 insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &utmp);
633574 offset = utmp * fs->data_align;
634- dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
575+ fs->regs.alloc_regs (reg + 1);
635576 fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_OFFSET;
636577 fs->regs.reg[reg].loc.offset = -offset;
637578 break;
@@ -655,12 +596,73 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
655596 if (fs->initial.reg == NULL)
656597 {
657598 /* Don't allow remember/restore between CIE and FDE programs. */
658- dwarf2_frame_state_free_regs (fs->regs.prev);
599+ delete fs->regs.prev;
659600 fs->regs.prev = NULL;
660601 }
661602
662603 return insn_ptr;
663604 }
605+
606+#if GDB_SELF_TEST
607+
608+namespace selftests {
609+
610+/* Unit test to function execute_cfa_program. */
611+
612+static void
613+execute_cfa_program_test (struct gdbarch *gdbarch)
614+{
615+ struct dwarf2_fde fde;
616+ struct dwarf2_cie cie;
617+
618+ memset (&fde, 0, sizeof fde);
619+ memset (&cie, 0, sizeof cie);
620+
621+ cie.data_alignment_factor = -4;
622+ cie.code_alignment_factor = 2;
623+ fde.cie = &cie;
624+
625+ dwarf2_frame_state fs (0, fde.cie);
626+
627+ gdb_byte insns[] =
628+ {
629+ DW_CFA_def_cfa, 1, 4, /* DW_CFA_def_cfa: r1 ofs 4 */
630+ DW_CFA_offset | 0x2, 1, /* DW_CFA_offset: r2 at cfa-4 */
631+ DW_CFA_remember_state,
632+ DW_CFA_restore_state,
633+ };
634+
635+ const gdb_byte *insn_end = insns + sizeof (insns);
636+ const gdb_byte *out = execute_cfa_program (&fde, insns, insn_end, gdbarch,
637+ 0, &fs);
638+
639+ SELF_CHECK (out == insn_end);
640+ SELF_CHECK (fs.pc == 0);
641+
642+ /* The instructions above only use r1 and r2, but the register numbers
643+ used are adjusted by dwarf2_frame_adjust_regnum. */
644+ auto r1 = dwarf2_frame_adjust_regnum (gdbarch, 1, fde.eh_frame_p);
645+ auto r2 = dwarf2_frame_adjust_regnum (gdbarch, 2, fde.eh_frame_p);
646+
647+ SELF_CHECK (fs.regs.num_regs == (std::max (r1, r2) + 1));
648+
649+ SELF_CHECK (fs.regs.reg[r2].how == DWARF2_FRAME_REG_SAVED_OFFSET);
650+ SELF_CHECK (fs.regs.reg[r2].loc.offset == -4);
651+
652+ for (auto i = 0; i < fs.regs.num_regs; i++)
653+ if (i != r2)
654+ SELF_CHECK (fs.regs.reg[i].how == DWARF2_FRAME_REG_UNSPECIFIED);
655+
656+ SELF_CHECK (fs.regs.cfa_reg == 1);
657+ SELF_CHECK (fs.regs.cfa_offset == 4);
658+ SELF_CHECK (fs.regs.cfa_how == CFA_REG_OFFSET);
659+ SELF_CHECK (fs.regs.cfa_exp == NULL);
660+ SELF_CHECK (fs.regs.prev == NULL);
661+}
662+
663+} // namespace selftests
664+#endif /* GDB_SELF_TEST */
665+
664666
665667
666668 /* Architecture-specific operations. */
@@ -884,7 +886,6 @@ dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc,
884886
885887 /* Save the initialized register set. */
886888 fs.initial = fs.regs;
887- fs.initial.reg = dwarf2_frame_state_copy_regs (&fs.regs);
888889
889890 /* Then decode the insns in the FDE up to our target PC. */
890891 execute_cfa_program (fde, fde->instructions, fde->end, gdbarch, pc, &fs);
@@ -1026,7 +1027,6 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
10261027
10271028 /* Save the initialized register set. */
10281029 fs.initial = fs.regs;
1029- fs.initial.reg = dwarf2_frame_state_copy_regs (&fs.regs);
10301030
10311031 if (get_frame_func_if_available (this_frame, &entry_pc))
10321032 {
@@ -2418,4 +2418,8 @@ _initialize_dwarf2_frame (void)
24182418 {
24192419 dwarf2_frame_data = gdbarch_data_register_pre_init (dwarf2_frame_init);
24202420 dwarf2_frame_objfile_data = register_objfile_data ();
2421+
2422+#if GDB_SELF_TEST
2423+ register_self_test_foreach_arch (selftests::execute_cfa_program_test);
2424+#endif
24212425 }
--- a/gdb/dwarf2-frame.h
+++ b/gdb/dwarf2-frame.h
@@ -94,16 +94,85 @@ enum cfa_how_kind
9494
9595 struct dwarf2_frame_state_reg_info
9696 {
97- struct dwarf2_frame_state_reg *reg;
98- int num_regs;
97+ dwarf2_frame_state_reg_info () = default;
98+ ~dwarf2_frame_state_reg_info ()
99+ {
100+ delete prev;
101+ xfree (reg);
102+ }
103+
104+ /* Copy constructor. */
105+ dwarf2_frame_state_reg_info (const dwarf2_frame_state_reg_info &src)
106+ : num_regs (src.num_regs), cfa_offset (src.cfa_offset),
107+ cfa_reg (src.cfa_reg), cfa_how (src.cfa_how), cfa_exp (src.cfa_exp),
108+ prev (src.prev)
109+ {
110+ size_t size = src.num_regs * sizeof (struct dwarf2_frame_state_reg);
111+
112+ reg = (struct dwarf2_frame_state_reg *) xmalloc (size);
113+ memcpy (reg, src.reg, size);
114+ }
115+
116+ /* Assignment operator for both move-assignment and copy-assignment. */
117+ dwarf2_frame_state_reg_info&
118+ operator= (dwarf2_frame_state_reg_info rhs)
119+ {
120+ swap (*this, rhs);
121+ return *this;
122+ }
123+
124+ /* Move constructor. */
125+ dwarf2_frame_state_reg_info (dwarf2_frame_state_reg_info &&rhs) noexcept
126+ : reg (rhs.reg), num_regs (rhs.num_regs), cfa_offset (rhs.cfa_offset),
127+ cfa_reg (rhs.cfa_reg), cfa_how (rhs.cfa_how), cfa_exp (rhs.cfa_exp),
128+ prev (rhs.prev)
129+ {
130+ rhs.prev = nullptr;
131+ rhs.reg = nullptr;
132+ }
99133
100- LONGEST cfa_offset;
101- ULONGEST cfa_reg;
102- enum cfa_how_kind cfa_how;
103- const gdb_byte *cfa_exp;
134+/* Assert that the register set RS is large enough to store gdbarch_num_regs
135+ columns. If necessary, enlarge the register set. */
136+ void alloc_regs (int num_regs_requested)
137+ {
138+ if (num_regs_requested <= num_regs)
139+ return;
140+
141+ size_t size = sizeof (struct dwarf2_frame_state_reg);
142+
143+ reg = (struct dwarf2_frame_state_reg *)
144+ xrealloc (reg, num_regs_requested * size);
145+
146+ /* Initialize newly allocated registers. */
147+ memset (reg + num_regs, 0, (num_regs_requested - num_regs) * size);
148+ num_regs = num_regs_requested;
149+ }
150+
151+ struct dwarf2_frame_state_reg *reg = NULL;
152+ int num_regs = 0;
153+
154+ LONGEST cfa_offset = 0;
155+ ULONGEST cfa_reg = 0;
156+ enum cfa_how_kind cfa_how = CFA_UNSET;
157+ const gdb_byte *cfa_exp = NULL;
104158
105159 /* Used to implement DW_CFA_remember_state. */
106- struct dwarf2_frame_state_reg_info *prev;
160+ struct dwarf2_frame_state_reg_info *prev = NULL;
161+
162+private:
163+ friend void swap (dwarf2_frame_state_reg_info& lhs,
164+ dwarf2_frame_state_reg_info& rhs)
165+ {
166+ using std::swap;
167+
168+ swap (lhs.reg, rhs.reg);
169+ swap (lhs.num_regs, rhs.num_regs);
170+ swap (lhs.cfa_offset, rhs.cfa_offset);
171+ swap (lhs.cfa_reg, rhs.cfa_reg);
172+ swap (lhs.cfa_how, rhs.cfa_how);
173+ swap (lhs.cfa_exp, rhs.cfa_exp);
174+ swap (lhs.prev, rhs.prev);
175+ }
107176 };
108177
109178 struct dwarf2_cie;
@@ -113,7 +182,6 @@ struct dwarf2_cie;
113182 struct dwarf2_frame_state
114183 {
115184 dwarf2_frame_state (CORE_ADDR pc, struct dwarf2_cie *cie);
116- ~dwarf2_frame_state ();
117185
118186 /* Each register save state can be described in terms of a CFA slot,
119187 another register, or a location expression. */
@@ -180,12 +248,6 @@ extern const struct frame_base *
180248
181249 CORE_ADDR dwarf2_frame_cfa (struct frame_info *this_frame);
182250
183-/* Assert that the register set RS is large enough to store gdbarch_num_regs
184- columns. If necessary, enlarge the register set. */
185-
186-void dwarf2_frame_state_alloc_regs (struct dwarf2_frame_state_reg_info *rs,
187- int num_regs);
188-
189251 /* Find the CFA information for PC.
190252
191253 Return 1 if a register is used for the CFA, or 0 if another
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -1588,7 +1588,7 @@ sparc_execute_dwarf_cfa_vendor_op (struct gdbarch *gdbarch, gdb_byte op,
15881588 uint64_t reg;
15891589 int size = register_size (gdbarch, 0);
15901590
1591- dwarf2_frame_state_alloc_regs (&fs->regs, 32);
1591+ fs->regs.alloc_regs (32);
15921592 for (reg = 8; reg < 16; reg++)
15931593 {
15941594 fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_REG;