Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Fix a small memory leak in bpstat_stop_status
@ 2002-12-12  2:48 Joel Brobecker
  2003-01-13  3:22 ` Joel Brobecker
  2003-03-10 19:04 ` [RFA/PING] " Joel Brobecker
  0 siblings, 2 replies; 6+ messages in thread
From: Joel Brobecker @ 2002-12-12  2:48 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

This is a followup on a thread that I started, archived at:
http://sources.redhat.com/ml/gdb-patches/2002-12/msg00358.html

Basically, I extracted the part that fixed a small memory leak, and
tested it separately, as the other part of the patch is likely to be
superseeded by another patch submitted by Klee Dienes.

2002-12-12  Joel Brobecker  <brobecker@gnat.com>

        * breakpoint.c (bpstat_stop_status): Fix a small memory leak.

No regressions on x86-linux.

Ok to apply?
-- 
Joel

[-- Attachment #2: leak.diff --]
[-- Type: text/plain, Size: 1365 bytes --]

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.100
diff -c -3 -p -r1.100 breakpoint.c
*** breakpoint.c	4 Dec 2002 04:53:13 -0000	1.100
--- breakpoint.c	12 Dec 2002 10:21:53 -0000
*************** bpstat_stop_status (CORE_ADDR *pc, int n
*** 2763,2771 ****
  	    /* We will stop here */
  	    if (b->disposition == disp_disable)
  	      b->enable_state = bp_disabled;
- 	    bs->commands = copy_command_lines (b->commands);
  	    if (b->silent)
  	      bs->print = 0;
  	    if (bs->commands &&
  		(STREQ ("silent", bs->commands->line) ||
  		 (xdb_commands && STREQ ("Q", bs->commands->line))))
--- 2767,2775 ----
  	    /* We will stop here */
  	    if (b->disposition == disp_disable)
  	      b->enable_state = bp_disabled;
  	    if (b->silent)
  	      bs->print = 0;
+ 	    bs->commands = b->commands;
  	    if (bs->commands &&
  		(STREQ ("silent", bs->commands->line) ||
  		 (xdb_commands && STREQ ("Q", bs->commands->line))))
*************** bpstat_stop_status (CORE_ADDR *pc, int n
*** 2773,2778 ****
--- 2777,2783 ----
  		bs->commands = bs->commands->next;
  		bs->print = 0;
  	      }
+ 	    bs->commands = copy_command_lines (bs->commands);
  	  }
        }
      /* Print nothing for this entry if we dont stop or if we dont print.  */

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

* Re: [RFA] Fix a small memory leak in bpstat_stop_status
  2002-12-12  2:48 [RFA] Fix a small memory leak in bpstat_stop_status Joel Brobecker
@ 2003-01-13  3:22 ` Joel Brobecker
  2003-03-10 19:04 ` [RFA/PING] " Joel Brobecker
  1 sibling, 0 replies; 6+ messages in thread
From: Joel Brobecker @ 2003-01-13  3:22 UTC (permalink / raw)
  To: gdb-patches

Hello,

Can somebody review this patch, please?

Thank you,
-- 
Joel

On Thu, Dec 12, 2002 at 11:40:58AM +0100, Joel Brobecker wrote:
> This is a followup on a thread that I started, archived at:
> http://sources.redhat.com/ml/gdb-patches/2002-12/msg00358.html
> 
> Basically, I extracted the part that fixed a small memory leak, and
> tested it separately, as the other part of the patch is likely to be
> superseeded by another patch submitted by Klee Dienes.
> 
> 2002-12-12  Joel Brobecker  <brobecker@gnat.com>
> 
>         * breakpoint.c (bpstat_stop_status): Fix a small memory leak.
> 
> No regressions on x86-linux.
> 
> Ok to apply?
> -- 
> Joel

> Index: breakpoint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/breakpoint.c,v
> retrieving revision 1.100
> diff -c -3 -p -r1.100 breakpoint.c
> *** breakpoint.c	4 Dec 2002 04:53:13 -0000	1.100
> --- breakpoint.c	12 Dec 2002 10:21:53 -0000
> *************** bpstat_stop_status (CORE_ADDR *pc, int n
> *** 2763,2771 ****
>   	    /* We will stop here */
>   	    if (b->disposition == disp_disable)
>   	      b->enable_state = bp_disabled;
> - 	    bs->commands = copy_command_lines (b->commands);
>   	    if (b->silent)
>   	      bs->print = 0;
>   	    if (bs->commands &&
>   		(STREQ ("silent", bs->commands->line) ||
>   		 (xdb_commands && STREQ ("Q", bs->commands->line))))
> --- 2767,2775 ----
>   	    /* We will stop here */
>   	    if (b->disposition == disp_disable)
>   	      b->enable_state = bp_disabled;
>   	    if (b->silent)
>   	      bs->print = 0;
> + 	    bs->commands = b->commands;
>   	    if (bs->commands &&
>   		(STREQ ("silent", bs->commands->line) ||
>   		 (xdb_commands && STREQ ("Q", bs->commands->line))))
> *************** bpstat_stop_status (CORE_ADDR *pc, int n
> *** 2773,2778 ****
> --- 2777,2783 ----
>   		bs->commands = bs->commands->next;
>   		bs->print = 0;
>   	      }
> + 	    bs->commands = copy_command_lines (bs->commands);
>   	  }
>         }
>       /* Print nothing for this entry if we dont stop or if we dont print.  */


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

* Re: [RFA/PING] Fix a small memory leak in bpstat_stop_status
  2002-12-12  2:48 [RFA] Fix a small memory leak in bpstat_stop_status Joel Brobecker
  2003-01-13  3:22 ` Joel Brobecker
@ 2003-03-10 19:04 ` Joel Brobecker
  2003-03-10 22:42   ` Jason Molenda
  2003-03-10 23:10   ` Andrew Cagney
  1 sibling, 2 replies; 6+ messages in thread
From: Joel Brobecker @ 2003-03-10 19:04 UTC (permalink / raw)
  To: gdb-patches

Hello,

Can somebody have a look at this patch please (2nd ping)? Granted, it is
not a very important patch, it "only" fixes a small memory leak, but
I believe the change is very localized, so easy to review.

Thanks!

On Thu, Dec 12, 2002 at 11:40:58AM +0100, Joel Brobecker wrote:
> This is a followup on a thread that I started, archived at:
> http://sources.redhat.com/ml/gdb-patches/2002-12/msg00358.html
> 
> Basically, I extracted the part that fixed a small memory leak, and
> tested it separately, as the other part of the patch is likely to be
> superseeded by another patch submitted by Klee Dienes.
> 
> 2002-12-12  Joel Brobecker  <brobecker@gnat.com>
> 
>         * breakpoint.c (bpstat_stop_status): Fix a small memory leak.
> 
> No regressions on x86-linux.
> 
> Ok to apply?
> -- 
> Joel

> Index: breakpoint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/breakpoint.c,v
> retrieving revision 1.100
> diff -c -3 -p -r1.100 breakpoint.c
> *** breakpoint.c	4 Dec 2002 04:53:13 -0000	1.100
> --- breakpoint.c	12 Dec 2002 10:21:53 -0000
> *************** bpstat_stop_status (CORE_ADDR *pc, int n
> *** 2763,2771 ****
>   	    /* We will stop here */
>   	    if (b->disposition == disp_disable)
>   	      b->enable_state = bp_disabled;
> - 	    bs->commands = copy_command_lines (b->commands);
>   	    if (b->silent)
>   	      bs->print = 0;
>   	    if (bs->commands &&
>   		(STREQ ("silent", bs->commands->line) ||
>   		 (xdb_commands && STREQ ("Q", bs->commands->line))))
> --- 2767,2775 ----
>   	    /* We will stop here */
>   	    if (b->disposition == disp_disable)
>   	      b->enable_state = bp_disabled;
>   	    if (b->silent)
>   	      bs->print = 0;
> + 	    bs->commands = b->commands;
>   	    if (bs->commands &&
>   		(STREQ ("silent", bs->commands->line) ||
>   		 (xdb_commands && STREQ ("Q", bs->commands->line))))
> *************** bpstat_stop_status (CORE_ADDR *pc, int n
> *** 2773,2778 ****
> --- 2777,2783 ----
>   		bs->commands = bs->commands->next;
>   		bs->print = 0;
>   	      }
> + 	    bs->commands = copy_command_lines (bs->commands);
>   	  }
>         }
>       /* Print nothing for this entry if we dont stop or if we dont print.  */


-- 
Joel


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

