Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/2] add calls to frame_base_set_default
@ 2014-02-11  9:26 Sanimir Agovic
  2014-02-11  9:26 ` [PATCH 1/2] nios2-tdep: set default frame base Sanimir Agovic
  2014-02-11  9:26 ` [PATCH 2/2] tic6x-tdep: " Sanimir Agovic
  0 siblings, 2 replies; 8+ messages in thread
From: Sanimir Agovic @ 2014-02-11  9:26 UTC (permalink / raw)
  To: sandra, yao; +Cc: gdb-patches

Hello,

while removing declared but not referenced variables I came across of two
findings:

 nios2-tdep.c(1350): static const struct frame_base nios2_stub_frame_base
 tic6x-tdep.c(485): static const struct frame_base tic6x_frame_base

Both are declared but not referenced. Instead of removing, I added a call
to frame_base_set_default in the appropriated *_gdbarch_init function and
passed the frame_base structure.
Build with --enable-targets=all, but I could not test my change on actual
hardware.

Looking back at the history it seems that these mentioned variables have
never been used. So removing them might be an alternative to this patch.

Sanimir Agovic (2):
  nios2-tdep: set default frame base
  tic6x-tdep: set default frame base

 gdb/nios2-tdep.c | 1 +
 gdb/tic6x-tdep.c | 1 +
 2 files changed, 2 insertions(+)

-- 
1.8.4.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] nios2-tdep: set default frame base
  2014-02-11  9:26 [PATCH 0/2] add calls to frame_base_set_default Sanimir Agovic
@ 2014-02-11  9:26 ` Sanimir Agovic
  2014-02-12  1:22   ` Yao Qi
  2014-02-11  9:26 ` [PATCH 2/2] tic6x-tdep: " Sanimir Agovic
  1 sibling, 1 reply; 8+ messages in thread
From: Sanimir Agovic @ 2014-02-11  9:26 UTC (permalink / raw)
  To: sandra, yao; +Cc: gdb-patches

2014-02-11  Sanimir Agovic  <sanimir.agovic@intel.com>

	* nios2-tdep.c (nios2_gdbarch_init): Call frame_base_set_default.


Signed-off-by: Sanimir Agovic <sanimir.agovic@intel.com>
---
 gdb/nios2-tdep.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c
index 8f18739..b83c8a5 100644
--- a/gdb/nios2-tdep.c
+++ b/gdb/nios2-tdep.c
@@ -1595,6 +1595,7 @@ nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   dwarf2_append_unwinders (gdbarch);
   frame_unwind_append_unwinder (gdbarch, &nios2_stub_frame_unwind);
   frame_unwind_append_unwinder (gdbarch, &nios2_frame_unwind);
+  frame_base_set_default (gdbarch, &nios2_stub_frame_base);
 
   /* Single stepping.  */
   set_gdbarch_software_single_step (gdbarch, nios2_software_single_step);
-- 
1.8.4.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/2] tic6x-tdep: set default frame base
  2014-02-11  9:26 [PATCH 0/2] add calls to frame_base_set_default Sanimir Agovic
  2014-02-11  9:26 ` [PATCH 1/2] nios2-tdep: set default frame base Sanimir Agovic
@ 2014-02-11  9:26 ` Sanimir Agovic
  2014-02-12  0:48   ` Yao Qi
  1 sibling, 1 reply; 8+ messages in thread
From: Sanimir Agovic @ 2014-02-11  9:26 UTC (permalink / raw)
  To: sandra, yao; +Cc: gdb-patches

2014-02-11  Sanimir Agovic  <sanimir.agovic@intel.com>

	* tic6x-tdep.c (tic6x_gdbarch_init): Call frame_base_set_default.


Signed-off-by: Sanimir Agovic <sanimir.agovic@intel.com>
---
 gdb/tic6x-tdep.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c
index 36b0d9e..96fa83e 100644
--- a/gdb/tic6x-tdep.c
+++ b/gdb/tic6x-tdep.c
@@ -1308,6 +1308,7 @@ tic6x_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   frame_unwind_append_unwinder (gdbarch, &tic6x_stub_unwind);
   frame_unwind_append_unwinder (gdbarch, &tic6x_frame_unwind);
+  frame_base_set_default (gdbarch, &tic6x_frame_base);
 
   dwarf2_frame_set_init_reg (gdbarch, tic6x_dwarf2_frame_init_reg);
 
