From: "Andrew Burgess" <aburgess@broadcom.com>
To: insight@sourceware.org
Subject: [PATCH] Remove use of deprecated_init_ui_hook
Date: Wed, 18 Sep 2013 13:45:00 -0000 [thread overview]
Message-ID: <5239AE74.80100@broadcom.com> (raw)
We currently use deprecated_init_ui_hook in order to
get hold of argv0 that started up gdb (this is used
in a call to Tcl_FindExecutable).
This patch to gdb:
https://sourceware.org/ml/gdb-patches/2013-09/msg00225.html
adds a new function get_gdb_program_name () that allows
direct access to argv0.
The patch below switches to use the new function, and
removes the use of deprecated_init_ui_hook.
OK to apply?
Thanks,
Andrew
2013-09-18 Andrew Burgess <aburgess@broadcom.com>
* generic/gdbtk.c: Add include of "main.h".
(gdbtk_init_1): Remove.
(argv0): Remove.
(_initialize_gdbtk): No longer set deprecated_init_ui_hook.
(gdbtk_init): Use get_gdb_program_name function from main.h.
diff -u -p -r1.56 gdbtk.c
--- ./gdb/gdbtk/generic/gdbtk.c 23 Jul 2013 16:40:47 -0000 1.56
+++ ./gdb/gdbtk/generic/gdbtk.c 18 Sep 2013 13:38:51 -0000
@@ -31,6 +31,7 @@
#include "top.h"
#include "annotate.h"
#include "exceptions.h"
+#include "main.h"
#if defined(_WIN32) || defined(__CYGWIN__)
#define WIN32_LEAN_AND_MEAN
@@ -88,8 +89,6 @@ extern int Tktable_Init (Tcl_Interp * in
void gdbtk_init (void);
-static void gdbtk_init_1 (char *argv0);
-
void gdbtk_interactive (void);
static void cleanup_init (void *ignore);
@@ -122,8 +121,6 @@ int running_now;
static char *gdbtk_source_filename = NULL;
int gdbtk_disable_fputs = 1;
-
-static const char *argv0;
\f
#ifndef _WIN32
@@ -372,7 +369,7 @@ gdbtk_init (void)
old_chain = make_cleanup (cleanup_init, 0);
/* First init tcl and tk. */
- Tcl_FindExecutable (argv0);
+ Tcl_FindExecutable (get_gdb_program_name ());
gdbtk_interp = Tcl_CreateInterp ();
#ifdef TCL_MEM_DEBUG
@@ -664,13 +661,6 @@ gdbtk_find_main";
}
}
-static void
-gdbtk_init_1 (char *arg0)
-{
- argv0 = arg0;
- deprecated_init_ui_hook = NULL;
-}
-
/* gdbtk_test is used in main.c to validate the -tclcommand option to
gdb, which sources in a file of tcl code after idle during the
startup procedure. */
@@ -690,13 +680,11 @@ gdbtk_test (char *filename)
void
_initialize_gdbtk (void)
{
+#ifdef __CYGWIN__
/* Current_interpreter not set yet, so we must check
if "interpreter_p" is set to "insight" to know if
insight is GOING to run. */
- if (strcmp (interpreter_p, "insight") == 0)
- deprecated_init_ui_hook = gdbtk_init_1;
-#ifdef __CYGWIN__
- else
+ if (strcmp (interpreter_p, "insight") != 0)
{
DWORD ft = GetFileType (GetStdHandle (STD_INPUT_HANDLE));
next reply other threads:[~2013-09-18 13:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-18 13:45 Andrew Burgess [this message]
[not found] ` <523B92DD.5060408@redhat.com>
2013-09-20 11:50 ` Andrew Burgess
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=5239AE74.80100@broadcom.com \
--to=aburgess@broadcom.com \
--cc=insight@sourceware.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).