Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patchv3 1/5] Mostly code cleanup: Constification
Date: Mon, 16 Sep 2013 22:22:00 -0000	[thread overview]
Message-ID: <21047.33940.998451.19883@ruffy.mtv.corp.google.com> (raw)
In-Reply-To: <20130915193742.GA20411@host2.jankratochvil.net>

Jan Kratochvil writes:
 > Hi,
 > 
 > this is mostly a code cleanup, just the main.c part is not exactly the same.
 > 
 > 
 > Jan
 > 
 > 
 > gdb/
 > 2013-09-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
 > 
 > 	Constification.
 > 	* main.c (captured_main): Wrap symbol_file_add_main calls with
 > 	TRY_CATCH.  Twice.
 > 	* symfile.c (symbol_file_add_main_1): Make args parameter const.
 > 	(symbol_file_add): Make name parameter const.
 > 	(symbol_file_add_main, symbol_file_add_main_1): Make args parameter const.
 > 	(symfile_bfd_open): Make name parameter const, rename it to cname.  Add
 > 	variable name.  Change their usage accordingly.
 > 	* symfile.h (symbol_file_add, symfile_bfd_open): Make first parameter
 > 	const.
 > 	(symbol_file_add_main): Make args parameter const.
 > 
 > --- a/gdb/main.c
 > +++ b/gdb/main.c
 > @@ -950,8 +950,15 @@ captured_main (void *data)
 >           catch_command_errors returns non-zero on success!  */
 >        if (catch_command_errors (exec_file_attach, execarg,
 >  				!batch_flag, RETURN_MASK_ALL))
 > -	catch_command_errors (symbol_file_add_main, symarg,
 > -			      !batch_flag, RETURN_MASK_ALL);
 > +	{
 > +	  volatile struct gdb_exception e;
 > +
 > +	  TRY_CATCH (e, RETURN_MASK_ALL)
 > +	    {
 > +	      symbol_file_add_main (symarg, !batch_flag);
 > +	    }
 > +	  exception_print (gdb_stderr, e);
 > +	}
 >      }
 >    else
 >      {
 > @@ -959,8 +966,15 @@ captured_main (void *data)
 >  	catch_command_errors (exec_file_attach, execarg,
 >  			      !batch_flag, RETURN_MASK_ALL);
 >        if (symarg != NULL)
 > -	catch_command_errors (symbol_file_add_main, symarg,
 > -			      !batch_flag, RETURN_MASK_ALL);
 > +	{
 > +	  volatile struct gdb_exception e;
 > +
 > +	  TRY_CATCH (e, RETURN_MASK_ALL)
 > +	    {
 > +	      symbol_file_add_main (symarg, !batch_flag);
 > +	    }
 > +	  exception_print (gdb_stderr, e);
 > +	}
 >      }
 >  
 >    if (corearg && pidarg)

There is catch_command_errors_const.
Would that work here?


  reply	other threads:[~2013-09-16 22:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-15 19:37 Jan Kratochvil
2013-09-16 22:22 ` Doug Evans [this message]
2013-09-17  6:48   ` Jan Kratochvil
2013-09-17 18:39     ` Tom Tromey
2013-09-17 19:24       ` Doug Evans
2013-09-17 19:32         ` Tom Tromey
2013-09-17 19:37           ` Jan Kratochvil
2013-09-17 19:50             ` Doug Evans
2013-09-18 13:45           ` Joel Brobecker
2013-09-18 14:08   ` Jan Kratochvil
2013-09-18 17:10     ` Doug Evans
2013-09-19 12:45       ` [commit] " Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=21047.33940.998451.19883@ruffy.mtv.corp.google.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox