Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [Patch H8/300]  : Fix for  crashing of gdb with" info f" command
@ 2004-06-18 10:35 Sherry Samuel
  2004-06-22 20:09 ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: Sherry Samuel @ 2004-06-18 10:35 UTC (permalink / raw)
  To: gdb-patches

Hi,
	GDB6.1 for H8/300 targets crashes with "info f" command with a breakpoint in main. 

**********************************************************************************************
Try the code below with h8300-elf toolchain
----------------Start of bug.c ---------------------
1 int main()
2 {
3 int i;
4
5 i=0;
6 }
----------------End of bug.c ------------------------

Compile with

h8300-elf-gcc  bug.c -g

Load the a.out file produced into gdb simulator. Put a break point in line 2 of main and run gdb. 
When the control reaches the breakpoint at main, try to get the frame information by the "info f" 
command. The gdb crashes.

While just before entering main, the frame pointer register is not set. It contains 0x00. At this point 
if we try to take the frame information by "info f" command the gdb crashes. After the frame pointer 
register is set, gdb will not crash by the "info f" command.

This bug is not observed for gdb6.1 for SH targets.

**************************************************************************************************

Please find the patch below which fixes the same.

******************CHANGELOG TEXT*******************************************************************
2004-06-18  Sherry Samuel  <SherryS@KPITCummins.com>

	* h8300-tdep.c (h8300_frame_init_saved_regs) : Check whether frame base 
	is null.	
***************************************************************************************************

--- gdb-6.1/gdb/h8300-tdep.c.old	2004-06-17 15:57:18.000000000 +0530
+++ gdb-6.1/gdb/h8300-tdep.c	2004-06-17 17:08:54.000000000 +0530
@@ -500,8 +500,8 @@ h8300_frame_init_saved_regs (struct fram
 	  CORE_ADDR limit = (sal.end && sal.end < get_frame_pc (fi))
 	    ? sal.end : get_frame_pc (fi);
 	  /* This will fill in fields in fi. */
-
-
+	  if(!get_frame_base (fi))//check whether frame is null.
+	  	return null_frame_id;//if null return
 
 	  h8300_examine_prologue (func_addr, limit, get_frame_base (fi),
 				  deprecated_get_frame_saved_regs (fi), fi);


***************************************************************************************

	
Regards,
Sherry Samuel,
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series.
The following site also offers free technical support to its users. 
Visit http://www.kpitgnutools.com for details. 
Latest versions of KPIT GNU tools are released on June 1, 2004.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 


^ permalink raw reply	[flat|nested] 4+ messages in thread
* RE: [Patch H8/300]  : Fix for  crashing of gdb with" info f" command
@ 2004-07-09 12:12 Sherry Samuel
  2004-07-15 18:18 ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: Sherry Samuel @ 2004-07-09 12:12 UTC (permalink / raw)
  To: cagney; +Cc: gdb-patches

Hi
Reference:http://sources.redhat.com/ml/gdb-patches/2004-06/msg00428.html

In the latest GDB(gdb+dejagnu-20040630) snap shot, the "info f" problem described in the above link is fixed. Referring through the links you have suggested, it is evident that h8300 target is not in the list of the new GDB frame structure. Is it possible to know what should be done from our side to update H8300 targets to the new frame work? Can you suggest how to go about it?

Thanks in advance.


Sherry Samuel,
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series.
The following site also offers free technical support to its users. 
Visit http://www.kpitgnutools.com for details. 
Latest versions of KPIT GNU tools are released on June 1, 2004.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 





-----Original Message-----
From: Andrew Cagney [mailto:cagney@gnu.org]
Sent: Wednesday, June 23, 2004 1:39 AM
To: Sherry Samuel
Cc: gdb-patches@sources.redhat.com
Subject: Re: [Patch H8/300] : Fix for crashing of gdb with" info f"
command



> ******************CHANGELOG TEXT*******************************************************************
> 2004-06-18  Sherry Samuel  <SherryS@KPITCummins.com>
> 
> 	* h8300-tdep.c (h8300_frame_init_saved_regs) : Check whether frame base 
> 	is null.	

Are you sure this patch is against 6.1 or a current GDB?  The function 
h8300_frame_init_saved_regs has a void return type.

Also, you might want to read over:
   Post GDB 6.2, require new frame code
   http://sources.redhat.com/ml/gdb/2004-06/msg00199.html
As this will affect the h8/300.

Andrew

> 
> --- gdb-6.1/gdb/h8300-tdep.c.old	2004-06-17 15:57:18.000000000 +0530
> +++ gdb-6.1/gdb/h8300-tdep.c	2004-06-17 17:08:54.000000000 +0530
> @@ -500,8 +500,8 @@ h8300_frame_init_saved_regs (struct fram
>  	  CORE_ADDR limit = (sal.end && sal.end < get_frame_pc (fi))
>  	    ? sal.end : get_frame_pc (fi);
>  	  /* This will fill in fields in fi. */
> -
> -
> +	  if(!get_frame_base (fi))//check whether frame is null.
> +	  	return null_frame_id;//if null return
>  
>  	  h8300_examine_prologue (func_addr, limit, get_frame_base (fi),
>  				  deprecated_get_frame_saved_regs (fi), fi);



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

end of thread, other threads:[~2004-07-15 18:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-18 10:35 [Patch H8/300] : Fix for crashing of gdb with" info f" command Sherry Samuel
2004-06-22 20:09 ` Andrew Cagney
2004-07-09 12:12 Sherry Samuel
2004-07-15 18:18 ` Andrew Cagney

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