-- 
1.8.4.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] tic6x-tdep: set default frame base
  2014-02-11  9:26 ` [PATCH 2/2] tic6x-tdep: " Sanimir Agovic
@ 2014-02-12  0:48   ` Yao Qi
  0 siblings, 0 replies; 8+ messages in thread
From: Yao Qi @ 2014-02-12  0:48 UTC (permalink / raw)
  To: Sanimir Agovic; +Cc: sandra, gdb-patches

On 02/11/2014 05:26 PM, Sanimir Agovic wrote:
> 2014-02-11  Sanimir Agovic  <sanimir.agovic@intel.com>
> 
> 	* tic6x-tdep.c (tic6x_gdbarch_init): Call frame_base_set_default.

OK, thanks.

-- 
Yao (齐尧)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] nios2-tdep: set default frame base
  2014-02-11  9:26 ` [PATCH 1/2] nios2-tdep: set default frame base Sanimir Agovic
@ 2014-02-12  1:22   ` Yao Qi
  2014-02-12  2:24     ` Sandra Loosemore
  2014-02-12 10:04     ` Agovic, Sanimir
  0 siblings, 2 replies; 8+ messages in thread
From: Yao Qi @ 2014-02-12  1:22 UTC (permalink / raw)
  To: Sanimir Agovic; +Cc: sandra, gdb-patches

On 02/11/2014 05:26 PM, Sanimir Agovic wrote:
> @@ -1595,6 +1595,7 @@ nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
>    dwarf2_append_unwinders (gdbarch);
>    frame_unwind_append_unwinder (gdbarch, &nios2_stub_frame_unwind);
>    frame_unwind_append_unwinder (gdbarch, &nios2_frame_unwind);
> +  frame_base_set_default (gdbarch, &nios2_stub_frame_base);

Sanimir,
some lines below, we have:

  frame_unwind_append_unwinder (gdbarch, &nios2_frame_unwind);

  /* Single stepping.  */
  set_gdbarch_software_single_step (gdbarch, nios2_software_single_step);

  /* Hook in ABI-specific overrides, if they have been registered.  */
  gdbarch_init_osabi (info, gdbarch);

  if (tdep->jb_pc >= 0)
    set_gdbarch_get_longjmp_target (gdbarch, nios2_get_longjmp_target);

  frame_base_set_default (gdbarch, &nios2_frame_base);
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

so looks we can remove nios2_stub_frame_base.

-- 
Yao (齐尧)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] nios2-tdep: set default frame base
  2014-02-12  1:22   ` Yao Qi
@ 2014-02-12  2:24     ` Sandra Loosemore
  2014-02-12 10:04     ` Agovic, Sanimir
  1 sibling, 0 replies; 8+ messages in thread
From: Sandra Loosemore @ 2014-02-12  2:24 UTC (permalink / raw)
  To: Yao Qi; +Cc: Sanimir Agovic, gdb-patches

On 02/11/2014 06:20 PM, Yao Qi wrote:
> On 02/11/2014 05:26 PM, Sanimir Agovic wrote:
>> @@ -1595,6 +1595,7 @@ nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
>>     dwarf2_append_unwinders (gdbarch);
>>     frame_unwind_append_unwinder (gdbarch, &nios2_stub_frame_unwind);
>>     frame_unwind_append_unwinder (gdbarch, &nios2_frame_unwind);
>> +  frame_base_set_default (gdbarch, &nios2_stub_frame_base);
>
> Sanimir,
> some lines below, we have:
>
>    frame_unwind_append_unwinder (gdbarch, &nios2_frame_unwind);
>
>    /* Single stepping.  */
>    set_gdbarch_software_single_step (gdbarch, nios2_software_single_step);
>
>    /* Hook in ABI-specific overrides, if they have been registered.  */
>    gdbarch_init_osabi (info, gdbarch);
>
>    if (tdep->jb_pc >= 0)
>      set_gdbarch_get_longjmp_target (gdbarch, nios2_get_longjmp_target);
>
>    frame_base_set_default (gdbarch, &nios2_frame_base);
>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> so looks we can remove nios2_stub_frame_base.

Removing the unused variable looks like the most conservatively correct 
fix to me, too.

Sanimir, thank you for finding this buglet.  :-)

-Sandra


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 1/2] nios2-tdep: set default frame base
  2014-02-12  1:22   ` Yao Qi
  2014-02-12  2:24     ` Sandra Loosemore
@ 2014-02-12 10:04     ` Agovic, Sanimir
  2014-02-12 11:36       ` Yao Qi
  1 sibling, 1 reply; 8+ messages in thread
From: Agovic, Sanimir @ 2014-02-12 10:04 UTC (permalink / raw)
  To: 'Yao Qi'; +Cc: sandra, gdb-patches

Thanks Yao. Is it OK to commit both patches? Below the updated patch.


nios2-tdep: remove unreferenced global nios2_stub_frame_base

2014-02-11  Sanimir Agovic  <sanimir.agovic@intel.com>

	* nios2-tdep.c (nios2_stub_frame_base): Remove global.

diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c
index 8f18739..ca653f7 100644
--- a/gdb/nios2-tdep.c
+++ b/gdb/nios2-tdep.c
@@ -1354,14 +1354,6 @@ static const struct frame_unwind nios2_stub_frame_unwind =
   nios2_stub_frame_sniffer
 };

-static const struct frame_base nios2_stub_frame_base =
-{
-  &nios2_stub_frame_unwind,
-  nios2_stub_frame_base_address,
-  nios2_stub_frame_base_address,
-  nios2_stub_frame_base_address
-};
-
 /* Helper function to read an instruction at PC.  */

 static unsigned long 

> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf
> Of Yao Qi
> Sent: Wednesday, February 12, 2014 02:21 AM
> To: Agovic, Sanimir
> Cc: sandra@codesourcery.com; gdb-patches@sourceware.org
> Subject: Re: [PATCH 1/2] nios2-tdep: set default frame base
> 
> On 02/11/2014 05:26 PM, Sanimir Agovic wrote:
> > @@ -1595,6 +1595,7 @@ nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list
> *arches)
> >    dwarf2_append_unwinders (gdbarch);
> >    frame_unwind_append_unwinder (gdbarch, &nios2_stub_frame_unwind);
> >    frame_unwind_append_unwinder (gdbarch, &nios2_frame_unwind);
> > +  frame_base_set_default (gdbarch, &nios2_stub_frame_base);
> 
> Sanimir,
> some lines below, we have:
> 
>   frame_unwind_append_unwinder (gdbarch, &nios2_frame_unwind);
> 
>   /* Single stepping.  */
>   set_gdbarch_software_single_step (gdbarch, nios2_software_single_step);
> 
>   /* Hook in ABI-specific overrides, if they have been registered.  */
>   gdbarch_init_osabi (info, gdbarch);
> 
>   if (tdep->jb_pc >= 0)
>     set_gdbarch_get_longjmp_target (gdbarch, nios2_get_longjmp_target);
> 
>   frame_base_set_default (gdbarch, &nios2_frame_base);
>   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> so looks we can remove nios2_stub_frame_base.
> 
> --
> Yao (齐尧)
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] nios2-tdep: set default frame base
  2014-02-12 10:04     ` Agovic, Sanimir
@ 2014-02-12 11:36       ` Yao Qi
  0 siblings, 0 replies; 8+ messages in thread
From: Yao Qi @ 2014-02-12 11:36 UTC (permalink / raw)
  To: Agovic, Sanimir; +Cc: sandra, gdb-patches

On 02/12/2014 06:04 PM, Agovic, Sanimir wrote:
> nios2-tdep: remove unreferenced global nios2_stub_frame_base
> 
> 2014-02-11  Sanimir Agovic  <sanimir.agovic@intel.com>
> 
> 	* nios2-tdep.c (nios2_stub_frame_base): Remove global.

This cleanup is obvious.  It is OK to commit.

-- 
Yao (齐尧)


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-02-12 11:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-11  9:26 [PATCH 0/2] add calls to frame_base_set_default Sanimir Agovic
2014-02-11  9:26 ` [PATCH 1/2] nios2-tdep: set default frame base Sanimir Agovic
2014-02-12  1:22   ` Yao Qi
2014-02-12  2:24     ` Sandra Loosemore
2014-02-12 10:04     ` Agovic, Sanimir
2014-02-12 11:36       ` Yao Qi
2014-02-11  9:26 ` [PATCH 2/2] tic6x-tdep: " Sanimir Agovic
2014-02-12  0:48   ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox