Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA]: add reason code and silent flag to decode_line_1
@ 2003-12-08 22:06 J. Johnston
  2003-12-08 22:33 ` David Carlton
  0 siblings, 1 reply; 15+ messages in thread
From: J. Johnston @ 2003-12-08 22:06 UTC (permalink / raw)
  To: gdb-patches

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

This is part of my pending breakpoint changes.  Daniel asked to break it up into 
a few pieces; this being one of them.

I have added two new paramters to decode_line_1.  One is a reason_code field and 
the other is a silent_flag.  The reason code is a pointer to an int to store a 
reason code should the function cause an error.  At present, the reason_code is 
only set if the file or function is not found.  I would have called it 
not_found_ptr instead of reason_code_ptr but I felt this could be enhanced in 
the future to include other forms of error that could be of interest to the 
caller.  The reason code works like errno whereby the caller is expected to 
clear the field before calling and check it afterwards.  The silent_if_not_found 
flag tells the function not to issue an error message if the function is to fail 
because the function/source file is not found.

Ok to commit?

-- Jeff J.

2003-12-08  Jeff Johnston  <jjohnstn@redhat.com>

	* linespec.h (decode_line_1): Add new reason_code_ptr and
	silent_if_not_found parameters.  Add new DL1_NOT_FOUND reason
	code macro.
	* linespec.c (decode_line_1): Add new parameters.  Pass on
	new parameters to decode_variable and symtab_from_filename
	functions.
	(decode_variable): Add new reason_code_ptr and silent_if_not_found
	parameters.  Set reason code if failing because function not
	found.  Throw exception rather than calling error() if silent
	flag is set and function is not found.
	(symtab_from_filename): Add new reason_code_ptr and silent_if_not_found
	parameters.  Set reason code if failing because source file not
	found.  Throw exception rather than using error call if
	silent flag is set and source file is not found.
	* breakpoint.c: Change all callers of decode_line_1 to add default
	extra parameters for decode_line_1 calls.
	* tracepoint.c: Ditto.
	* cli/cli-cmds.c: Ditto.

[-- Attachment #2: linespec.patch --]
[-- Type: text/plain, Size: 12263 bytes --]

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.145
diff -u -p -r1.145 breakpoint.c
--- breakpoint.c	17 Nov 2003 00:55:49 -0000	1.145
+++ breakpoint.c	8 Dec 2003 22:03:57 -0000
@@ -4323,7 +4323,7 @@ solib_load_unload_1 (char *hookname, int
   int thread = -1;		/* All threads. */
 
   /* Set a breakpoint on the specified hook. */
-  sals = decode_line_1 (&hookname, 1, (struct symtab *) NULL, 0, &canonical);
+  sals = decode_line_1 (&hookname, 1, (struct symtab *) NULL, 0, &canonical, NULL, 0);
   addr_end = hookname;
 
   if (sals.nelts == 0)
@@ -4841,9 +4841,9 @@ parse_breakpoint_sals (char **address,
  	      || ((strchr ("+-", (*address)[0]) != NULL)
  		  && ((*address)[1] != '['))))
 	*sals = decode_line_1 (address, 1, default_breakpoint_symtab,
-			       default_breakpoint_line, addr_string);
+			       default_breakpoint_line, addr_string, NULL, 0);
       else
-	*sals = decode_line_1 (address, 1, (struct symtab *) NULL, 0, addr_string);
+	*sals = decode_line_1 (address, 1, (struct symtab *) NULL, 0, addr_string, NULL, 0);
     }
   /* For any SAL that didn't have a canonical string, fill one in. */
   if (sals->nelts > 0 && *addr_string == NULL)
@@ -5289,7 +5289,7 @@ break_at_finish_command_1 (char *arg, in
 
   beg_addr_string = addr_string;
   sals = decode_line_1 (&addr_string, 1, (struct symtab *) NULL, 0,
-			(char ***) NULL);
+			(char ***) NULL, NULL, 0);
 
   xfree (beg_addr_string);
   old_chain = make_cleanup (xfree, sals.sals);
@@ -5806,10 +5806,10 @@ until_break_command (char *arg, int from
 
   if (default_breakpoint_valid)
     sals = decode_line_1 (&arg, 1, default_breakpoint_symtab,
-			  default_breakpoint_line, (char ***) NULL);
+			  default_breakpoint_line, (char ***) NULL, NULL, 0);
   else
     sals = decode_line_1 (&arg, 1, (struct symtab *) NULL, 
-			  0, (char ***) NULL);
+			  0, (char ***) NULL, NULL, 0);
 
   if (sals.nelts != 1)
     error ("Couldn't get information on specified line.");
@@ -6269,7 +6269,7 @@ handle_gnu_v3_exceptions (int tempflag, 
     trigger_func_name = xstrdup ("__cxa_throw");
 
   nameptr = trigger_func_name;
-  sals = decode_line_1 (&nameptr, 1, NULL, 0, NULL);
+  sals = decode_line_1 (&nameptr, 1, NULL, 0, NULL, NULL, 0);
   if (sals.nelts == 0)
     {
       xfree (trigger_func_name);
@@ -6976,7 +6976,7 @@ breakpoint_re_set_one (void *bint)
       set_language (b->language);
       input_radix = b->input_radix;
       s = b->addr_string;
-      sals = decode_line_1 (&s, 1, (struct symtab *) NULL, 0, (char ***) NULL);
+      sals = decode_line_1 (&s, 1, (struct symtab *) NULL, 0, (char ***) NULL, NULL, 0);
       for (i = 0; i < sals.nelts; i++)
 	{
 	  resolve_sal_pc (&sals.sals[i]);
@@ -7512,10 +7512,10 @@ decode_line_spec_1 (char *string, int fu
     sals = decode_line_1 (&string, funfirstline,
 			  default_breakpoint_symtab,
 			  default_breakpoint_line,
-			  (char ***) NULL);
+			  (char ***) NULL, NULL, 0);
   else
     sals = decode_line_1 (&string, funfirstline,
-			  (struct symtab *) NULL, 0, (char ***) NULL);
+			  (struct symtab *) NULL, 0, (char ***) NULL, NULL, 0);
   if (*string)
     error ("Junk at end of line specification: %s", string);
   return sals;
Index: linespec.c
===================================================================
RCS file: /cvs/src/src/gdb/linespec.c,v
retrieving revision 1.52
diff -u -p -r1.52 linespec.c
--- linespec.c	20 Oct 2003 14:38:42 -0000	1.52
+++ linespec.c	8 Dec 2003 22:03:58 -0000
@@ -100,7 +100,9 @@ static struct symtabs_and_lines decode_l
 					       int, int, char ***);
 
 static struct symtab *symtab_from_filename (char **argptr,
-					    char *p, int is_quote_enclosed);
+					    char *p, int is_quote_enclosed,
+					    int *reason_code_ptr,
+					    int silent_if_not_found);
 
 static struct
 symtabs_and_lines decode_all_digits (char **argptr,
@@ -119,7 +121,9 @@ static struct symtabs_and_lines decode_d
 static struct symtabs_and_lines decode_variable (char *copy,
 						 int funfirstline,
 						 char ***canonical,
-						 struct symtab *file_symtab);
+						 struct symtab *file_symtab,
+						 int *reason_code_ptr,
+						 int silent_if_not_found);
 
 static struct
 symtabs_and_lines symbol_found (int funfirstline,
@@ -637,7 +641,16 @@ decode_line_2 (struct symbol *sym_arr[],
 
    Note that it is possible to return zero for the symtab
    if no file is validly specified.  Callers must check that.
-   Also, the line number returned may be invalid.  */
+   Also, the line number returned may be invalid.  
+ 
+   The SILENT_IF_NOT_FOUND flag specifies that no error message is issued for
+   an unknown function or file.  This is used when searching for locations in
+   shared libraries that may not be loaded yet.  
+
+   REASON_CODE_PTR, if not null, is used to set a reason code value if failure
+   occurs due to an unknown function or file.  It is needed by the caller
+   of decode_line_1 to determine that an error has occurred when
+   SILENT_IF_NOT_FOUND is in effect.  */
 
 /* We allow single quotes in various places.  This is a hideous
    kludge, which exists because the completer can't yet deal with the
@@ -646,7 +659,8 @@ decode_line_2 (struct symbol *sym_arr[],
 
 struct symtabs_and_lines
 decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
-	       int default_line, char ***canonical)
+	       int default_line, char ***canonical, int *reason_code_ptr,
+	       int silent_if_not_found)
 {
   char *p;
   char *q;
@@ -722,7 +736,8 @@ decode_line_1 (char **argptr, int funfir
       /* No, the first part is a filename; set s to be that file's
 	 symtab.  Also, move argptr past the filename.  */
 
-      file_symtab = symtab_from_filename (argptr, p, is_quote_enclosed);
+      file_symtab = symtab_from_filename (argptr, p, is_quote_enclosed, 
+		      			  reason_code_ptr, silent_if_not_found);
     }
 #if 0
   /* No one really seems to know why this was added. It certainly
@@ -827,7 +842,8 @@ decode_line_1 (char **argptr, int funfir
   /* Look up that token as a variable.
      If file specified, use that file's per-file block to start with.  */
 
-  return decode_variable (copy, funfirstline, canonical, file_symtab);
+  return decode_variable (copy, funfirstline, canonical,
+			  file_symtab, reason_code_ptr, silent_if_not_found);
 }
 
 \f
@@ -1422,10 +1438,14 @@ collect_methods (char *copy, struct type
 \f
 
 /* Return the symtab associated to the filename given by the substring
-   of *ARGPTR ending at P, and advance ARGPTR past that filename.  */
+   of *ARGPTR ending at P, and advance ARGPTR past that filename.  The
+   SILENT_IF_NOT_FOUND flag is used to specify that if the filename is
+   not found, do not issue an error message.  The REASON_CODE_PTR
+   is used to store a reason code should the source file not be found.  */
 
 static struct symtab *
-symtab_from_filename (char **argptr, char *p, int is_quote_enclosed)
+symtab_from_filename (char **argptr, char *p, int is_quote_enclosed, 
+		      int *reason_code_ptr, int silent_if_not_found)
 {
   char *p1;
   char *copy;
@@ -1450,6 +1470,10 @@ symtab_from_filename (char **argptr, cha
     {
       if (!have_full_symbols () && !have_partial_symbols ())
 	error ("No symbol table is loaded.  Use the \"file\" command.");
+      if (reason_code_ptr)
+	*reason_code_ptr = DL1_NOT_FOUND;
+      if (silent_if_not_found)
+        throw_exception (RETURN_ERROR);
       error ("No source file named %s.", copy);
     }
 
@@ -1626,11 +1650,15 @@ decode_dollar (char *copy, int funfirstl
 \f
 
 /* Decode a linespec that's a variable.  If FILE_SYMTAB is non-NULL,
-   look in that symtab's static variables first.  */
+   look in that symtab's static variables first.  The SILENT_IF_NOT_FOUND
+   flag is used to specify that no error message should be issued if the
+   function is not found.   The REASON_CODE_PTR is used to store a reason 
+   code should the function not be found.  */
 
 static struct symtabs_and_lines
 decode_variable (char *copy, int funfirstline, char ***canonical,
-		 struct symtab *file_symtab)
+		 struct symtab *file_symtab, int *reason_code_ptr,
+		 int silent_if_not_found)
 {
   struct symbol *sym;
   /* The symtab that SYM was found in.  */
@@ -1658,6 +1686,11 @@ decode_variable (char *copy, int funfirs
       !have_partial_symbols () && !have_minimal_symbols ())
     error ("No symbol table is loaded.  Use the \"file\" command.");
 
+  if (reason_code_ptr)
+    *reason_code_ptr = DL1_NOT_FOUND;
+  if (silent_if_not_found)
+    throw_exception (RETURN_ERROR);
+  
   error ("Function \"%s\" not defined.", copy);
 }
 
Index: linespec.h
===================================================================
RCS file: /cvs/src/src/gdb/linespec.h,v
retrieving revision 1.3
diff -u -p -r1.3 linespec.h
--- linespec.h	12 Apr 2003 17:41:25 -0000	1.3
+++ linespec.h	8 Dec 2003 22:03:58 -0000
@@ -24,6 +24,10 @@ struct symtab;
 extern struct symtabs_and_lines
 	decode_line_1 (char **argptr, int funfirstline,
 		       struct symtab *default_symtab, int default_line,
-		       char ***canonical);
+		       char ***canonical, int *reason_code_ptr,
+		       int silent_if_not_found);
+
+/* Failure reason codes (non-zero).  */
+#define DL1_NOT_FOUND 0x1
 
 #endif /* defined (LINESPEC_H) */
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.123
diff -u -p -r1.123 symtab.c
--- symtab.c	22 Nov 2003 16:01:03 -0000	1.123
+++ symtab.c	8 Dec 2003 22:03:58 -0000
@@ -3868,7 +3868,7 @@ decode_line_spec (char *string, int funf
   
   sals = decode_line_1 (&string, funfirstline,
 			cursal.symtab, cursal.line,
-			(char ***) NULL);
+			(char ***) NULL, NULL, 0);
 
   if (*string)
     error ("Junk at end of line specification: %s", string);
Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.54
diff -u -p -r1.54 tracepoint.c
--- tracepoint.c	2 Oct 2003 20:28:30 -0000	1.54
+++ tracepoint.c	8 Dec 2003 22:03:58 -0000
@@ -392,7 +392,7 @@ trace_command (char *arg, int from_tty)
     printf_filtered ("TRACE %s\n", arg);
 
   addr_start = arg;
-  sals = decode_line_1 (&arg, 1, (struct symtab *) NULL, 0, &canonical);
+  sals = decode_line_1 (&arg, 1, (struct symtab *) NULL, 0, &canonical, NULL, 0);
   addr_end = arg;
   if (!sals.nelts)
     return;			/* ??? Presumably decode_line_1 has already warned? */
@@ -2341,7 +2341,7 @@ scope_info (char *args, int from_tty)
   if (args == 0 || *args == 0)
     error ("requires an argument (function, line or *addr) to define a scope");
 
-  sals = decode_line_1 (&args, 1, NULL, 0, &canonical);
+  sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL, 0);
   if (sals.nelts == 0)
     return;			/* presumably decode_line_1 has already warned */
 
Index: cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.36
diff -u -p -r1.36 cli-cmds.c
--- cli/cli-cmds.c	8 Nov 2003 00:13:03 -0000	1.36
+++ cli/cli-cmds.c	8 Dec 2003 22:03:58 -0000
@@ -557,7 +557,7 @@ edit_command (char *arg, int from_tty)
       /* Now should only be one argument -- decode it in SAL */
 
       arg1 = arg;
-      sals = decode_line_1 (&arg1, 0, 0, 0, 0);
+      sals = decode_line_1 (&arg1, 0, 0, 0, 0, NULL, 0);
 
       if (! sals.nelts) return;  /*  C++  */
       if (sals.nelts > 1) {
@@ -681,7 +681,7 @@ list_command (char *arg, int from_tty)
     dummy_beg = 1;
   else
     {
-      sals = decode_line_1 (&arg1, 0, 0, 0, 0);
+      sals = decode_line_1 (&arg1, 0, 0, 0, 0, NULL, 0);
 
       if (!sals.nelts)
 	return;			/*  C++  */
@@ -714,9 +714,9 @@ list_command (char *arg, int from_tty)
       else
 	{
 	  if (dummy_beg)
-	    sals_end = decode_line_1 (&arg1, 0, 0, 0, 0);
+	    sals_end = decode_line_1 (&arg1, 0, 0, 0, 0, NULL, 0);
 	  else
-	    sals_end = decode_line_1 (&arg1, 0, sal.symtab, sal.line, 0);
+	    sals_end = decode_line_1 (&arg1, 0, sal.symtab, sal.line, 0, NULL, 0);
 	  if (sals_end.nelts == 0)
 	    return;
 	  if (sals_end.nelts > 1)

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

* Re: [RFA]: add reason code and silent flag to decode_line_1
  2003-12-08 22:06 [RFA]: add reason code and silent flag to decode_line_1 J. Johnston
@ 2003-12-08 22:33 ` David Carlton
  2003-12-08 22:49   ` J. Johnston
  0 siblings, 1 reply; 15+ messages in thread
From: David Carlton @ 2003-12-08 22:33 UTC (permalink / raw)
  To: J. Johnston; +Cc: gdb-patches

On Mon, 08 Dec 2003 17:06:16 -0500, "J. Johnston" <jjohnstn@redhat.com> said:

> I have added two new paramters to decode_line_1.  One is a
> reason_code field and the other is a silent_flag.  The reason code
> is a pointer to an int to store a reason code should the function
> cause an error.  At present, the reason_code is only set if the file
> or function is not found.  I would have called it not_found_ptr
> instead of reason_code_ptr but I felt this could be enhanced in the
> future to include other forms of error that could be of interest to
> the caller.  The reason code works like errno whereby the caller is
> expected to clear the field before calling and check it afterwards.
> The silent_if_not_found flag tells the function not to issue an
> error message if the function is to fail because the function/source
> file is not found.

I didn't even know GDB had a function 'throw_exception'; learn
something new every day.  Anyways, I'm not in a position to approve
it, but here are my thoughts.  My first reaction was "decode_line_1
has too many arguments to begin with", but that's not your fault.  But
I'm not sure you have a coherent story for your two arguments - on the
one hand, you want to be general with reason_code_ptr, but on the
other hand silent_if_not_found is very specialized, and they both
convey overlapping information.

It seems reasonable to me that you can say "if we fail for certain
reasons, then either we'll convey the reason for failure by calling
error() with an error message or else we'll convey the reason for
failure by storing it in a variable and throwing an exception".  I
have a hard time imagining situations where silent_if_not_found is
false but reason_code_ptr is still used, for example.  (Assuming, of
course, that further reasons aren't added; and, if they are added,
we'd need to add another silent_if_XXX flag.)

So I think that you should just add the reason_code_ptr variable (and
probably just call it not_found_ptr for now, though I don't feel
strongly about that), and have the exception be thrown if and only if
it is non-NULL.

(I also think that, if I ever finish my decode_line_1 cleanup, I
should think about reducing the number of its arguments, and I think
that we should switch GDB over to a language with a better exception
model, but those aren't issues that you need to deal with right
now. :-) )

A unit test would be nice, too, if possible.

David Carlton
carlton@kealia.com


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

* Re: [RFA]: add reason code and silent flag to decode_line_1
  2003-12-08 22:33 ` David Carlton
@ 2003-12-08 22:49   ` J. Johnston
  2003-12-08 22:54     ` David Carlton
  0 siblings, 1 reply; 15+ messages in thread
From: J. Johnston @ 2003-12-08 22:49 UTC (permalink / raw)
  To: David Carlton; +Cc: gdb-patches

David Carlton wrote:
> On Mon, 08 Dec 2003 17:06:16 -0500, "J. Johnston" <jjohnstn@redhat.com> said:
> 
> 
>>I have added two new paramters to decode_line_1.  One is a
>>reason_code field and the other is a silent_flag.  The reason code
>>is a pointer to an int to store a reason code should the function
>>cause an error.  At present, the reason_code is only set if the file
>>or function is not found.  I would have called it not_found_ptr
>>instead of reason_code_ptr but I felt this could be enhanced in the
>>future to include other forms of error that could be of interest to
>>the caller.  The reason code works like errno whereby the caller is
>>expected to clear the field before calling and check it afterwards.
>>The silent_if_not_found flag tells the function not to issue an
>>error message if the function is to fail because the function/source
>>file is not found.
> 
> 
> I didn't even know GDB had a function 'throw_exception'; learn
> something new every day.  Anyways, I'm not in a position to approve
> it, but here are my thoughts.  My first reaction was "decode_line_1
> has too many arguments to begin with", but that's not your fault.  But
> I'm not sure you have a coherent story for your two arguments - on the
> one hand, you want to be general with reason_code_ptr, but on the
> other hand silent_if_not_found is very specialized, and they both
> convey overlapping information.
> 
> It seems reasonable to me that you can say "if we fail for certain
> reasons, then either we'll convey the reason for failure by calling
> error() with an error message or else we'll convey the reason for
> failure by storing it in a variable and throwing an exception".  I
> have a hard time imagining situations where silent_if_not_found is
> false but reason_code_ptr is still used, for example.  (Assuming, of
> course, that further reasons aren't added; and, if they are added,
> we'd need to add another silent_if_XXX flag.)
> 
> So I think that you should just add the reason_code_ptr variable (and
> probably just call it not_found_ptr for now, though I don't feel
> strongly about that), and have the exception be thrown if and only if
> it is non-NULL.
> 

I like that solution.  I'll resubmit the patch.


> (I also think that, if I ever finish my decode_line_1 cleanup, I
> should think about reducing the number of its arguments, and I think
> that we should switch GDB over to a language with a better exception
> model, but those aren't issues that you need to deal with right
> now. :-) )
> 
> A unit test would be nice, too, if possible.
> 

Well, that comes with my pending breakpoint support which I was asked to break 
into smaller chunks and get the support structure in place first.  It will be 
the first and perhaps only user of this functionality.

-- Jeff J.



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

* Re: [RFA]: add reason code and silent flag to decode_line_1
  2003-12-08 22:49   ` J. Johnston
@ 2003-12-08 22:54     ` David Carlton
  2003-12-09 21:24       ` J. Johnston
  0 siblings, 1 reply; 15+ messages in thread
From: David Carlton @ 2003-12-08 22:54 UTC (permalink / raw)
  To: J. Johnston; +Cc: gdb-patches

On Mon, 08 Dec 2003 17:49:50 -0500, "J. Johnston" <jjohnstn@redhat.com> said:
> David Carlton wrote:

>> A unit test would be nice, too, if possible.

> Well, that comes with my pending breakpoint support which I was
> asked to break into smaller chunks and get the support structure in
> place first.  It will be the first and perhaps only user of this
> functionality.

Fair enough.

David Carlton
carlton@kealia.com


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

* Re: [RFA]: add reason code and silent flag to decode_line_1
  2003-12-08 22:54     ` David Carlton
@ 2003-12-09 21:24       ` J. Johnston
  2003-12-09 21:28         ` David Carlton
                           ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: J. Johnston @ 2003-12-09 21:24 UTC (permalink / raw)
  To: David Carlton; +Cc: gdb-patches

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

David, here is the updated patch based on your suggestion.  It is definitely 
cleaner in the short-term.

2003-12-09  Jeff Johnston  <jjohnstn@redhat.com>

     * linespec.h (decode_line_1): Add new not_found_ptr parameter.
     * linespec.c (decode_line_1): Add new parameter.  Pass on
     new parameter to decode_variable and symtab_from_filename
     functions.
     (decode_variable): Add new not_found_ptr parameter.  Throw exception
     rather than failing if the not_found_ptr is non-null and the
     function is not found.
     (symtab_from_filename): Add new not_found_ptr parametr.   Throw exception
     rather than failing if the not_found_ptr is non-null and the
     source file is not found.
     * breakpoint.c: Change all callers of decode_line_1 to add default
     extra parameter for decode_line_1 calls.
     * tracepoint.c: Ditto.
     * cli/cli-cmds.c: Ditto.

David Carlton wrote:
> On Mon, 08 Dec 2003 17:49:50 -0500, "J. Johnston" <jjohnstn@redhat.com> said:
> 
>>David Carlton wrote:
> 
> 
>>>A unit test would be nice, too, if possible.
> 
> 
>>Well, that comes with my pending breakpoint support which I was
>>asked to break into smaller chunks and get the support structure in
>>place first.  It will be the first and perhaps only user of this
>>functionality.
> 
> 
> Fair enough.
> 
> David Carlton
> carlton@kealia.com
> 

[-- Attachment #2: linespec.patch --]
[-- Type: text/plain, Size: 11756 bytes --]

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.145
diff -u -p -r1.145 breakpoint.c
--- breakpoint.c	17 Nov 2003 00:55:49 -0000	1.145
+++ breakpoint.c	9 Dec 2003 21:14:45 -0000
@@ -4323,7 +4323,7 @@ solib_load_unload_1 (char *hookname, int
   int thread = -1;		/* All threads. */
 
   /* Set a breakpoint on the specified hook. */
-  sals = decode_line_1 (&hookname, 1, (struct symtab *) NULL, 0, &canonical);
+  sals = decode_line_1 (&hookname, 1, (struct symtab *) NULL, 0, &canonical, NULL);
   addr_end = hookname;
 
   if (sals.nelts == 0)
@@ -4841,9 +4841,9 @@ parse_breakpoint_sals (char **address,
  	      || ((strchr ("+-", (*address)[0]) != NULL)
  		  && ((*address)[1] != '['))))
 	*sals = decode_line_1 (address, 1, default_breakpoint_symtab,
-			       default_breakpoint_line, addr_string);
+			       default_breakpoint_line, addr_string, NULL);
       else
-	*sals = decode_line_1 (address, 1, (struct symtab *) NULL, 0, addr_string);
+	*sals = decode_line_1 (address, 1, (struct symtab *) NULL, 0, addr_string, NULL);
     }
   /* For any SAL that didn't have a canonical string, fill one in. */
   if (sals->nelts > 0 && *addr_string == NULL)
@@ -5289,7 +5289,7 @@ break_at_finish_command_1 (char *arg, in
 
   beg_addr_string = addr_string;
   sals = decode_line_1 (&addr_string, 1, (struct symtab *) NULL, 0,
-			(char ***) NULL);
+			(char ***) NULL, NULL);
 
   xfree (beg_addr_string);
   old_chain = make_cleanup (xfree, sals.sals);
@@ -5806,10 +5806,10 @@ until_break_command (char *arg, int from
 
   if (default_breakpoint_valid)
     sals = decode_line_1 (&arg, 1, default_breakpoint_symtab,
-			  default_breakpoint_line, (char ***) NULL);
+			  default_breakpoint_line, (char ***) NULL, NULL);
   else
     sals = decode_line_1 (&arg, 1, (struct symtab *) NULL, 
-			  0, (char ***) NULL);
+			  0, (char ***) NULL, NULL);
 
   if (sals.nelts != 1)
     error ("Couldn't get information on specified line.");
@@ -6269,7 +6269,7 @@ handle_gnu_v3_exceptions (int tempflag, 
     trigger_func_name = xstrdup ("__cxa_throw");
 
   nameptr = trigger_func_name;
-  sals = decode_line_1 (&nameptr, 1, NULL, 0, NULL);
+  sals = decode_line_1 (&nameptr, 1, NULL, 0, NULL, NULL);
   if (sals.nelts == 0)
     {
       xfree (trigger_func_name);
@@ -6976,7 +6976,7 @@ breakpoint_re_set_one (void *bint)
       set_language (b->language);
       input_radix = b->input_radix;
       s = b->addr_string;
-      sals = decode_line_1 (&s, 1, (struct symtab *) NULL, 0, (char ***) NULL);
+      sals = decode_line_1 (&s, 1, (struct symtab *) NULL, 0, (char ***) NULL, NULL);
       for (i = 0; i < sals.nelts; i++)
 	{
 	  resolve_sal_pc (&sals.sals[i]);
@@ -7512,10 +7512,10 @@ decode_line_spec_1 (char *string, int fu
     sals = decode_line_1 (&string, funfirstline,
 			  default_breakpoint_symtab,
 			  default_breakpoint_line,
-			  (char ***) NULL);
+			  (char ***) NULL, NULL);
   else
     sals = decode_line_1 (&string, funfirstline,
-			  (struct symtab *) NULL, 0, (char ***) NULL);
+			  (struct symtab *) NULL, 0, (char ***) NULL, NULL);
   if (*string)
     error ("Junk at end of line specification: %s", string);
   return sals;
Index: linespec.c
===================================================================
RCS file: /cvs/src/src/gdb/linespec.c,v
retrieving revision 1.52
diff -u -p -r1.52 linespec.c
--- linespec.c	20 Oct 2003 14:38:42 -0000	1.52
+++ linespec.c	9 Dec 2003 21:14:45 -0000
@@ -100,7 +100,8 @@ static struct symtabs_and_lines decode_l
 					       int, int, char ***);
 
 static struct symtab *symtab_from_filename (char **argptr,
-					    char *p, int is_quote_enclosed);
+					    char *p, int is_quote_enclosed,
+					    int *not_found_ptr);
 
 static struct
 symtabs_and_lines decode_all_digits (char **argptr,
@@ -119,7 +120,8 @@ static struct symtabs_and_lines decode_d
 static struct symtabs_and_lines decode_variable (char *copy,
 						 int funfirstline,
 						 char ***canonical,
-						 struct symtab *file_symtab);
+						 struct symtab *file_symtab,
+						 int *not_found_ptr);
 
 static struct
 symtabs_and_lines symbol_found (int funfirstline,
@@ -637,7 +639,12 @@ decode_line_2 (struct symbol *sym_arr[],
 
    Note that it is possible to return zero for the symtab
    if no file is validly specified.  Callers must check that.
-   Also, the line number returned may be invalid.  */
+   Also, the line number returned may be invalid.  
+ 
+   If NOT_FOUND_PTR is not null, store a boolean true/false value at the location, based
+   on whether or not failure occurs due to an unknown function or file.  In the case
+   where failure does occur due to an unknown function or file, do not issue an error
+   message.  */
 
 /* We allow single quotes in various places.  This is a hideous
    kludge, which exists because the completer can't yet deal with the
@@ -646,7 +653,7 @@ decode_line_2 (struct symbol *sym_arr[],
 
 struct symtabs_and_lines
 decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
-	       int default_line, char ***canonical)
+	       int default_line, char ***canonical, int *not_found_ptr)
 {
   char *p;
   char *q;
@@ -665,6 +672,9 @@ decode_line_1 (char **argptr, int funfir
   int is_objc_method = 0;
   char *saved_arg = *argptr;
 
+  if (not_found_ptr)
+    *not_found_ptr = 0;
+
   /* Defaults have defaults.  */
 
   initialize_defaults (&default_symtab, &default_line);
@@ -722,7 +732,8 @@ decode_line_1 (char **argptr, int funfir
       /* No, the first part is a filename; set s to be that file's
 	 symtab.  Also, move argptr past the filename.  */
 
-      file_symtab = symtab_from_filename (argptr, p, is_quote_enclosed);
+      file_symtab = symtab_from_filename (argptr, p, is_quote_enclosed, 
+		      			  not_found_ptr);
     }
 #if 0
   /* No one really seems to know why this was added. It certainly
@@ -827,7 +838,8 @@ decode_line_1 (char **argptr, int funfir
   /* Look up that token as a variable.
      If file specified, use that file's per-file block to start with.  */
 
-  return decode_variable (copy, funfirstline, canonical, file_symtab);
+  return decode_variable (copy, funfirstline, canonical,
+			  file_symtab, not_found_ptr);
 }
 
 \f
@@ -1422,10 +1434,14 @@ collect_methods (char *copy, struct type
 \f
 
 /* Return the symtab associated to the filename given by the substring
-   of *ARGPTR ending at P, and advance ARGPTR past that filename.  */
+   of *ARGPTR ending at P, and advance ARGPTR past that filename.  If
+   NOT_FOUND_PTR is not null and the source file is not found, store
+   boolean true at the location pointed to and do not issue an
+   error message.  */
 
 static struct symtab *
-symtab_from_filename (char **argptr, char *p, int is_quote_enclosed)
+symtab_from_filename (char **argptr, char *p, int is_quote_enclosed, 
+		      int *not_found_ptr)
 {
   char *p1;
   char *copy;
@@ -1450,6 +1466,11 @@ symtab_from_filename (char **argptr, cha
     {
       if (!have_full_symbols () && !have_partial_symbols ())
 	error ("No symbol table is loaded.  Use the \"file\" command.");
+      if (not_found_ptr)
+	{
+	  *not_found_ptr = 1;
+	  throw_exception (RETURN_ERROR);
+	}
       error ("No source file named %s.", copy);
     }
 
@@ -1626,11 +1647,13 @@ decode_dollar (char *copy, int funfirstl
 \f
 
 /* Decode a linespec that's a variable.  If FILE_SYMTAB is non-NULL,
-   look in that symtab's static variables first.  */
+   look in that symtab's static variables first.  If NOT_FOUND_PTR is not NULL and
+   the function cannot be found, store boolean true in the location pointed to
+   and do not issue an error message.  */ 
 
 static struct symtabs_and_lines
 decode_variable (char *copy, int funfirstline, char ***canonical,
-		 struct symtab *file_symtab)
+		 struct symtab *file_symtab, int *not_found_ptr)
 {
   struct symbol *sym;
   /* The symtab that SYM was found in.  */
@@ -1658,6 +1681,12 @@ decode_variable (char *copy, int funfirs
       !have_partial_symbols () && !have_minimal_symbols ())
     error ("No symbol table is loaded.  Use the \"file\" command.");
 
+  if (not_found_ptr)
+    {
+      *not_found_ptr = 1;
+      throw_exception (RETURN_ERROR);
+    }
+  
   error ("Function \"%s\" not defined.", copy);
 }
 
Index: linespec.h
===================================================================
RCS file: /cvs/src/src/gdb/linespec.h,v
retrieving revision 1.3
diff -u -p -r1.3 linespec.h
--- linespec.h	12 Apr 2003 17:41:25 -0000	1.3
+++ linespec.h	9 Dec 2003 21:14:45 -0000
@@ -24,6 +24,6 @@ struct symtab;
 extern struct symtabs_and_lines
 	decode_line_1 (char **argptr, int funfirstline,
 		       struct symtab *default_symtab, int default_line,
-		       char ***canonical);
+		       char ***canonical, int *not_found_ptr);
 
 #endif /* defined (LINESPEC_H) */
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.123
diff -u -p -r1.123 symtab.c
--- symtab.c	22 Nov 2003 16:01:03 -0000	1.123
+++ symtab.c	9 Dec 2003 21:14:45 -0000
@@ -3868,7 +3868,7 @@ decode_line_spec (char *string, int funf
   
   sals = decode_line_1 (&string, funfirstline,
 			cursal.symtab, cursal.line,
-			(char ***) NULL);
+			(char ***) NULL, NULL);
 
   if (*string)
     error ("Junk at end of line specification: %s", string);
Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.54
diff -u -p -r1.54 tracepoint.c
--- tracepoint.c	2 Oct 2003 20:28:30 -0000	1.54
+++ tracepoint.c	9 Dec 2003 21:14:46 -0000
@@ -392,7 +392,7 @@ trace_command (char *arg, int from_tty)
     printf_filtered ("TRACE %s\n", arg);
 
   addr_start = arg;
-  sals = decode_line_1 (&arg, 1, (struct symtab *) NULL, 0, &canonical);
+  sals = decode_line_1 (&arg, 1, (struct symtab *) NULL, 0, &canonical, NULL);
   addr_end = arg;
   if (!sals.nelts)
     return;			/* ??? Presumably decode_line_1 has already warned? */
@@ -2341,7 +2341,7 @@ scope_info (char *args, int from_tty)
   if (args == 0 || *args == 0)
     error ("requires an argument (function, line or *addr) to define a scope");
 
-  sals = decode_line_1 (&args, 1, NULL, 0, &canonical);
+  sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL);
   if (sals.nelts == 0)
     return;			/* presumably decode_line_1 has already warned */
 
Index: cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.36
diff -u -p -r1.36 cli-cmds.c
--- cli/cli-cmds.c	8 Nov 2003 00:13:03 -0000	1.36
+++ cli/cli-cmds.c	9 Dec 2003 21:14:46 -0000
@@ -557,7 +557,7 @@ edit_command (char *arg, int from_tty)
       /* Now should only be one argument -- decode it in SAL */
 
       arg1 = arg;
-      sals = decode_line_1 (&arg1, 0, 0, 0, 0);
+      sals = decode_line_1 (&arg1, 0, 0, 0, 0, 0);
 
       if (! sals.nelts) return;  /*  C++  */
       if (sals.nelts > 1) {
@@ -681,7 +681,7 @@ list_command (char *arg, int from_tty)
     dummy_beg = 1;
   else
     {
-      sals = decode_line_1 (&arg1, 0, 0, 0, 0);
+      sals = decode_line_1 (&arg1, 0, 0, 0, 0, 0);
 
       if (!sals.nelts)
 	return;			/*  C++  */
@@ -714,9 +714,9 @@ list_command (char *arg, int from_tty)
       else
 	{
 	  if (dummy_beg)
-	    sals_end = decode_line_1 (&arg1, 0, 0, 0, 0);
+	    sals_end = decode_line_1 (&arg1, 0, 0, 0, 0, 0);
 	  else
-	    sals_end = decode_line_1 (&arg1, 0, sal.symtab, sal.line, 0);
+	    sals_end = decode_line_1 (&arg1, 0, sal.symtab, sal.line, 0, 0);
 	  if (sals_end.nelts == 0)
 	    return;
 	  if (sals_end.nelts > 1)

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

* Re: [RFA]: add reason code and silent flag to decode_line_1
  2003-12-09 21:24       ` J. Johnston
@ 2003-12-09 21:28         ` David Carlton
  2003-12-09 21:29         ` Daniel Jacobowitz
  2003-12-17 19:48         ` Elena Zannoni
  2 siblings, 0 replies; 15+ messages in thread
From: David Carlton @ 2003-12-09 21:28 UTC (permalink / raw)
  To: J. Johnston; +Cc: gdb-patches, Elena Zannoni

On Tue, 09 Dec 2003 16:24:34 -0500, "J. Johnston" <jjohnstn@redhat.com> said:

> David, here is the updated patch based on your suggestion.

Thanks.  I can't approve it myself, but I do recommend that Elena
approve it.  At least as long as you make sure the lines aren't too
long - it seemed like there were lines longer than 80 characters in
several places, though it's hard to be sure just by looking at a
patch.

David Carlton
carlton@kealia.com


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

* Re: [RFA]: add reason code and silent flag to decode_line_1
  2003-12-09 21:24       ` J. Johnston
  2003-12-09 21:28         ` David Carlton
@ 2003-12-09 21:29         ` Daniel Jacobowitz
  2003-12-09 22:47           ` Andrew Cagney
  2003-12-17 19:48         ` Elena Zannoni
  2 siblings, 1 reply; 15+ messages in thread
From: Daniel Jacobowitz @ 2003-12-09 21:29 UTC (permalink / raw)
  To: J. Johnston; +Cc: David Carlton, gdb-patches

On Tue, Dec 09, 2003 at 04:24:34PM -0500, J. Johnston wrote:
> David, here is the updated patch based on your suggestion.  It is 
> definitely cleaner in the short-term.
> 
> 2003-12-09  Jeff Johnston  <jjohnstn@redhat.com>
> 
>     * linespec.h (decode_line_1): Add new not_found_ptr parameter.
>     * linespec.c (decode_line_1): Add new parameter.  Pass on
>     new parameter to decode_variable and symtab_from_filename
>     functions.
>     (decode_variable): Add new not_found_ptr parameter.  Throw exception
>     rather than failing if the not_found_ptr is non-null and the
>     function is not found.
>     (symtab_from_filename): Add new not_found_ptr parametr.   Throw 
>     exception
>     rather than failing if the not_found_ptr is non-null and the
>     source file is not found.
>     * breakpoint.c: Change all callers of decode_line_1 to add default
>     extra parameter for decode_line_1 calls.
>     * tracepoint.c: Ditto.
>     * cli/cli-cmds.c: Ditto.

You'll probably want to fix calls in Insight too.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: [RFA]: add reason code and silent flag to decode_line_1
  2003-12-09 21:29         ` Daniel Jacobowitz
@ 2003-12-09 22:47           ` Andrew Cagney
  2003-12-10  0:00             ` David Carlton
  0 siblings, 1 reply; 15+ messages in thread
From: Andrew Cagney @ 2003-12-09 22:47 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: J. Johnston, David Carlton, gdb-patches

For the record.
> On Tue, Dec 09, 2003 at 04:24:34PM -0500, J. Johnston wrote:
> 
>> David, here is the updated patch based on your suggestion.  It is 
>> definitely cleaner in the short-term.
>> 
>> 2003-12-09  Jeff Johnston  <jjohnstn@redhat.com>
>> 
>>     * linespec.h (decode_line_1): Add new not_found_ptr parameter.
>>     * linespec.c (decode_line_1): Add new parameter.  Pass on
>>     new parameter to decode_variable and symtab_from_filename
>>     functions.
>>     (decode_variable): Add new not_found_ptr parameter.  Throw exception
>>     rather than failing if the not_found_ptr is non-null and the
>>     function is not found.
>>     (symtab_from_filename): Add new not_found_ptr parametr.   Throw 
>>     exception
>>     rather than failing if the not_found_ptr is non-null and the
>>     source file is not found.
>>     * breakpoint.c: Change all callers of decode_line_1 to add default
>>     extra parameter for decode_line_1 calls.
>>     * tracepoint.c: Ditto.
>>     * cli/cli-cmds.c: Ditto.
> 
> 
> You'll probably want to fix calls in Insight too.

If/when Red Hat choose to contribute GDB is the time to decide if/when 
Jeff should be asked to fix it.  Not before.

Andrew


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

* Re: [RFA]: add reason code and silent flag to decode_line_1
  2003-12-09 22:47           ` Andrew Cagney
@ 2003-12-10  0:00             ` David Carlton
  2003-12-10  0:43               ` J. Johnston
  0 siblings, 1 reply; 15+ messages in thread
From: David Carlton @ 2003-12-10  0:00 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Daniel Jacobowitz, J. Johnston, gdb-patches

On Tue, 09 Dec 2003 17:47:46 -0500, Andrew Cagney <cagney@gnu.org> said:
> For the record.

>> You'll probably want to fix calls in Insight too.

> If/when Red Hat choose to contribute GDB is the time to decide
> if/when Jeff should be asked to fix it.  Not before.

That depends on what Jeff's motivation would be for fixing Insight.
He might just want to do it because he's a nice guy who likes to make
it easier for people to use free software, even if that takes a little
(not a lot, just a little) extra work.  That's why I keep on fixing
Insight, certainly; I don't care about the FSF specifically at all.

David Carlton
carlton@kealia.com


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

* Re: [RFA]: add reason code and silent flag to decode_line_1
  2003-12-10  0:00             ` David Carlton
@ 2003-12-10  0:43               ` J. Johnston
  0 siblings, 0 replies; 15+ messages in thread
From: J. Johnston @ 2003-12-10  0:43 UTC (permalink / raw)
  To: David Carlton; +Cc: Andrew Cagney, Daniel Jacobowitz, gdb-patches

David Carlton wrote:
> On Tue, 09 Dec 2003 17:47:46 -0500, Andrew Cagney <cagney@gnu.org> said:
> 
>>For the record.
> 
> 
>>>You'll probably want to fix calls in Insight too.
> 
> 
>>If/when Red Hat choose to contribute GDB is the time to decide
>>if/when Jeff should be asked to fix it.  Not before.
> 
> 
> That depends on what Jeff's motivation would be for fixing Insight.
> He might just want to do it because he's a nice guy who likes to make
> it easier for people to use free software, even if that takes a little
> (not a lot, just a little) extra work.  That's why I keep on fixing
> Insight, certainly; I don't care about the FSF specifically at all.
> 
> David Carlton
> carlton@kealia.com
> 

I don't have a copy of Insight around at the moment, but I have no problem 
checking it out and posting an obvious patch for it when/if my patch is accepted.

I just noticed my subject line is way off now that I have modified the patch. 
Oh well...

-- Jeff J.


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

* Re: [RFA]: add reason code and silent flag to decode_line_1
  2003-12-09 21:24       ` J. Johnston
  2003-12-09 21:28         ` David Carlton
  2003-12-09 21:29         ` Daniel Jacobowitz
@ 2003-12-17 19:48         ` Elena Zannoni
  2003-12-17 20:13           ` Daniel Jacobowitz
  2 siblings, 1 reply; 15+ messages in thread
From: Elena Zannoni @ 2003-12-17 19:48 UTC (permalink / raw)
  To: J. Johnston; +Cc: David Carlton, gdb-patches

J. Johnston writes:
 > David, here is the updated patch based on your suggestion.  It is definitely 
 > cleaner in the short-term.
 > 
 > 2003-12-09  Jeff Johnston  <jjohnstn@redhat.com>
 > 
 >      * linespec.h (decode_line_1): Add new not_found_ptr parameter.
 >      * linespec.c (decode_line_1): Add new parameter.  Pass on
 >      new parameter to decode_variable and symtab_from_filename
 >      functions.
 >      (decode_variable): Add new not_found_ptr parameter.  Throw exception
 >      rather than failing if the not_found_ptr is non-null and the
 >      function is not found.
 >      (symtab_from_filename): Add new not_found_ptr parametr.   Throw exception
 >      rather than failing if the not_found_ptr is non-null and the
 >      source file is not found.
 >      * breakpoint.c: Change all callers of decode_line_1 to add default
 >      extra parameter for decode_line_1 calls.
 >      * tracepoint.c: Ditto.
 >      * cli/cli-cmds.c: Ditto.


The linespec.c/.h part is approved.


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

* Re: [RFA]: add reason code and silent flag to decode_line_1
  2003-12-17 19:48         ` Elena Zannoni
@ 2003-12-17 20:13           ` Daniel Jacobowitz
  2003-12-17 21:48             ` J. Johnston
  2003-12-17 22:22             ` J. Johnston
  0 siblings, 2 replies; 15+ messages in thread
From: Daniel Jacobowitz @ 2003-12-17 20:13 UTC (permalink / raw)
  To: gdb-patches

On Wed, Dec 17, 2003 at 02:48:19PM -0500, Elena Zannoni wrote:
> J. Johnston writes:
>  > David, here is the updated patch based on your suggestion.  It is definitely 
>  > cleaner in the short-term.
>  > 
>  > 2003-12-09  Jeff Johnston  <jjohnstn@redhat.com>
>  > 
>  >      * linespec.h (decode_line_1): Add new not_found_ptr parameter.
>  >      * linespec.c (decode_line_1): Add new parameter.  Pass on
>  >      new parameter to decode_variable and symtab_from_filename
>  >      functions.
>  >      (decode_variable): Add new not_found_ptr parameter.  Throw exception
>  >      rather than failing if the not_found_ptr is non-null and the
>  >      function is not found.
>  >      (symtab_from_filename): Add new not_found_ptr parametr.   Throw exception
>  >      rather than failing if the not_found_ptr is non-null and the
>  >      source file is not found.
>  >      * breakpoint.c: Change all callers of decode_line_1 to add default
>  >      extra parameter for decode_line_1 calls.
>  >      * tracepoint.c: Ditto.
>  >      * cli/cli-cmds.c: Ditto.
> 
> 
> The linespec.c/.h part is approved.

Thanks - Jeff, with that approval I believe the rest of this patch is
obvious.  Eagerly awaiting the next bits.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: [RFA]: add reason code and silent flag to decode_line_1
  2003-12-17 20:13           ` Daniel Jacobowitz
@ 2003-12-17 21:48             ` J. Johnston
  2003-12-17 22:22             ` J. Johnston
  1 sibling, 0 replies; 15+ messages in thread
From: J. Johnston @ 2003-12-17 21:48 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

Thanks.  Patch checked in.

-- Jeff J.

Daniel Jacobowitz wrote:
> On Wed, Dec 17, 2003 at 02:48:19PM -0500, Elena Zannoni wrote:
> 
>>J. Johnston writes:
>> > David, here is the updated patch based on your suggestion.  It is definitely 
>> > cleaner in the short-term.
>> > 
>> > 2003-12-09  Jeff Johnston  <jjohnstn@redhat.com>
>> > 
>> >      * linespec.h (decode_line_1): Add new not_found_ptr parameter.
>> >      * linespec.c (decode_line_1): Add new parameter.  Pass on
>> >      new parameter to decode_variable and symtab_from_filename
>> >      functions.
>> >      (decode_variable): Add new not_found_ptr parameter.  Throw exception
>> >      rather than failing if the not_found_ptr is non-null and the
>> >      function is not found.
>> >      (symtab_from_filename): Add new not_found_ptr parametr.   Throw exception
>> >      rather than failing if the not_found_ptr is non-null and the
>> >      source file is not found.
>> >      * breakpoint.c: Change all callers of decode_line_1 to add default
>> >      extra parameter for decode_line_1 calls.
>> >      * tracepoint.c: Ditto.
>> >      * cli/cli-cmds.c: Ditto.
>>
>>
>>The linespec.c/.h part is approved.
> 
> 
> Thanks - Jeff, with that approval I believe the rest of this patch is
> obvious.  Eagerly awaiting the next bits.
> 


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

* Re: [RFA]: add reason code and silent flag to decode_line_1
  2003-12-17 20:13           ` Daniel Jacobowitz
  2003-12-17 21:48             ` J. Johnston
@ 2003-12-17 22:22             ` J. Johnston
  2003-12-29 20:20               ` Elena Zannoni
  1 sibling, 1 reply; 15+ messages in thread
From: J. Johnston @ 2003-12-17 22:22 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

I just noticed that symtab.c was missing from the list below.  It was updated in 
my tree, but not part of the patch.  I have checked it in as obvious as it is 
just changing the call to decode_line_1 like the other files.

2003-12-17  Jeff Johnston  <jjohnstn@redhat.com>

         * symtab.c (decode_line_spec): Change call to decode_line_1.



Daniel Jacobowitz wrote:
> On Wed, Dec 17, 2003 at 02:48:19PM -0500, Elena Zannoni wrote:
> 
>>J. Johnston writes:
>> > David, here is the updated patch based on your suggestion.  It is definitely 
>> > cleaner in the short-term.
>> > 
>> > 2003-12-09  Jeff Johnston  <jjohnstn@redhat.com>
>> > 
>> >      * linespec.h (decode_line_1): Add new not_found_ptr parameter.
>> >      * linespec.c (decode_line_1): Add new parameter.  Pass on
>> >      new parameter to decode_variable and symtab_from_filename
>> >      functions.
>> >      (decode_variable): Add new not_found_ptr parameter.  Throw exception
>> >      rather than failing if the not_found_ptr is non-null and the
>> >      function is not found.
>> >      (symtab_from_filename): Add new not_found_ptr parametr.   Throw exception
>> >      rather than failing if the not_found_ptr is non-null and the
>> >      source file is not found.
>> >      * breakpoint.c: Change all callers of decode_line_1 to add default
>> >      extra parameter for decode_line_1 calls.
>> >      * tracepoint.c: Ditto.
>> >      * cli/cli-cmds.c: Ditto.
>>
>>
>>The linespec.c/.h part is approved.
> 
> 
> Thanks - Jeff, with that approval I believe the rest of this patch is
> obvious.  Eagerly awaiting the next bits.
> 


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

* Re: [RFA]: add reason code and silent flag to decode_line_1
  2003-12-17 22:22             ` J. Johnston
@ 2003-12-29 20:20               ` Elena Zannoni
  0 siblings, 0 replies; 15+ messages in thread
From: Elena Zannoni @ 2003-12-29 20:20 UTC (permalink / raw)
  To: J. Johnston; +Cc: Daniel Jacobowitz, gdb-patches

J. Johnston writes:
 > I just noticed that symtab.c was missing from the list below.  It was updated in 
 > my tree, but not part of the patch.  I have checked it in as obvious as it is 
 > just changing the call to decode_line_1 like the other files.
 > 
 > 2003-12-17  Jeff Johnston  <jjohnstn@redhat.com>
 > 
 >          * symtab.c (decode_line_spec): Change call to decode_line_1.
 > 
 

Just for completion's sake, can you post the code diffs?


elena


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

end of thread, other threads:[~2003-12-29 20:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-08 22:06 [RFA]: add reason code and silent flag to decode_line_1 J. Johnston
2003-12-08 22:33 ` David Carlton
2003-12-08 22:49   ` J. Johnston
2003-12-08 22:54     ` David Carlton
2003-12-09 21:24       ` J. Johnston
2003-12-09 21:28         ` David Carlton
2003-12-09 21:29         ` Daniel Jacobowitz
2003-12-09 22:47           ` Andrew Cagney
2003-12-10  0:00             ` David Carlton
2003-12-10  0:43               ` J. Johnston
2003-12-17 19:48         ` Elena Zannoni
2003-12-17 20:13           ` Daniel Jacobowitz
2003-12-17 21:48             ` J. Johnston
2003-12-17 22:22             ` J. Johnston
2003-12-29 20:20               ` Elena Zannoni

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