Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* ChangeLog entry, re: gdb-5.2 and SCO OpenServer 5.0.5
@ 2002-08-16 14:50 William Bader
  2002-08-16 15:08 ` Kevin Buettner
  0 siblings, 1 reply; 5+ messages in thread
From: William Bader @ 2002-08-16 14:50 UTC (permalink / raw)
  To: ac131313, gdb-patches, william

> Just use alloca(), its use is accepted in cases like the above.  Would 
> you have a changeLog entry?
> Andrew

How is this:

2002-08-16  William Bader  <william@nscs.fast.net>

	* gdb/i386-tdep.c: Dymanically allocate buf;
	TARGET_PTR_BIT is not a constant.

--- gdb-5.2/gdb/i386-tdep.c-	Tue Feb 19 13:42:27 2002
+++ gdb-5.2/gdb/i386-tdep.c	Fri Aug 16 17:37:19 2002
@@ -858,7 +858,12 @@
 int
 get_longjmp_target (CORE_ADDR *pc)
 {
+#if GDB_MULTI_ARCH
+  /* TARGET_PTR_BIT evaluates to a function call */
+  char *buf = alloca(TARGET_PTR_BIT / TARGET_CHAR_BIT);
+#else
   char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
+#endif
   CORE_ADDR sp, jb_addr;
 
   sp = read_register (SP_REGNUM);



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

* Re: ChangeLog entry, re: gdb-5.2 and SCO OpenServer 5.0.5
  2002-08-16 14:50 ChangeLog entry, re: gdb-5.2 and SCO OpenServer 5.0.5 William Bader
@ 2002-08-16 15:08 ` Kevin Buettner
  2002-08-16 15:19   ` william
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Buettner @ 2002-08-16 15:08 UTC (permalink / raw)
  To: William Bader, ac131313, gdb-patches

On Aug 16,  5:49pm, William Bader wrote:

> +#if GDB_MULTI_ARCH
> +  /* TARGET_PTR_BIT evaluates to a function call */
> +  char *buf = alloca(TARGET_PTR_BIT / TARGET_CHAR_BIT);

I think that all you need is this line (but put a space between ``alloca''
and the left paren).

> +#else
>    char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
> +#endif

I.e, you can get rid of the preprocessor statements and the old
declaration.

Kevin


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

* Re: ChangeLog entry, re: gdb-5.2 and SCO OpenServer 5.0.5
  2002-08-16 15:08 ` Kevin Buettner
@ 2002-08-16 15:19   ` william
  2002-08-16 15:50     ` Kevin Buettner
  2002-08-16 17:08     ` Kevin Buettner
  0 siblings, 2 replies; 5+ messages in thread
From: william @ 2002-08-16 15:19 UTC (permalink / raw)
  To: kevinb; +Cc: ac131313, gdb-patches


How is this:

2002-08-16  William Bader  <william@nscs.fast.net>

	* gdb/i386-tdep.c: Dynamically allocate buf;
	TARGET_PTR_BIT is not a constant.

--- gdb-5.2/gdb/i386-tdep.c-	Tue Feb 19 13:42:27 2002
+++ gdb-5.2/gdb/i386-tdep.c	Fri Aug 16 18:13:00 2002
@@ -858,7 +858,7 @@
 int
 get_longjmp_target (CORE_ADDR *pc)
 {
-  char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
+  char *buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
   CORE_ADDR sp, jb_addr;
 
   sp = read_register (SP_REGNUM);


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

* Re: ChangeLog entry, re: gdb-5.2 and SCO OpenServer 5.0.5
  2002-08-16 15:19   ` william
@ 2002-08-16 15:50     ` Kevin Buettner
  2002-08-16 17:08     ` Kevin Buettner
  1 sibling, 0 replies; 5+ messages in thread
From: Kevin Buettner @ 2002-08-16 15:50 UTC (permalink / raw)
  To: william, kevinb; +Cc: ac131313, gdb-patches

On Aug 16,  6:18pm, william@nscs.fast.net wrote:

> How is this:
> 
> 2002-08-16  William Bader  <william@nscs.fast.net>
> 
> 	* gdb/i386-tdep.c: Dynamically allocate buf;
> 	TARGET_PTR_BIT is not a constant.
> 
> --- gdb-5.2/gdb/i386-tdep.c-	Tue Feb 19 13:42:27 2002
> +++ gdb-5.2/gdb/i386-tdep.c	Fri Aug 16 18:13:00 2002
> @@ -858,7 +858,7 @@
>  int
>  get_longjmp_target (CORE_ADDR *pc)
>  {
> -  char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
> +  char *buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
>    CORE_ADDR sp, jb_addr;
>  
>    sp = read_register (SP_REGNUM);

The patch looks good.  If it were me doing the ChangeLog entry,
I'd probably do it something like this:

	* i386-tdep.c (get_longjmp_target): Dynamically allocate ``buf''
	since TARGET_PTR_BIT is not a constant.

Or perhaps just:

	* i386-tdep.c (get_longjmp_target): Dynamically allocate ``buf''.

I just took a look at the current development sources and it looks to
me like this patch won't apply cleanly.  FWIW, the current development
sources don't use TARGET_PTR_BIT anymore (in the ``buf'' declaration)
so we're probably okay.

Kevin


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

* Re: ChangeLog entry, re: gdb-5.2 and SCO OpenServer 5.0.5
  2002-08-16 15:19   ` william
  2002-08-16 15:50     ` Kevin Buettner
@ 2002-08-16 17:08     ` Kevin Buettner
  1 sibling, 0 replies; 5+ messages in thread
From: Kevin Buettner @ 2002-08-16 17:08 UTC (permalink / raw)
  To: william, kevinb; +Cc: ac131313, gdb-patches

I've just committed the change below to the 5.2 branch (just in case
it becomes necessary to release a 5.2.2 version of GDB).

Thanks, William!

Kevin

2002-08-16  William Bader  <william@nscs.fast.net>

	* i386-tdep.c (get_longjmp_target): Dynamically allocate ``buf''.

Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.52
diff -u -p -r1.52 i386-tdep.c
--- i386-tdep.c	19 Feb 2002 18:42:27 -0000	1.52
+++ i386-tdep.c	16 Aug 2002 23:53:07 -0000
@@ -858,7 +858,7 @@ i386_pop_frame (void)
 int
 get_longjmp_target (CORE_ADDR *pc)
 {
-  char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
+  char *buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
   CORE_ADDR sp, jb_addr;
 
   sp = read_register (SP_REGNUM);


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

end of thread, other threads:[~2002-08-17  0:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-16 14:50 ChangeLog entry, re: gdb-5.2 and SCO OpenServer 5.0.5 William Bader
2002-08-16 15:08 ` Kevin Buettner
2002-08-16 15:19   ` william
2002-08-16 15:50     ` Kevin Buettner
2002-08-16 17:08     ` Kevin Buettner

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