This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3 1/3] MI: add the -catch-load and -catch-unload commands
- From: Yao Qi <yao at codesourcery dot com>
- To: Mircea Gherzan <mircea dot gherzan at intel dot com>
- Cc: <gdb-patches at sourceware dot org>, <keven dot boell at intel dot com>, <marc dot khouzam at ericsson dot com>, <tromey at redhat dot com>
- Date: Tue, 20 Nov 2012 10:18:39 +0800
- Subject: Re: [PATCH v3 1/3] MI: add the -catch-load and -catch-unload commands
- References: <1353336595-19986-1-git-send-email-mircea.gherzan@intel.com>
On 11/19/2012 10:49 PM, Mircea Gherzan wrote:
-static void
-catch_load_or_unload (char *arg, int from_tty, int is_load,
- struct cmd_list_element *command)
+void
+add_solib_catchpoint (struct gdbarch *arch, char *arg, int is_load,
+ int is_temp, int enabled)
{
struct solib_catchpoint *c;
- struct gdbarch *gdbarch = get_current_arch ();
I don't understand why do we pass 'gdbarch' into this function, instead
of getting it here. The caller of add_solib_catchpoint passes
get_current_arch () to it. Anything wrong if we leave this part unchanged?
- int tempflag;
struct cleanup *cleanup;
- tempflag = get_cmd_context (command) == CATCH_TEMPORARY;
-
if (!arg)
arg = "";
arg = skip_spaces (arg);
diff --git a/gdb/mi/mi-cmd-catch.c b/gdb/mi/mi-cmd-catch.c
new file mode 100644
index 0000000..cbc8257
--- /dev/null
+++ b/gdb/mi/mi-cmd-catch.c
@@ -0,0 +1,96 @@
+/* MI Command Set - catch commands.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ Contributed by Intel Corporation.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see<http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+
+#include "defs.h"
If we really have to include <stdio.h>, please include "defs.h" first.
We have an 'include-defs.h-first' rule. See
[PATCH] Always include defs.h first.
http://sourceware.org/ml/gdb-patches/2012-11/msg00166.html
+#include "arch-utils.h"
+#include "breakpoint.h"
+#include "libiberty.h"
+#include "mi-cmds.h"
+#include "mi-getopt.h"
--
Yao (éå)