From: Doug Evans Date: Thu, 20 Feb 2014 17:27:12 +0000 (-0800) Subject: Move containing_scm arg from gdbscm_fill_eqable_gsmob_ptr_slot X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1254eefca2c2af47e8333bbc33d878998703a204;p=binutils-gdb.git Move containing_scm arg from gdbscm_fill_eqable_gsmob_ptr_slot to gdbscm_init_eqable_gsmob. * guile/scm-gsmob.c (gdbscm_init_eqable_gsmob): New arg containing_scm. All callers updated. (gdbscm_fill_eqable_gsmob_ptr_slot): Delete arg containing_scm. All callers updated. * guile/guile-internal.h (gdbscm_init_eqable_gsmob): Update. (gdbscm_fill_eqable_gsmob_ptr_slot): Update. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 40b60559141..56202695fef 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2014-02-20 Doug Evans + + * guile/scm-gsmob.c (gdbscm_init_eqable_gsmob): New arg containing_scm. + All callers updated. + (gdbscm_fill_eqable_gsmob_ptr_slot): Delete arg containing_scm. + All callers updated. + * guile/guile-internal.h (gdbscm_init_eqable_gsmob): Update. + (gdbscm_fill_eqable_gsmob_ptr_slot): Update. + 2014-02-20 lin zuojian Joel Brobecker Doug Evans diff --git a/gdb/guile/guile-internal.h b/gdb/guile/guile-internal.h index dcdd422000d..f95f0920283 100644 --- a/gdb/guile/guile-internal.h +++ b/gdb/guile/guile-internal.h @@ -219,7 +219,8 @@ extern void gdbscm_init_gsmob (gdb_smob *base); extern void gdbscm_init_chained_gsmob (chained_gdb_smob *base); -extern void gdbscm_init_eqable_gsmob (eqable_gdb_smob *base); +extern void gdbscm_init_eqable_gsmob (eqable_gdb_smob *base, + SCM containing_scm); extern SCM gdbscm_mark_gsmob (gdb_smob *base); @@ -242,8 +243,7 @@ extern eqable_gdb_smob **gdbscm_find_eqable_gsmob_ptr_slot (htab_t htab, eqable_gdb_smob *base); extern void gdbscm_fill_eqable_gsmob_ptr_slot (eqable_gdb_smob **slot, - eqable_gdb_smob *base, - SCM containing_scm); + eqable_gdb_smob *base); extern void gdbscm_clear_eqable_gsmob_ptr_slot (htab_t htab, eqable_gdb_smob *base); diff --git a/gdb/guile/scm-block.c b/gdb/guile/scm-block.c index de41af21096..4e1748ea51b 100644 --- a/gdb/guile/scm-block.c +++ b/gdb/guile/scm-block.c @@ -193,7 +193,7 @@ bkscm_make_block_smob (void) b_smob->block = NULL; b_smob->objfile = NULL; b_scm = scm_new_smob (block_smob_tag, (scm_t_bits) b_smob); - gdbscm_init_eqable_gsmob (&b_smob->base); + gdbscm_init_eqable_gsmob (&b_smob->base, b_scm); return b_scm; } @@ -237,7 +237,7 @@ bkscm_scm_from_block (const struct block *block, struct objfile *objfile) b_smob = (block_smob *) SCM_SMOB_DATA (b_scm); b_smob->block = block; b_smob->objfile = objfile; - gdbscm_fill_eqable_gsmob_ptr_slot (slot, &b_smob->base, b_scm); + gdbscm_fill_eqable_gsmob_ptr_slot (slot, &b_smob->base); return b_scm; } diff --git a/gdb/guile/scm-frame.c b/gdb/guile/scm-frame.c index a46d1e32986..6031a7ff342 100644 --- a/gdb/guile/scm-frame.c +++ b/gdb/guile/scm-frame.c @@ -201,7 +201,7 @@ frscm_make_frame_smob (void) f_smob->inferior = NULL; f_smob->frame_id_is_next = 0; f_scm = scm_new_smob (frame_smob_tag, (scm_t_bits) f_smob); - gdbscm_init_eqable_gsmob (&f_smob->base); + gdbscm_init_eqable_gsmob (&f_smob->base, f_scm); return f_scm; } @@ -275,7 +275,7 @@ frscm_scm_from_frame (struct frame_info *frame, struct inferior *inferior) f_smob->inferior = inferior; f_smob->frame_id_is_next = frame_id_is_next; - gdbscm_fill_eqable_gsmob_ptr_slot (slot, &f_smob->base, f_scm); + gdbscm_fill_eqable_gsmob_ptr_slot (slot, &f_smob->base); return f_scm; } diff --git a/gdb/guile/scm-gsmob.c b/gdb/guile/scm-gsmob.c index 5f9e856914d..b0f9e195664 100644 --- a/gdb/guile/scm-gsmob.c +++ b/gdb/guile/scm-gsmob.c @@ -148,13 +148,13 @@ gdbscm_init_chained_gsmob (chained_gdb_smob *base) /* Initialize an eqable_gdb_smob. This is the same as gdbscm_init_gsmob except that it also sets - containing_scm to #f. */ + BASE->containing_scm to CONTAINING_SCM. */ void -gdbscm_init_eqable_gsmob (eqable_gdb_smob *base) +gdbscm_init_eqable_gsmob (eqable_gdb_smob *base, SCM containing_scm) { gdbscm_init_gsmob ((gdb_smob *) base); - base->containing_scm = SCM_BOOL_F; + base->containing_scm = containing_scm; } /* Call this from each smob's "mark" routine. @@ -419,16 +419,13 @@ gdbscm_find_eqable_gsmob_ptr_slot (htab_t htab, eqable_gdb_smob *base) return (eqable_gdb_smob **) slot; } -/* Record CONTAINING_SCM as the object containing BASE, and record it in - SLOT. SLOT must be the result of calling gdbscm_find_eqable_gsmob_ptr_slot - on BASE (or equivalent for lookup). */ +/* Record BASE in SLOT. SLOT must be the result of calling + gdbscm_find_eqable_gsmob_ptr_slot on BASE (or equivalent for lookup). */ void gdbscm_fill_eqable_gsmob_ptr_slot (eqable_gdb_smob **slot, - eqable_gdb_smob *base, - SCM containing_scm) + eqable_gdb_smob *base) { - base->containing_scm = containing_scm; *slot = base; } diff --git a/gdb/guile/scm-symbol.c b/gdb/guile/scm-symbol.c index 53cc2721b5f..0c5cc053c5c 100644 --- a/gdb/guile/scm-symbol.c +++ b/gdb/guile/scm-symbol.c @@ -159,7 +159,7 @@ syscm_make_symbol_smob (void) s_smob->symbol = NULL; s_scm = scm_new_smob (symbol_smob_tag, (scm_t_bits) s_smob); - gdbscm_init_eqable_gsmob (&s_smob->base); + gdbscm_init_eqable_gsmob (&s_smob->base, s_scm); return s_scm; } @@ -202,7 +202,7 @@ syscm_scm_from_symbol (struct symbol *symbol) s_scm = syscm_make_symbol_smob (); s_smob = (symbol_smob *) SCM_SMOB_DATA (s_scm); s_smob->symbol = symbol; - gdbscm_fill_eqable_gsmob_ptr_slot (slot, &s_smob->base, s_scm); + gdbscm_fill_eqable_gsmob_ptr_slot (slot, &s_smob->base); return s_scm; } diff --git a/gdb/guile/scm-symtab.c b/gdb/guile/scm-symtab.c index 910d8b7dfe9..7294fea0608 100644 --- a/gdb/guile/scm-symtab.c +++ b/gdb/guile/scm-symtab.c @@ -184,7 +184,7 @@ stscm_make_symtab_smob (void) st_smob->symtab = NULL; st_scm = scm_new_smob (symtab_smob_tag, (scm_t_bits) st_smob); - gdbscm_init_eqable_gsmob (&st_smob->base); + gdbscm_init_eqable_gsmob (&st_smob->base, st_scm); return st_scm; } @@ -226,7 +226,7 @@ stscm_scm_from_symtab (struct symtab *symtab) st_scm = stscm_make_symtab_smob (); st_smob = (symtab_smob *) SCM_SMOB_DATA (st_scm); st_smob->symtab = symtab; - gdbscm_fill_eqable_gsmob_ptr_slot (slot, &st_smob->base, st_scm); + gdbscm_fill_eqable_gsmob_ptr_slot (slot, &st_smob->base); return st_scm; } diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c index 36cba799df3..4fa0c28ed87 100644 --- a/gdb/guile/scm-type.c +++ b/gdb/guile/scm-type.c @@ -283,7 +283,7 @@ tyscm_make_type_smob (void) t_smob->type = NULL; t_scm = scm_new_smob (type_smob_tag, (scm_t_bits) t_smob); - gdbscm_init_eqable_gsmob (&t_smob->base); + gdbscm_init_eqable_gsmob (&t_smob->base, t_scm); return t_scm; } @@ -326,7 +326,7 @@ tyscm_scm_from_type (struct type *type) t_scm = tyscm_make_type_smob (); t_smob = (type_smob *) SCM_SMOB_DATA (t_scm); t_smob->type = type; - gdbscm_fill_eqable_gsmob_ptr_slot (slot, &t_smob->base, t_scm); + gdbscm_fill_eqable_gsmob_ptr_slot (slot, &t_smob->base); return t_scm; }