* Re: [RFA/PING] Fix a small memory leak in bpstat_stop_status
  2003-03-10 19:04 ` [RFA/PING] " Joel Brobecker
@ 2003-03-10 22:42   ` Jason Molenda
  2003-03-10 23:10   ` Andrew Cagney
  1 sibling, 0 replies; 6+ messages in thread
From: Jason Molenda @ 2003-03-10 22:42 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

My agreement doesn't help you at all :-), but this patch looks correct 
to me--we will leak a copy of the "silent" command in 
bpstat_stop_status() without this patch.

Jason


On Monday, March 10, 2003, at 11:03  AM, Joel Brobecker wrote:

> Hello,
>
> Can somebody have a look at this patch please (2nd ping)? Granted, it 
> is
> not a very important patch, it "only" fixes a small memory leak, but
> I believe the change is very localized, so easy to review.
>
> Thanks!
>
> On Thu, Dec 12, 2002 at 11:40:58AM +0100, Joel Brobecker wrote:
>> This is a followup on a thread that I started, archived at:
>> http://sources.redhat.com/ml/gdb-patches/2002-12/msg00358.html
>>
>> Basically, I extracted the part that fixed a small memory leak, and
>> tested it separately, as the other part of the patch is likely to be
>> superseeded by another patch submitted by Klee Dienes.
>>
>> 2002-12-12  Joel Brobecker  <brobecker@gnat.com>
>>
>>         * breakpoint.c (bpstat_stop_status): Fix a small memory leak.
>>
>> No regressions on x86-linux.
>>
>> Ok to apply?
>> -- 
>> Joel
>
>> Index: breakpoint.c
>> ===================================================================
>> RCS file: /cvs/src/src/gdb/breakpoint.c,v
>> retrieving revision 1.100
>> diff -c -3 -p -r1.100 breakpoint.c
>> *** breakpoint.c	4 Dec 2002 04:53:13 -0000	1.100
>> --- breakpoint.c	12 Dec 2002 10:21:53 -0000
>> *************** bpstat_stop_status (CORE_ADDR *pc, int n
>> *** 2763,2771 ****
>>   	    /* We will stop here */
>>   	    if (b->disposition == disp_disable)
>>   	      b->enable_state = bp_disabled;
>> - 	    bs->commands = copy_command_lines (b->commands);
>>   	    if (b->silent)
>>   	      bs->print = 0;
>>   	    if (bs->commands &&
>>   		(STREQ ("silent", bs->commands->line) ||
>>   		 (xdb_commands && STREQ ("Q", bs->commands->line))))
>> --- 2767,2775 ----
>>   	    /* We will stop here */
>>   	    if (b->disposition == disp_disable)
>>   	      b->enable_state = bp_disabled;
>>   	    if (b->silent)
>>   	      bs->print = 0;
>> + 	    bs->commands = b->commands;
>>   	    if (bs->commands &&
>>   		(STREQ ("silent", bs->commands->line) ||
>>   		 (xdb_commands && STREQ ("Q", bs->commands->line))))
>> *************** bpstat_stop_status (CORE_ADDR *pc, int n
>> *** 2773,2778 ****
>> --- 2777,2783 ----
>>   		bs->commands = bs->commands->next;
>>   		bs->print = 0;
>>   	      }
>> + 	    bs->commands = copy_command_lines (bs->commands);
>>   	  }
>>         }
>>       /* Print nothing for this entry if we dont stop or if we dont 
>> print.  */
>
>
> -- 
> Joel
>


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

* Re: [RFA/PING] Fix a small memory leak in bpstat_stop_status
  2003-03-10 19:04 ` [RFA/PING] " Joel Brobecker
  2003-03-10 22:42   ` Jason Molenda
@ 2003-03-10 23:10   ` Andrew Cagney
  2003-03-11 19:07     ` Joel Brobecker
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Cagney @ 2003-03-10 23:10 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

There isn't a breakpoint maintainer so ... Approved.
Andrew


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

* Re: [RFA/PING] Fix a small memory leak in bpstat_stop_status
  2003-03-10 23:10   ` Andrew Cagney
@ 2003-03-11 19:07     ` Joel Brobecker
  0 siblings, 0 replies; 6+ messages in thread
From: Joel Brobecker @ 2003-03-11 19:07 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

> > 2002-12-12  Joel Brobecker  <brobecker@gnat.com>
> > 
> >         * breakpoint.c (bpstat_stop_status): Fix a small memory leak.
> > 
> There isn't a breakpoint maintainer so ... Approved.

Thank you, checked in.

-- 
Joel


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

end of thread, other threads:[~2003-03-11 19:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-12  2:48 [RFA] Fix a small memory leak in bpstat_stop_status Joel Brobecker
2003-01-13  3:22 ` Joel Brobecker
2003-03-10 19:04 ` [RFA/PING] " Joel Brobecker
2003-03-10 22:42   ` Jason Molenda
2003-03-10 23:10   ` Andrew Cagney
2003-03-11 19:07     ` Joel Brobecker

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