public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug mi/10765] Missing prompt and error result record for invalid thread option
       [not found] <bug-10765-4717@http.sourceware.org/bugzilla/>
@ 2011-01-10 21:18 ` tromey at redhat dot com
  0 siblings, 0 replies; 4+ messages in thread
From: tromey at redhat dot com @ 2011-01-10 21:18 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=10765

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |tromey at redhat dot com
         Resolution|                            |FIXED
   Target Milestone|7.1                         |7.3

--- Comment #3 from Tom Tromey <tromey at redhat dot com> 2011-01-10 21:17:37 UTC ---
This was fixed by:

2010-12-09  Tom Tromey  <tromey@redhat.com>

    * mi/mi-parse.h (mi_parse): Update.
    * mi/mi-parse.c (mi_parse_cleanup): New function.
    (mi_parse): Add 'token' argument.  Throw exception on error.
    * mi/mi-main.c (mi_print_exception): New function.
    (mi_execute_command): Use mi_print_exception.  Catch exceptions
    from mi_parse.

The reason the exception was not working was that
the call to mi_parse was not surrounded by a TRY_CATCH.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug mi/10765] Missing prompt and error result record for invalid thread option
  2009-10-13 11:06 [Bug mi/10765] New: " timo dot suoranta at acrodea dot co dot jp
  2009-10-14  0:29 ` [Bug mi/10765] " nickrob at snap dot net dot nz
  2009-10-14  0:42 ` nickrob at snap dot net dot nz
@ 2009-10-22  6:47 ` vladimir at codesourcery dot com
  2 siblings, 0 replies; 4+ messages in thread
From: vladimir at codesourcery dot com @ 2009-10-22  6:47 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From vladimir at codesourcery dot com  2009-10-22 06:47 -------
I wonder why is exception thrown from MI code not reported as ^error in the 
first place. I guess it's better to fix *that*, first.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10765

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug mi/10765] Missing prompt and error result record for invalid thread option
  2009-10-13 11:06 [Bug mi/10765] New: " timo dot suoranta at acrodea dot co dot jp
  2009-10-14  0:29 ` [Bug mi/10765] " nickrob at snap dot net dot nz
@ 2009-10-14  0:42 ` nickrob at snap dot net dot nz
  2009-10-22  6:47 ` vladimir at codesourcery dot com
  2 siblings, 0 replies; 4+ messages in thread
From: nickrob at snap dot net dot nz @ 2009-10-14  0:42 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1


http://sourceware.org/bugzilla/show_bug.cgi?id=10765

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug mi/10765] Missing prompt and error result record for invalid thread option
  2009-10-13 11:06 [Bug mi/10765] New: " timo dot suoranta at acrodea dot co dot jp
@ 2009-10-14  0:29 ` nickrob at snap dot net dot nz
  2009-10-14  0:42 ` nickrob at snap dot net dot nz
  2009-10-22  6:47 ` vladimir at codesourcery dot com
  2 siblings, 0 replies; 4+ messages in thread
From: nickrob at snap dot net dot nz @ 2009-10-14  0:29 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From nickrob at snap dot net dot nz  2009-10-14 00:29 -------
Subject:  New: Missing prompt and error result record for invalid thread option

timo dot suoranta at acrodea dot co dot jp writes:
 > The following incorrectly spelled command does not return gdb prompt nor error
 > result record when using mi:
 > 
 > -var-create --thread 1--frame 0 - * red_vec4
 > &"Invalid value for the '--thread' option\n"

Yes.  I think this patch fixes it and other similar problems.

-- 
Nick                                           http://users.snap.net.nz/~nickrob



2009-10-14  Nick Roberts  <nickrob@snap.net.nz>

	* mi/mi-parse.c (error_message): New function.
	(mi_parse): Report errors using MI syntax.


*** mi-parse.c	03 Jan 2009 18:57:57 +1300	1.17
--- mi-parse.c	14 Oct 2009 13:24:48 +1300	
*************** mi_parse_free (struct mi_parse *parse)
*** 144,149 ****
--- 144,157 ----
    xfree (parse);
  }
  
+ static void
+ error_message (struct mi_parse *parse, const char *msg)
+ {
+   fprintf_unfiltered (raw_stdout, "%s^error,msg=\"%s\"\n",
+ 		      parse->token, msg);
+   mi_parse_free (parse);
+ 
+ }
  
  struct mi_parse *
  mi_parse (char *cmd)
*************** mi_parse (char *cmd)
*** 215,228 ****
        if (strncmp (chp, "--thread ", ts) == 0)
  	{
  	  if (parse->thread != -1)
! 	    error ("Duplicate '--thread' option");
  	  chp += ts;
  	  parse->thread = strtol (chp, &chp, 10);
  	}
        else if (strncmp (chp, "--frame ", fs) == 0)
  	{
  	  if (parse->frame != -1)
! 	    error ("Duplicate '--frame' option");
  	  chp += fs;
  	  parse->frame = strtol (chp, &chp, 10);
  	}
--- 223,242 ----
        if (strncmp (chp, "--thread ", ts) == 0)
  	{
  	  if (parse->thread != -1)
! 	    {
! 	      error_message (parse, "Duplicate '--thread' option");
! 	      return NULL;
! 	    }
  	  chp += ts;
  	  parse->thread = strtol (chp, &chp, 10);
  	}
        else if (strncmp (chp, "--frame ", fs) == 0)
  	{
  	  if (parse->frame != -1)
! 	    {
! 	      error_message (parse, "Duplicate '--frame' option");
! 	      return NULL;
! 	    }
  	  chp += fs;
  	  parse->frame = strtol (chp, &chp, 10);
  	}
*************** mi_parse (char *cmd)
*** 230,237 ****
  	break;
  
        if (*chp != '\0' && !isspace (*chp))
! 	error ("Invalid value for the '%s' option",
! 	       start[2] == 't' ? "--thread" : "--frame");
        while (isspace (*chp))
  	chp++;
      }
--- 244,258 ----
  	break;
  
        if (*chp != '\0' && !isspace (*chp))
! 	{
! 	  /* FIXME: This should be a function call. */
! 	  fprintf_unfiltered
! 	    (raw_stdout,
! 	     "%s^error,msg=\"Invalid value for the '%s' option\"\n",
! 	     parse->token, start[2] == 't' ? "--thread" : "--frame");
! 	  mi_parse_free (parse);
! 	  return NULL;
! 	}
        while (isspace (*chp))
  	chp++;
      }


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10765

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2011-01-10 21:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-10765-4717@http.sourceware.org/bugzilla/>
2011-01-10 21:18 ` [Bug mi/10765] Missing prompt and error result record for invalid thread option tromey at redhat dot com
2009-10-13 11:06 [Bug mi/10765] New: " timo dot suoranta at acrodea dot co dot jp
2009-10-14  0:29 ` [Bug mi/10765] " nickrob at snap dot net dot nz
2009-10-14  0:42 ` nickrob at snap dot net dot nz
2009-10-22  6:47 ` vladimir at codesourcery dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).