Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Make interpreter_p an argument for gdb_main
@ 2003-02-12  0:50 Keith Seitz
  2003-02-12 16:45 ` Andrew Cagney
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Seitz @ 2003-02-12  0:50 UTC (permalink / raw)
  To: gdb-patches

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

Hi,

The recent interpreter commit broke insight. The following patch adds
interpreter_p to captured_main_args so that Insight's main function can
set it.

Sorry, Elena; more patches to review. :-(
Keith

ChangeLog
2003-02-11  Keith R Seitz  <keiths@redhat.com>

        * main.h (struct captured_main_args): Add interpreter_p.
        * main.c (captured_main): Don't initialize interpreter_p...
        (gdb_main): ... It's now initialized here.
        * gdb.c (main): Initialize interpreter_p.
        * Makefile.in (top.o): Add dependency for interps.h.


[-- Attachment #2: captured_main_args.patch --]
[-- Type: text/x-patch, Size: 2749 bytes --]

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.329
diff -u -p -r1.329 Makefile.in
--- Makefile.in	11 Feb 2003 16:11:16 -0000	1.329
+++ Makefile.in	12 Feb 2003 00:45:07 -0000
@@ -2232,7 +2232,7 @@ top.o: top.c $(defs_h) $(gdbcmd_h) $(cal
 	$(expression_h) $(value_h) $(language_h) $(terminal_h) $(annotate_h) \
 	$(completer_h) $(top_h) $(version_h) $(serial_h) $(doublest_h) \
 	$(gdb_assert_h) $(event_top_h) $(gdb_string_h) $(gdb_stat_h) \
-	$(ui_out_h) $(cli_out_h) $(readline_h)
+	$(ui_out_h) $(cli_out_h) $(readline_h) $(interps_h)
 tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(gdbtypes_h) \
 	$(expression_h) $(gdbcmd_h) $(value_h) $(target_h) $(language_h) \
 	$(gdb_string_h) $(inferior_h) $(tracepoint_h) $(remote_h) \
Index: main.h
===================================================================
RCS file: /cvs/src/src/gdb/main.h,v
retrieving revision 1.1
diff -u -p -r1.1 main.h
--- main.h	26 Sep 2002 17:46:04 -0000	1.1
+++ main.h	12 Feb 2003 00:45:07 -0000
@@ -27,6 +27,7 @@ struct captured_main_args
   int argc;
   char **argv;
   int use_windows;
+  char *interpreter_p;
 };
 
 extern int gdb_main (struct captured_main_args *);
Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.27
diff -u -p -r1.27 main.c
--- main.c	7 Feb 2003 00:27:30 -0000	1.27
+++ main.c	12 Feb 2003 00:45:07 -0000
@@ -228,12 +228,6 @@ captured_main (void *data)
 #endif
 #endif
 
-  /* There will always be an interpreter.  Either the one passed into
-     this captured main (not yet implemented), or one specified by the
-     user at start up, or the console.  Make life easier by always
-     initializing the interpreter to something.  */
-  interpreter_p = xstrdup (INTERP_CONSOLE);
-
   /* Parse arguments and options.  */
   {
     int c;
@@ -803,6 +797,7 @@ int
 gdb_main (struct captured_main_args *args)
 {
   use_windows = args->use_windows;
+  interpreter_p = xstrdup (args->interpreter_p);
   catch_errors (captured_main, args, "", RETURN_MASK_ALL);
   return 0;
 }
Index: gdb.c
===================================================================
RCS file: /cvs/src/src/gdb/gdb.c,v
retrieving revision 1.1
diff -u -p -r1.1 gdb.c
--- gdb.c	26 Sep 2002 17:46:04 -0000	1.1
+++ gdb.c	12 Feb 2003 00:45:07 -0000
@@ -21,6 +21,7 @@
 #include "defs.h"
 #include "main.h"
 #include "gdb_string.h"
+#include "interps.h"
 
 int
 main (int argc, char **argv)
@@ -30,5 +31,6 @@ main (int argc, char **argv)
   args.argc = argc;
   args.argv = argv;
   args.use_windows = 0;
+  args.interpreter_p = INTERP_CONSOLE;
   return gdb_main (&args);
 }

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

* Re: [RFA] Make interpreter_p an argument for gdb_main
  2003-02-12  0:50 [RFA] Make interpreter_p an argument for gdb_main Keith Seitz
@ 2003-02-12 16:45 ` Andrew Cagney
  2003-02-12 17:33   ` Keith Seitz
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2003-02-12 16:45 UTC (permalink / raw)
  To: Keith Seitz, Elena Zannoni; +Cc: gdb-patches

Since elena's overloaded I'll pick this up.

> +  char *interpreter_p;

Should be const.

> -  /* There will always be an interpreter.  Either the one passed into
> -     this captured main (not yet implemented), or one specified by the
> -     user at start up, or the console.  Make life easier by always
> -     initializing the interpreter to something.  */
> -  interpreter_p = xstrdup (INTERP_CONSOLE);

Can you please keep the assignment here (instead of below).

> -
>    /* Parse arguments and options.  */
>    {
>      int c;
> @@ -803,6 +797,7 @@ int
>  gdb_main (struct captured_main_args *args)
>  {
>    use_windows = args->use_windows;
> +  interpreter_p = xstrdup (args->interpreter_p);
>    catch_errors (captured_main, args, "", RETURN_MASK_ALL);
>    return 0;
>  }

``interpreter_p'' is -><- close to being made local to captured_main.

Otherwize ok,
Andrew



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

* Re: [RFA] Make interpreter_p an argument for gdb_main
  2003-02-12 16:45 ` Andrew Cagney
@ 2003-02-12 17:33   ` Keith Seitz
  2003-02-13 17:20     ` Andrew Cagney
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Seitz @ 2003-02-12 17:33 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

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

On Wed, 2003-02-12 at 08:45, Andrew Cagney wrote:
> ``interpreter_p'' is -><- close to being made local to captured_main.

Ahh. Ok, that gives me a new criteria for considering where to put such
changes.

> Otherwize ok,

New patch attachd. Note that I've corrected the top.o/gdb.o mishap in
the makefile.

Keith

PS. Anyone want to talk about deprecating "-nw" and "-w" (or aliasing
them to doing the same as "-i=console" and ???)?

ChangeLog
2003-02-12  Keith R Seitz  <keiths@redhat.com>

        * main.h (struct captured_main_args): Add interpreter_p.
        * main.c (captured_main): Initialize interpreter_p from context.
        * gdb.c (main): Set interpreter_p argument.
        * Makefile.in (gdb.o): Add dependency for interps.h.



[-- Attachment #2: p --]
[-- Type: text/x-patch, Size: 2693 bytes --]

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.329
diff -u -p -r1.329 Makefile.in
--- Makefile.in	11 Feb 2003 16:11:16 -0000	1.329
+++ Makefile.in	12 Feb 2003 17:13:17 -0000
@@ -1682,7 +1682,7 @@ frv-tdep.o: frv-tdep.c $(defs_h) $(infer
 	$(arch_utils_h) $(regcache_h)
 gcore.o: gcore.c $(defs_h) $(cli_decode_h) $(inferior_h) $(gdbcore_h) \
 	$(elf_bfd_h) $(symfile_h) $(objfiles_h)
-gdb.o: gdb.c $(defs_h) $(main_h) $(gdb_string_h)
+gdb.o: gdb.c $(defs_h) $(main_h) $(gdb_string_h) $(interps_h)
 gdb-events.o: gdb-events.c $(defs_h) $(gdb_events_h) $(gdbcmd_h)
 gdbarch.o: gdbarch.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) $(inferior_h) \
 	$(gdb_string_h) $(symtab_h) $(frame_h) $(inferior_h) $(breakpoint_h) \
Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.27
diff -u -p -r1.27 main.c
--- main.c	7 Feb 2003 00:27:30 -0000	1.27
+++ main.c	12 Feb 2003 17:13:17 -0000
@@ -229,10 +229,10 @@ captured_main (void *data)
 #endif
 
   /* There will always be an interpreter.  Either the one passed into
-     this captured main (not yet implemented), or one specified by the
-     user at start up, or the console.  Make life easier by always
-     initializing the interpreter to something.  */
-  interpreter_p = xstrdup (INTERP_CONSOLE);
+     this captured main, or one specified by the user at start up, or
+     the console.  Initialize the interpreter to the one requested by 
+     the application.  */
+  interpreter_p = xstrdup (context->interpreter_p);
 
   /* Parse arguments and options.  */
   {
Index: main.h
===================================================================
RCS file: /cvs/src/src/gdb/main.h,v
retrieving revision 1.1
diff -u -p -r1.1 main.h
--- main.h	26 Sep 2002 17:46:04 -0000	1.1
+++ main.h	12 Feb 2003 17:13:17 -0000
@@ -27,6 +27,7 @@ struct captured_main_args
   int argc;
   char **argv;
   int use_windows;
+  const char *interpreter_p;
 };
 
 extern int gdb_main (struct captured_main_args *);
Index: gdb.c
===================================================================
RCS file: /cvs/src/src/gdb/gdb.c,v
retrieving revision 1.1
diff -u -p -r1.1 gdb.c
--- gdb.c	26 Sep 2002 17:46:04 -0000	1.1
+++ gdb.c	12 Feb 2003 17:13:17 -0000
@@ -21,6 +21,7 @@
 #include "defs.h"
 #include "main.h"
 #include "gdb_string.h"
+#include "interps.h"
 
 int
 main (int argc, char **argv)
@@ -30,5 +31,6 @@ main (int argc, char **argv)
   args.argc = argc;
   args.argv = argv;
   args.use_windows = 0;
+  args.interpreter_p = INTERP_CONSOLE;
   return gdb_main (&args);
 }

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

* Re: [RFA] Make interpreter_p an argument for gdb_main
  2003-02-12 17:33   ` Keith Seitz
@ 2003-02-13 17:20     ` Andrew Cagney
  2003-02-13 18:09       ` Keith Seitz
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2003-02-13 17:20 UTC (permalink / raw)
  To: Keith Seitz; +Cc: gdb-patches

> On Wed, 2003-02-12 at 08:45, Andrew Cagney wrote:
> 
>> ``interpreter_p'' is -><- close to being made local to captured_main.
> 
> 
> Ahh. Ok, that gives me a new criteria for considering where to put such
> changes.
> 
> 
>> Otherwize ok,
> 
> 
> New patch attachd. Note that I've corrected the top.o/gdb.o mishap in
> the makefile.
> 
> Keith
> 
> PS. Anyone want to talk about deprecating "-nw" and "-w" (or aliasing
> them to doing the same as "-i=console" and ???)?
> 
> ChangeLog
> 2003-02-12  Keith R Seitz  <keiths@redhat.com>
> 
>         * main.h (struct captured_main_args): Add interpreter_p.
>         * main.c (captured_main): Initialize interpreter_p from context.
>         * gdb.c (main): Set interpreter_p argument.
>         * Makefile.in (gdb.o): Add dependency for interps.h.

Yes, ok.

I think, now, for Insight, just need to get .../-main.c and gdbtk.c to 
agree on the interpreter's name (what ever it is).

Andrew

> Index: Makefile.in
> ===================================================================
> RCS file: /cvs/src/src/gdb/Makefile.in,v
> retrieving revision 1.329
> diff -u -p -r1.329 Makefile.in
> --- Makefile.in	11 Feb 2003 16:11:16 -0000	1.329
> +++ Makefile.in	12 Feb 2003 17:13:17 -0000
> @@ -1682,7 +1682,7 @@ frv-tdep.o: frv-tdep.c $(defs_h) $(infer
>  	$(arch_utils_h) $(regcache_h)
>  gcore.o: gcore.c $(defs_h) $(cli_decode_h) $(inferior_h) $(gdbcore_h) \
>  	$(elf_bfd_h) $(symfile_h) $(objfiles_h)
> -gdb.o: gdb.c $(defs_h) $(main_h) $(gdb_string_h)
> +gdb.o: gdb.c $(defs_h) $(main_h) $(gdb_string_h) $(interps_h)
>  gdb-events.o: gdb-events.c $(defs_h) $(gdb_events_h) $(gdbcmd_h)
>  gdbarch.o: gdbarch.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) $(inferior_h) \
>  	$(gdb_string_h) $(symtab_h) $(frame_h) $(inferior_h) $(breakpoint_h) \
> Index: main.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/main.c,v
> retrieving revision 1.27
> diff -u -p -r1.27 main.c
> --- main.c	7 Feb 2003 00:27:30 -0000	1.27
> +++ main.c	12 Feb 2003 17:13:17 -0000
> @@ -229,10 +229,10 @@ captured_main (void *data)
>  #endif
>  
>    /* There will always be an interpreter.  Either the one passed into
> -     this captured main (not yet implemented), or one specified by the
> -     user at start up, or the console.  Make life easier by always
> -     initializing the interpreter to something.  */
> -  interpreter_p = xstrdup (INTERP_CONSOLE);
> +     this captured main, or one specified by the user at start up, or
> +     the console.  Initialize the interpreter to the one requested by 
> +     the application.  */
> +  interpreter_p = xstrdup (context->interpreter_p);
>  
>    /* Parse arguments and options.  */
>    {
> Index: main.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/main.h,v
> retrieving revision 1.1
> diff -u -p -r1.1 main.h
> --- main.h	26 Sep 2002 17:46:04 -0000	1.1
> +++ main.h	12 Feb 2003 17:13:17 -0000
> @@ -27,6 +27,7 @@ struct captured_main_args
>    int argc;
>    char **argv;
>    int use_windows;
> +  const char *interpreter_p;
>  };
>  
>  extern int gdb_main (struct captured_main_args *);
> Index: gdb.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdb.c,v
> retrieving revision 1.1
> diff -u -p -r1.1 gdb.c
> --- gdb.c	26 Sep 2002 17:46:04 -0000	1.1
> +++ gdb.c	12 Feb 2003 17:13:17 -0000
> @@ -21,6 +21,7 @@
>  #include "defs.h"
>  #include "main.h"
>  #include "gdb_string.h"
> +#include "interps.h"
>  
>  int
>  main (int argc, char **argv)
> @@ -30,5 +31,6 @@ main (int argc, char **argv)
>    args.argc = argc;
>    args.argv = argv;
>    args.use_windows = 0;
> +  args.interpreter_p = INTERP_CONSOLE;
>    return gdb_main (&args);
>  }



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

* Re: [RFA] Make interpreter_p an argument for gdb_main
  2003-02-13 17:20     ` Andrew Cagney
@ 2003-02-13 18:09       ` Keith Seitz
  0 siblings, 0 replies; 5+ messages in thread
From: Keith Seitz @ 2003-02-13 18:09 UTC (permalink / raw)
  To: gdb-patches

On Thu, 2003-02-13 at 09:20, Andrew Cagney wrote:
> > ChangeLog
> > 2003-02-12  Keith R Seitz  <keiths@redhat.com>
> > 
> >         * main.h (struct captured_main_args): Add interpreter_p.
> >         * main.c (captured_main): Initialize interpreter_p from context.
> >         * gdb.c (main): Set interpreter_p argument.
> >         * Makefile.in (gdb.o): Add dependency for interps.h.
> 
> Yes, ok.

Committed. Thank you for looking at this.

> I think, now, for Insight, just need to get .../-main.c and gdbtk.c to 
> agree on the interpreter's name (what ever it is).

I'll submit the argv0 thing shortly.

Keith



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

end of thread, other threads:[~2003-02-13 18:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-12  0:50 [RFA] Make interpreter_p an argument for gdb_main Keith Seitz
2003-02-12 16:45 ` Andrew Cagney
2003-02-12 17:33   ` Keith Seitz
2003-02-13 17:20     ` Andrew Cagney
2003-02-13 18:09       ` Keith Seitz

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