* symbolic debug of loadable modules with kgdb light
@ 2009-01-09 15:51 Caz Yokoyama
2009-04-24 15:33 ` Tom Tromey
0 siblings, 1 reply; 55+ messages in thread
From: Caz Yokoyama @ 2009-01-09 15:51 UTC (permalink / raw)
To: 'Joel Brobecker'; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1113 bytes --]
Hello,
I have attached the patch against gdb-6.8.
- This patch is based on http://kgdb.cvs.sourceforge.net/viewvc/kgdb/gdb/. I
removed garbage as mush as possible. But it still has the code which I don't
know what it is. I don't remove copyright notice which is there.
- I haven't run testsuite because I could not find how to do that while I
run make in testsuite directory.
- I believe that the code follows coding standard. Let me know if not.
- The patch is produced by "svn diff". I believe patch format is the one you
want. Let me know if not.
-caz
P.S. I accidentally send the patch to gdb while I recalled.
-----Original Message-----
From: Joel Brobecker [mailto:brobecker@adacore.com]
Sent: Thursday, January 08, 2009 8:18 PM
To: Caz Yokoyama
Cc: gdb@sourceware.org
Subject: Re: symbolic debug of loadable modules with kgdb light
> Is there anyway to integrate my modifications to gdb?
We indeed welcome contributes. Hopefully most of your questions
will be answered by a file called CONTRIBUTE in the gdb/ subdirectory.
Could you have a look and let us know if some things are not clear?
--
Joel
[-- Attachment #2: gdb-6.8-KgdbLight.patch --]
[-- Type: application/octet-stream, Size: 49662 bytes --]
Index: gdb/remote.c
===================================================================
--- gdb/remote.c (revision 4)
+++ gdb/remote.c (working copy)
@@ -3,6 +3,7 @@
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
+ Copyright (C) 2009 Caz Yokoyama, caz at caztech dot com.
This file is part of GDB.
@@ -2595,6 +2596,7 @@
remote_open_1 (char *name, int from_tty, struct target_ops *target,
int extended_p, int async_p)
{
+ extern int debugvmlinux;
struct remote_state *rs = get_remote_state ();
if (name == 0)
error (_("To open a remote debug connection, you need to specify what\n"
@@ -2685,6 +2687,11 @@
use_threadinfo_query = 1;
use_threadextra_query = 1;
+ if (debugvmlinux) {
+ serial_send_break(remote_desc);
+ serial_write(remote_desc, "g", 1);
+ }
+
/* The first packet we send to the target is the optional "supported
packets" request. If the target can answer this, it will tell us
which later probes to skip. */
@@ -3261,14 +3268,21 @@
static void
remote_stop (void)
{
+ extern int debugkernel;
+
/* Send a break or a ^C, depending on user preference. */
if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "remote_stop called\n");
- if (remote_break)
+ if (debugkernel) {
serial_send_break (remote_desc);
- else
- serial_write (remote_desc, "\003", 1);
+ serial_write (remote_desc, "g", 1);
+ } else {
+ if (remote_break)
+ serial_send_break (remote_desc);
+ else
+ serial_write (remote_desc, "\003", 1);
+ }
}
/* Ask the user what to do when an interrupt is received. */
Index: gdb/dwarf2read.c
===================================================================
--- gdb/dwarf2read.c (revision 4)
+++ gdb/dwarf2read.c (working copy)
@@ -2,6 +2,7 @@
Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2009 Caz Yokoyama, caz at caztech dot com.
Adapted by Gary Funck (gary@intrepid.com), Intrepid Technology,
Inc. with support from Florida State University (under contract
@@ -1701,6 +1702,7 @@
struct objfile *objfile = cu->objfile;
bfd *abfd = objfile->obfd;
struct partial_die_info *pdi;
+ extern int debugvmlinux;
/* Now, march along the PDI's, descending into ones which have
interesting children but skipping the children of the other ones,
@@ -1775,6 +1777,13 @@
/* If the die has a sibling, skip to the sibling. */
pdi = pdi->die_sibling;
+
+ if (debugvmlinux) {
+ if (pdi != NULL && pdi->highpc >= 0xffffffffff000000) {
+ if (pdi->die_sibling != NULL)
+ pdi = pdi->die_sibling;
+ }
+ }
}
}
Index: gdb/ChangeLog-2009
===================================================================
--- gdb/ChangeLog-2009 (revision 0)
+++ gdb/ChangeLog-2009 (revision 12)
@@ -0,0 +1,7 @@
+2009-01-09 Caz Yokoyama <caz@caztech.com>
+
+ * remote.c send Magic SysRq, i.e. BREAK g when for kgdb light.
+ * dwarf2read.c work around for doubtfull high address in 2.6.27.8 kernel
+ * main.c set whether debugging kernel
+ * amd64-linux-tdep.c add x86_64 linux kernel OS abi
+ * solib-svr4.c read symbol tables of loadable modules.
Index: gdb/main.c
===================================================================
--- gdb/main.c (revision 4)
+++ gdb/main.c (working copy)
@@ -3,6 +3,7 @@
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
Free Software Foundation, Inc.
+ Copyright (C) 2009 Caz Yokoyama, caz at caztech dot com.
This file is part of GDB.
@@ -62,6 +63,10 @@
/* System root path, used to find libraries etc. */
char *gdb_sysroot = 0;
+/* Whether debugging a kernel */
+int debugkernel = 0;
+int debugvmlinux = 0; /* debugging vmlinx? */
+
struct ui_file *gdb_stdout;
struct ui_file *gdb_stderr;
struct ui_file *gdb_stdlog;
@@ -131,6 +136,7 @@
char *pid_or_core_arg = NULL;
char *cdarg = NULL;
char *ttyarg = NULL;
+ char *filename, *dir;
/* These are static so that we can take their address in an initializer. */
static int print_help;
@@ -679,6 +685,17 @@
quit_pre_print = error_pre_print;
warning_pre_print = _("\nwarning: ");
+ if (symarg != NULL) {
+ for (filename = symarg;
+ (dir = strchr(filename, '/')) != NULL;
+ filename = dir + 1) ;
+ /* only require the given characters to match, so that longer filenames
+ will still match */
+ if (strncmp(filename, LINUX_KERNEL_NAME_STEM,
+ strlen(LINUX_KERNEL_NAME_STEM)) == 0)
+ debugvmlinux = 1;
+ }
+
/* Read and execute $HOME/.gdbinit file, if it exists. This is done
*before* all the command line arguments are processed; it sets
global parameters, which are independent of what file you are
Index: gdb/solib-svr4.c
===================================================================
--- gdb/solib-svr4.c (revision 4)
+++ gdb/solib-svr4.c (working copy)
@@ -2,6 +2,7 @@
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
2001, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2009 Caz Yokoyama, caz at caztech dot com.
This file is part of GDB.
@@ -45,6 +46,7 @@
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
static int svr4_have_link_map_offsets (void);
+static struct so_list *kernel_current_sos (void);
/* Link map info to include in an allocated so_list entry */
@@ -90,6 +92,7 @@
#ifdef SOLIB_BKPT_NAME
SOLIB_BKPT_NAME, /* Prefer configured name if it exists. */
#endif
+ "module_event",
"_start",
"__start",
"main",
@@ -103,6 +106,113 @@
NULL
};
+/* Macro to extract an address from a solib structure. When GDB is
+ configured for some 32-bit targets (e.g. Solaris 2.7 sparc), BFD is
+ configured to handle 64-bit targets, so CORE_ADDR is 64 bits. We
+ have to extract only the significant bits of addresses to get the
+ right address when accessing the core file BFD.
+
+ Assume that the address is unsigned. */
+
+#define SOLIB_EXTRACT_ADDRESS(MEMBER) \
+ extract_unsigned_integer (&(MEMBER), sizeof (MEMBER))
+
+
+/* Kernel debugging structures */
+extern int debugkernel;
+
+struct list_head {
+ CORE_ADDR next;
+ CORE_ADDR prev;
+};
+
+#define MODULE_NAME_LEN (64 - sizeof(CORE_ADDR))
+
+#define MAX_SECTNAME 31
+
+struct mod_section {
+ CORE_ADDR address;
+ char name[MAX_SECTNAME + 1];
+};
+
+/* taken from kernel source code */
+typedef unsigned int __kernel_mode_t;
+typedef __kernel_mode_t mode_t;
+
+struct module;
+
+struct attribute {
+ const char *name;
+ struct module *owner;
+ mode_t mode;
+};
+
+struct attribute_group {
+ const char *name;
+ struct attribute **attrs;
+};
+
+struct module_attribute {
+ struct attribute attr;
+ ssize_t (*show)(struct module_attribute *, struct module *, char *);
+ ssize_t (*store)(struct module_attribute *, struct module *,
+ const char *, size_t count);
+ void (*setup)(struct module *, const char *);
+ int (*test)(struct module *);
+ void (*free)(struct module *);
+};
+
+#define MODULE_SECT_NAME_LEN 32
+struct module_sect_attr
+{
+ struct module_attribute mattr;
+ char name[MODULE_SECT_NAME_LEN];
+ unsigned long address;
+};
+
+struct module_sect_attrs
+{
+ struct attribute_group grp;
+ struct module_sect_attr attrs[0];
+};
+#define NUM_SECTIONS 1 // number of sections
+
+struct attribute_group_2_6_27 {
+ const char *name;
+ mode_t (*is_visible)();
+ struct attribute **attrs;
+};
+
+struct module_sect_attr_2_6_27
+{
+ struct module_attribute mattr;
+ char *name;
+ unsigned long address;
+};
+
+struct module_sect_attrs_2_6_27
+{
+ struct attribute_group_2_6_27 grp;
+ unsigned int nsections;
+ struct module_sect_attr_2_6_27 attrs[0];
+};
+
+struct module
+{
+ CORE_ADDR unused_state;
+ struct list_head list;
+ char name[MODULE_NAME_LEN];
+};
+
+struct kern_lm_info {
+ unsigned int nsections;
+ struct module_sect_attr module_sect_attr[0];
+};
+
+#define OFFSET(structure, field) ((CORE_ADDR)(&((struct structure *)0)->field))
+
+/* local data declarations */
+
/* link map access functions */
static CORE_ADDR
@@ -714,10 +824,18 @@
struct so_list **link_ptr = &head;
CORE_ADDR ldsomap = 0;
+ if (debugkernel)
+ {
+ return kernel_current_sos();
+ }
+
/* Always locate the debug struct, in case it has moved. */
debug_base = 0;
locate_base ();
+ /* Make sure we've looked up the inferior's dynamic linker's base
+ structure. */
+
/* If we can't find the dynamic linker's base structure, this
must not be a dynamically linked executable. Hmm. */
if (! debug_base)
@@ -1411,6 +1529,11 @@
if (!enable_break ())
return;
+ if (debugkernel)
+ {
+ solib_add (NULL, 0, NULL, 1);
+ }
+
#if defined(_SCO_DS)
/* SCO needs the loop below, other systems should be using the
special shared library breakpoints and the shared library breakpoint
@@ -1481,10 +1604,32 @@
svr4_relocate_section_addresses (struct so_list *so,
struct section_table *sec)
{
- sec->addr = svr4_truncate_ptr (sec->addr + LM_ADDR_CHECK (so,
- sec->bfd));
- sec->endaddr = svr4_truncate_ptr (sec->endaddr + LM_ADDR_CHECK (so,
- sec->bfd));
+ if (debugkernel)
+ {
+ int i;
+ struct kern_lm_info *kern_lm_info =
+ (struct kern_lm_info *)so->lm_info->lm;
+ for (i = 0; i < kern_lm_info->nsections; i++)
+ {
+ if (!strcmp(kern_lm_info->module_sect_attr[i].name,
+ sec->the_bfd_section->name))
+ {
+ CORE_ADDR sect_addr = extract_typed_address(
+ (gdb_byte *)&kern_lm_info->module_sect_attr[i].address,
+ builtin_type_void_data_ptr);
+ sec->addr = sec->addr + sect_addr;
+ sec->endaddr = sec->endaddr + sect_addr;
+ break;
+ }
+ }
+ }
+ else
+ {
+ sec->addr = svr4_truncate_ptr (sec->addr + LM_ADDR_CHECK (so,
+ sec->bfd));
+ sec->endaddr = svr4_truncate_ptr (sec->endaddr + LM_ADDR_CHECK (so,
+ sec->bfd));
+ }
}
\f
@@ -1670,4 +1815,152 @@
svr4_so_ops.in_dynsym_resolve_code = svr4_in_dynsym_resolve_code;
svr4_so_ops.lookup_lib_global_symbol = elf_lookup_lib_symbol;
svr4_so_ops.same = svr4_same;
+
+ /* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */
+ current_target_so_ops = &svr4_so_ops;
}
+
+/* Scans the list of modules in a kernel and finds out section addresses for
+ * those symbols */
+static struct so_list *kernel_current_sos(void)
+{
+ enum kversion {v2_6_18, v2_6_27};
+ short n;
+ struct expression *expr;
+ struct value *val;
+ unsigned int offset_sect_attrs;
+ enum kversion kv;
+ struct symbol *modules;
+ CORE_ADDR modlistaddr;
+ CORE_ADDR modnameaddr;
+ struct so_list *head = 0;
+ struct so_list **link_ptr = &head;
+
+ expr = parse_expression("&((struct module *)0)->sect_attrs");
+ val = evaluate_expression(expr);
+ offset_sect_attrs = val->aligner.force_longest_align;
+ expr = parse_expression("&((struct module_sect_attrs *)0)->attrs[1]");
+ val = evaluate_expression(expr);
+ if (val->aligner.force_longest_align == (int)&((struct module_sect_attrs *)0)->attrs[1]) {
+ kv = v2_6_18;
+ } else if (val->aligner.force_longest_align ==
+ (int)&((struct module_sect_attrs_2_6_27 *)0)->attrs[1]) {
+ kv = v2_6_27;
+ } else {
+ warning("struct module_sect_attrs is not the one of v2_6_18 nor v2_6_27");
+ goto nolist;
+ }
+
+ modules = lookup_symbol("modules", NULL, VAR_DOMAIN, NULL, NULL);
+ if (modules == NULL)
+ goto nolist;
+
+ /* Pointer to first module */
+ modlistaddr = read_memory_typed_address(SYMBOL_VALUE_ADDRESS(modules),
+ builtin_type_void_data_ptr);
+ while (modlistaddr != SYMBOL_VALUE_ADDRESS(modules)) {
+ struct so_list *new = (struct so_list *) xmalloc (sizeof (struct so_list));
+ struct cleanup *old_chain = make_cleanup (xfree, new);
+ char *buffer;
+ int errcode;
+ CORE_ADDR mod_struct_addr;
+ CORE_ADDR mod_addr_sections;
+ struct kern_lm_info *kern_lm_info;
+ unsigned int nsections;
+ struct module_sect_attr_2_6_27 *attr_2_6_27;
+
+ memset (new, 0, sizeof (*new));
+
+ mod_struct_addr = modlistaddr - OFFSET(module, list);
+
+ /* Read module name */
+ target_read_string(mod_struct_addr + OFFSET(module, name), &buffer,
+ MODULE_NAME_LEN, &errcode);
+ if (errcode || !strlen(buffer))
+ {
+ warning("Couldn't read module name");
+ do_cleanups (old_chain);
+ goto next_mod;
+ }
+ strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+ new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ strcpy (new->so_original_name, new->so_name);
+ new->next = 0;
+
+ new->lm_info = xmalloc(sizeof (struct lm_info));
+ make_cleanup(xfree, new->lm_info);
+
+ mod_addr_sections = read_memory_typed_address(mod_struct_addr + offset_sect_attrs,
+ builtin_type_void_data_ptr);
+ switch (kv) {
+ case v2_6_18:
+ new->lm_info->lm = xmalloc(sizeof(struct kern_lm_info) +
+ sizeof(struct module_sect_attr) *
+ NUM_SECTIONS);
+ make_cleanup(xfree, new->lm_info->lm);
+ kern_lm_info = (struct kern_lm_info *)new->lm_info->lm;
+ kern_lm_info->nsections = NUM_SECTIONS;
+ if (target_read_memory(mod_addr_sections + OFFSET(module_sect_attrs, attrs),
+ (char *)kern_lm_info->module_sect_attr,
+ sizeof(struct module_sect_attr) * NUM_SECTIONS) != 0) {
+ warning("can't read module_sects in module %s", new->so_name);
+ do_cleanups(old_chain);
+ goto next_mod;
+ }
+ if (strcmp(kern_lm_info->module_sect_attr[0].name, ".text") != 0) {
+ warning("The first section is not .text: %s", kern_lm_info->module_sect_attr[0].name);
+ do_cleanups(old_chain);
+ goto next_mod;
+ }
+ break;
+ case v2_6_27:
+ nsections = read_memory_unsigned_integer(mod_addr_sections +
+ OFFSET(module_sect_attrs_2_6_27, nsections),
+ sizeof(nsections));
+ new->lm_info->lm = xmalloc(sizeof(struct kern_lm_info) +
+ sizeof(struct module_sect_attr) *
+ nsections);
+ make_cleanup(xfree, new->lm_info->lm);
+ kern_lm_info = (struct kern_lm_info *)new->lm_info->lm;
+ attr_2_6_27 = (struct module_sect_attr_2_6_27 *)malloc(
+ sizeof(*attr_2_6_27) *
+ nsections);
+ memset(attr_2_6_27, 0, sizeof(*attr_2_6_27) * nsections);
+ if (target_read_memory(mod_addr_sections + OFFSET(module_sect_attrs_2_6_27, attrs),
+ (char *)attr_2_6_27,
+ sizeof(*attr_2_6_27) * nsections) != 0) {
+ warning("can't read attr_attr_2_6_27 in module %s for v2_6_27", new->so_name);
+ do_cleanups(old_chain);
+ goto next_mod;
+ }
+ for (n = 0; n < nsections; n++) {
+ if (target_read_memory((CORE_ADDR)attr_2_6_27[n].name,
+ kern_lm_info->module_sect_attr[n].name,
+ MODULE_SECT_NAME_LEN) != 0) {
+ warning("can't read attr_attr_2_6_27 in module %s for v2_6_27", new->so_name);
+ do_cleanups(old_chain);
+ goto next_mod;
+ }
+ kern_lm_info->module_sect_attr[n].name[MODULE_SECT_NAME_LEN - 1] = '\0';
+ kern_lm_info->module_sect_attr[n].address = attr_2_6_27[n].address;
+ }
+ kern_lm_info->nsections = nsections;
+ free(attr_2_6_27);
+ break;
+ }
+ *link_ptr = new;
+ link_ptr = &new->next;
+ if (strlen(new->so_name) <= SO_NAME_MAX_PATH_SIZE - 2) {
+ strcat(new->so_name, ".ko");
+ }
+ xfree(buffer);
+ discard_cleanups(old_chain);
+
+ next_mod:
+ modlistaddr = read_memory_typed_address(modlistaddr, builtin_type_void_data_ptr);
+ }
+ return head;
+
+ nolist:
+ return NULL;
+}
Index: gdb/ada-lang.c
===================================================================
--- gdb/ada-lang.c (revision 4)
+++ gdb/ada-lang.c (working copy)
@@ -3834,7 +3834,7 @@
/* The following is taken from the structure-return code in
call_function_by_hand. FIXME: Therefore, some refactoring seems
indicated. */
- if (gdbarch_inner_than (current_gdbarch, 1, 2))
+ if (gdbarch_inner_than(current_gdbarch, 1, 2, 0, 0))
{
/* Stack grows downward. Align SP and VALUE_ADDRESS (val) after
reserving sufficient space. */
Index: gdb/value.c
===================================================================
--- gdb/value.c (revision 4)
+++ gdb/value.c (working copy)
@@ -40,142 +40,6 @@
void _initialize_values (void);
-struct value
-{
- /* Type of value; either not an lval, or one of the various
- different possible kinds of lval. */
- enum lval_type lval;
-
- /* Is it modifiable? Only relevant if lval != not_lval. */
- int modifiable;
-
- /* Location of value (if lval). */
- union
- {
- /* If lval == lval_memory, this is the address in the inferior.
- If lval == lval_register, this is the byte offset into the
- registers structure. */
- CORE_ADDR address;
-
- /* Pointer to internal variable. */
- struct internalvar *internalvar;
- } location;
-
- /* Describes offset of a value within lval of a structure in bytes.
- If lval == lval_memory, this is an offset to the address. If
- lval == lval_register, this is a further offset from
- location.address within the registers structure. Note also the
- member embedded_offset below. */
- int offset;
-
- /* Only used for bitfields; number of bits contained in them. */
- int bitsize;
-
- /* Only used for bitfields; position of start of field. For
- gdbarch_bits_big_endian=0 targets, it is the position of the LSB. For
- gdbarch_bits_big_endian=1 targets, it is the position of the MSB. */
- int bitpos;
-
- /* Frame register value is relative to. This will be described in
- the lval enum above as "lval_register". */
- struct frame_id frame_id;
-
- /* Type of the value. */
- struct type *type;
-
- /* If a value represents a C++ object, then the `type' field gives
- the object's compile-time type. If the object actually belongs
- to some class derived from `type', perhaps with other base
- classes and additional members, then `type' is just a subobject
- of the real thing, and the full object is probably larger than
- `type' would suggest.
-
- If `type' is a dynamic class (i.e. one with a vtable), then GDB
- can actually determine the object's run-time type by looking at
- the run-time type information in the vtable. When this
- information is available, we may elect to read in the entire
- object, for several reasons:
-
- - When printing the value, the user would probably rather see the
- full object, not just the limited portion apparent from the
- compile-time type.
-
- - If `type' has virtual base classes, then even printing `type'
- alone may require reaching outside the `type' portion of the
- object to wherever the virtual base class has been stored.
-
- When we store the entire object, `enclosing_type' is the run-time
- type -- the complete object -- and `embedded_offset' is the
- offset of `type' within that larger type, in bytes. The
- value_contents() macro takes `embedded_offset' into account, so
- most GDB code continues to see the `type' portion of the value,
- just as the inferior would.
-
- If `type' is a pointer to an object, then `enclosing_type' is a
- pointer to the object's run-time type, and `pointed_to_offset' is
- the offset in bytes from the full object to the pointed-to object
- -- that is, the value `embedded_offset' would have if we followed
- the pointer and fetched the complete object. (I don't really see
- the point. Why not just determine the run-time type when you
- indirect, and avoid the special case? The contents don't matter
- until you indirect anyway.)
-
- If we're not doing anything fancy, `enclosing_type' is equal to
- `type', and `embedded_offset' is zero, so everything works
- normally. */
- struct type *enclosing_type;
- int embedded_offset;
- int pointed_to_offset;
-
- /* Values are stored in a chain, so that they can be deleted easily
- over calls to the inferior. Values assigned to internal
- variables or put into the value history are taken off this
- list. */
- struct value *next;
-
- /* Register number if the value is from a register. */
- short regnum;
-
- /* If zero, contents of this value are in the contents field. If
- nonzero, contents are in inferior memory at address in the
- location.address field plus the offset field (and the lval field
- should be lval_memory).
-
- WARNING: This field is used by the code which handles watchpoints
- (see breakpoint.c) to decide whether a particular value can be
- watched by hardware watchpoints. If the lazy flag is set for
- some member of a value chain, it is assumed that this member of
- the chain doesn't need to be watched as part of watching the
- value itself. This is how GDB avoids watching the entire struct
- or array when the user wants to watch a single struct member or
- array element. If you ever change the way lazy flag is set and
- reset, be sure to consider this use as well! */
- char lazy;
-
- /* If nonzero, this is the value of a variable which does not
- actually exist in the program. */
- char optimized_out;
-
- /* If value is a variable, is it initialized or not. */
- int initialized;
-
- /* Actual contents of the value. For use of this value; setting it
- uses the stuff above. Not valid if lazy is nonzero. Target
- byte-order. We force it to be aligned properly for any possible
- value. Note that a value therefore extends beyond what is
- declared here. */
- union
- {
- gdb_byte contents[1];
- DOUBLEST force_doublest_align;
- LONGEST force_longest_align;
- CORE_ADDR force_core_addr_align;
- void *force_pointer_align;
- } aligner;
- /* Do not add any new members here -- contents above will trash
- them. */
-};
-
/* Prototypes for local functions. */
static void show_values (char *, int);
Index: gdb/value.h
===================================================================
--- gdb/value.h (revision 4)
+++ gdb/value.h (working copy)
@@ -554,4 +554,140 @@
extern struct value *value_of_local (const char *name, int complain);
+struct value
+{
+ /* Type of value; either not an lval, or one of the various
+ different possible kinds of lval. */
+ enum lval_type lval;
+
+ /* Is it modifiable? Only relevant if lval != not_lval. */
+ int modifiable;
+
+ /* Location of value (if lval). */
+ union
+ {
+ /* If lval == lval_memory, this is the address in the inferior.
+ If lval == lval_register, this is the byte offset into the
+ registers structure. */
+ CORE_ADDR address;
+
+ /* Pointer to internal variable. */
+ struct internalvar *internalvar;
+ } location;
+
+ /* Describes offset of a value within lval of a structure in bytes.
+ If lval == lval_memory, this is an offset to the address. If
+ lval == lval_register, this is a further offset from
+ location.address within the registers structure. Note also the
+ member embedded_offset below. */
+ int offset;
+
+ /* Only used for bitfields; number of bits contained in them. */
+ int bitsize;
+
+ /* Only used for bitfields; position of start of field. For
+ gdbarch_bits_big_endian=0 targets, it is the position of the LSB. For
+ gdbarch_bits_big_endian=1 targets, it is the position of the MSB. */
+ int bitpos;
+
+ /* Frame register value is relative to. This will be described in
+ the lval enum above as "lval_register". */
+ struct frame_id frame_id;
+
+ /* Type of the value. */
+ struct type *type;
+
+ /* If a value represents a C++ object, then the `type' field gives
+ the object's compile-time type. If the object actually belongs
+ to some class derived from `type', perhaps with other base
+ classes and additional members, then `type' is just a subobject
+ of the real thing, and the full object is probably larger than
+ `type' would suggest.
+
+ If `type' is a dynamic class (i.e. one with a vtable), then GDB
+ can actually determine the object's run-time type by looking at
+ the run-time type information in the vtable. When this
+ information is available, we may elect to read in the entire
+ object, for several reasons:
+
+ - When printing the value, the user would probably rather see the
+ full object, not just the limited portion apparent from the
+ compile-time type.
+
+ - If `type' has virtual base classes, then even printing `type'
+ alone may require reaching outside the `type' portion of the
+ object to wherever the virtual base class has been stored.
+
+ When we store the entire object, `enclosing_type' is the run-time
+ type -- the complete object -- and `embedded_offset' is the
+ offset of `type' within that larger type, in bytes. The
+ value_contents() macro takes `embedded_offset' into account, so
+ most GDB code continues to see the `type' portion of the value,
+ just as the inferior would.
+
+ If `type' is a pointer to an object, then `enclosing_type' is a
+ pointer to the object's run-time type, and `pointed_to_offset' is
+ the offset in bytes from the full object to the pointed-to object
+ -- that is, the value `embedded_offset' would have if we followed
+ the pointer and fetched the complete object. (I don't really see
+ the point. Why not just determine the run-time type when you
+ indirect, and avoid the special case? The contents don't matter
+ until you indirect anyway.)
+
+ If we're not doing anything fancy, `enclosing_type' is equal to
+ `type', and `embedded_offset' is zero, so everything works
+ normally. */
+ struct type *enclosing_type;
+ int embedded_offset;
+ int pointed_to_offset;
+
+ /* Values are stored in a chain, so that they can be deleted easily
+ over calls to the inferior. Values assigned to internal
+ variables or put into the value history are taken off this
+ list. */
+ struct value *next;
+
+ /* Register number if the value is from a register. */
+ short regnum;
+
+ /* If zero, contents of this value are in the contents field. If
+ nonzero, contents are in inferior memory at address in the
+ location.address field plus the offset field (and the lval field
+ should be lval_memory).
+
+ WARNING: This field is used by the code which handles watchpoints
+ (see breakpoint.c) to decide whether a particular value can be
+ watched by hardware watchpoints. If the lazy flag is set for
+ some member of a value chain, it is assumed that this member of
+ the chain doesn't need to be watched as part of watching the
+ value itself. This is how GDB avoids watching the entire struct
+ or array when the user wants to watch a single struct member or
+ array element. If you ever change the way lazy flag is set and
+ reset, be sure to consider this use as well! */
+ char lazy;
+
+ /* If nonzero, this is the value of a variable which does not
+ actually exist in the program. */
+ char optimized_out;
+
+ /* If value is a variable, is it initialized or not. */
+ int initialized;
+
+ /* Actual contents of the value. For use of this value; setting it
+ uses the stuff above. Not valid if lazy is nonzero. Target
+ byte-order. We force it to be aligned properly for any possible
+ value. Note that a value therefore extends beyond what is
+ declared here. */
+ union
+ {
+ gdb_byte contents[1];
+ DOUBLEST force_doublest_align;
+ LONGEST force_longest_align;
+ CORE_ADDR force_core_addr_align;
+ void *force_pointer_align;
+ } aligner;
+ /* Do not add any new members here -- contents above will trash
+ them. */
+};
+
#endif /* !defined (VALUE_H) */
Index: gdb/infcall.c
===================================================================
--- gdb/infcall.c (revision 4)
+++ gdb/infcall.c (working copy)
@@ -283,7 +283,7 @@
sp = gdbarch_frame_align (gdbarch, sp);
/* Allocate space for, and then position the breakpoint on the
stack. */
- if (gdbarch_inner_than (gdbarch, 1, 2))
+ if (gdbarch_inner_than (gdbarch, 1, 2, 0, 0))
{
CORE_ADDR bppc = sp;
gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen);
@@ -407,7 +407,7 @@
address. AMD64 called that region the "red zone". Skip at
least the "red zone" size before allocating any space on
the stack. */
- if (gdbarch_inner_than (gdbarch, 1, 2))
+ if (gdbarch_inner_than (gdbarch, 1, 2, 0, 0))
sp -= gdbarch_frame_red_zone_size (gdbarch);
else
sp += gdbarch_frame_red_zone_size (gdbarch);
@@ -435,16 +435,16 @@
to pay :-). */
if (sp == old_sp)
{
- if (gdbarch_inner_than (gdbarch, 1, 2))
+ if (gdbarch_inner_than (gdbarch, 1, 2, 0, 0))
/* Stack grows down. */
sp = gdbarch_frame_align (gdbarch, old_sp - 1);
else
/* Stack grows up. */
sp = gdbarch_frame_align (gdbarch, old_sp + 1);
}
- gdb_assert ((gdbarch_inner_than (gdbarch, 1, 2)
+ gdb_assert ((gdbarch_inner_than (gdbarch, 1, 2, 0, 0)
&& sp <= old_sp)
- || (gdbarch_inner_than (gdbarch, 2, 1)
+ || (gdbarch_inner_than (gdbarch, 2, 1, 0, 0)
&& sp >= old_sp));
}
else
@@ -505,7 +505,7 @@
case ON_STACK:
/* "dummy_addr" is here just to keep old targets happy. New
targets return that same information via "sp" and "bp_addr". */
- if (gdbarch_inner_than (gdbarch, 1, 2))
+ if (gdbarch_inner_than (gdbarch, 1, 2, 0, 0))
{
sp = push_dummy_code (gdbarch, sp, funaddr,
args, nargs, target_values_type,
@@ -598,7 +598,7 @@
if (struct_return || lang_struct_return)
{
int len = TYPE_LENGTH (values_type);
- if (gdbarch_inner_than (gdbarch, 1, 2))
+ if (gdbarch_inner_than (gdbarch, 1, 2, 0, 0))
{
/* Stack grows downward. Align STRUCT_ADDR and SP after
making space for the return value. */
Index: gdb/gdbarch.c
===================================================================
--- gdb/gdbarch.c (revision 4)
+++ gdb/gdbarch.c (working copy)
@@ -542,8 +542,7 @@
/* Skip verify of return_value, has predicate */
if (gdbarch->skip_prologue == 0)
fprintf_unfiltered (log, "\n\tskip_prologue");
- if (gdbarch->inner_than == 0)
- fprintf_unfiltered (log, "\n\tinner_than");
+ /* Skip verify of inner_than */
if (gdbarch->breakpoint_from_pc == 0)
fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
/* Skip verify of adjust_breakpoint_address, has predicate */
@@ -781,6 +780,10 @@
"gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
(long) gdbarch->in_solib_return_trampoline);
fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "INNER_THAN(lhs, rhs)",
+ XSTRING (INNER_THAN (lhs, rhs, 0, 0)));
+ fprintf_unfiltered (file,
"gdbarch_dump: inner_than = <0x%lx>\n",
(long) gdbarch->inner_than);
fprintf_unfiltered (file,
@@ -2075,13 +2078,14 @@
}
int
-gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
+gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhsf, CORE_ADDR rhsf,
+ CORE_ADDR lhsc, CORE_ADDR rhsc)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->inner_than != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
- return gdbarch->inner_than (lhs, rhs);
+ return gdbarch->inner_than (lhsf, rhsf, lhsc, rhsc);
}
void
Index: gdb/gdbarch.h
===================================================================
--- gdb/gdbarch.h (revision 4)
+++ gdb/gdbarch.h (working copy)
@@ -374,8 +374,10 @@
extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip);
extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue);
-typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs);
-extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs);
+typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhsf, CORE_ADDR rhsf,
+ CORE_ADDR lhsc, CORE_ADDR rhsc);
+extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhsf,
+ CORE_ADDR rhsf, CORE_ADDR lhsc, CORE_ADDR rhsc);
extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than);
typedef const gdb_byte * (gdbarch_breakpoint_from_pc_ftype) (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
Index: gdb/amd64-linux-tdep.c
===================================================================
--- gdb/amd64-linux-tdep.c (revision 4)
+++ gdb/amd64-linux-tdep.c (working copy)
@@ -3,6 +3,7 @@
Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
+ Copyright 2004 LinSysSoft Technologies Pvt. Ltd.
This file is part of GDB.
@@ -288,6 +289,23 @@
set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map);
}
+
+static void
+amd64_linux_kernel_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ /* We can use the register offsets used for linux applications. Only
+ * first 18 elements of the array will be used for kernel. Offsets of those
+ * are identical for applications and kernel. */
+ tdep->gregset_reg_offset = amd64_linux_gregset_reg_offset;
+ tdep->gregset_num_regs = AMD64_NUM_GREGS;
+ tdep->sizeof_gregset = AMD64_NUM_GREGS * 8;
+
+ amd64_init_abi (info, gdbarch);
+
+}
+
\f
/* Provide a prototype to silence -Wmissing-prototypes. */
@@ -298,4 +316,6 @@
{
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
GDB_OSABI_LINUX, amd64_linux_init_abi);
+ gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
+ GDB_OSABI_LINUX_KERNEL, amd64_linux_kernel_init_abi);
}
Index: gdb/symfile.c
===================================================================
--- gdb/symfile.c (revision 4)
+++ gdb/symfile.c (working copy)
@@ -971,6 +971,10 @@
void
new_symfile_objfile (struct objfile *objfile, int mainline, int verbo)
{
+ char *filename;
+ struct symbol *sym;
+ char *dir;
+ extern int debugkernel;
/* If this is the main symbol file we have to clean up all users of the
old main symbol file. Otherwise it is sufficient to fixup all the
@@ -980,6 +984,17 @@
/* OK, make it the "real" symbol file. */
symfile_objfile = objfile;
+ debugkernel = 0;
+ filename = symfile_objfile->name;
+ while ((dir = strchr(filename, '/')) != NULL)
+ filename = dir + 1;
+ /* only require the given characters to match, so that longer filenames will still match */
+ if (!strncmp(filename, LINUX_KERNEL_NAME_STEM, strlen(LINUX_KERNEL_NAME_STEM)))
+ {
+ sym = lookup_symbol ("start_kernel", NULL, VAR_DOMAIN, NULL, NULL);
+ if (sym)
+ debugkernel = 1;
+ }
clear_symtab_users ();
}
else
Index: gdb/solib.c
===================================================================
--- gdb/solib.c (revision 4)
+++ gdb/solib.c (working copy)
@@ -44,6 +44,7 @@
#include "solist.h"
#include "observer.h"
#include "readline/readline.h"
+#include <glob.h>
/* Architecture-specific operations. */
@@ -78,6 +79,7 @@
\f
/* external data declarations */
+extern int debugkernel;
/* FIXME: gdbarch needs to control this variable, or else every
configuration needs to call set_solib_ops. */
@@ -102,6 +104,172 @@
value);
}
+/* Return True if the file NAME exists and is a regular file */
+static int
+is_regular_file (const char *name)
+{
+ struct stat st;
+ const int status = stat (name, &st);
+
+ /* Stat should never fail except when the file does not exist.
+ If stat fails, analyze the source of error and return True
+ unless the file does not exist, to avoid returning false results
+ on obscure systems where stat does not work as expected.
+ */
+ if (status != 0)
+ return (errno != ENOENT);
+
+ return S_ISREG (st.st_mode);
+}
+
+/* Open a file named STRING, searching path PATH (dir names sep by some char)
+ using mode MODE and protection bits PROT in the calls to open.
+
+ If TRY_CWD_FIRST, try to open ./STRING before searching PATH.
+ (ie pretend the first element of PATH is "."). This also indicates
+ that a slash in STRING disables searching of the path (this is
+ so that "exec-file ./foo" or "symbol-file ./foo" insures that you
+ get that particular version of foo or an error message).
+
+ If FILENAME_OPENED is non-null, set it to a newly allocated string naming
+ the actual file opened (this string will always start with a "/"). We
+ have to take special pains to avoid doubling the "/" between the directory
+ and the file, sigh! Emacs gets confuzzed by this when we print the
+ source file name!!!
+
+ If a file is found, return the descriptor.
+ Otherwise, return -1, with errno set for the last name we tried to open. */
+
+/* >>>> This should only allow files of certain types,
+ >>>> eg executable, non-directory */
+static int
+module_openp (const char *path, int try_cwd_first, const char *string,
+ int mode, int prot,
+ char **filename_opened)
+{
+ register int fd;
+ register char *filename;
+ const char *p;
+ const char *p1;
+ register int len;
+ int alloclen;
+ int uscount;
+ const char *fnptr;
+ char *fnptr2;
+ glob_t globbuf;
+
+ if (!path)
+ path = ".";
+
+#if defined(_WIN32) || defined(__CYGWIN__)
+ mode |= O_BINARY;
+#endif
+
+ /* ./foo => foo */
+ while (string[0] == '.' && IS_DIR_SEPARATOR (string[1]))
+ string += 2;
+
+ for (uscount = 0, fnptr = string; *fnptr; fnptr++)
+ if(*fnptr== '_')
+ uscount++;
+ alloclen = strlen (path) + strlen (string) + 2 + uscount * 4;
+ filename = alloca (alloclen);
+ fd = -1;
+ for (p = path; p; p = p1 ? p1 + 1 : 0)
+ {
+ p1 = strchr (p, DIRNAME_SEPARATOR);
+ if (p1)
+ len = p1 - p;
+ else
+ len = strlen (p);
+
+ if (len == 4 && p[0] == '$' && p[1] == 'c'
+ && p[2] == 'w' && p[3] == 'd')
+ {
+ /* Name is $cwd -- insert current directory name instead. */
+ int newlen;
+
+ /* First, realloc the filename buffer if too short. */
+ len = strlen (current_directory);
+ newlen = len + strlen (string) + 2;
+ if (newlen > alloclen)
+ {
+ alloclen = newlen;
+ filename = alloca (alloclen);
+ }
+ strcpy (filename, current_directory);
+ }
+ else
+ {
+ /* Normal file name in path -- just use it. */
+ strncpy (filename, p, len);
+ filename[len] = 0;
+ }
+
+ /* Remove trailing slashes */
+ while (len > 0 && IS_DIR_SEPARATOR (filename[len - 1]))
+ filename[--len] = 0;
+
+ strcat (filename + len, SLASH_STRING);
+ fnptr2 = filename + strlen(filename);
+ for (uscount = 0, fnptr = string; ;fnptr++)
+ {
+ if(*fnptr== '_')
+ {
+ *(fnptr2++) = '[';
+ *(fnptr2++) = '_';
+ *(fnptr2++) = '-';
+ *(fnptr2++) = ']';
+ }
+ else
+ {
+ *(fnptr2++) = *fnptr;
+ if (!*fnptr)
+ break;
+ }
+ }
+ globbuf.gl_offs = 0;
+ glob(filename, GLOB_DOOFFS, NULL, &globbuf);
+ if (!globbuf.gl_pathv[0])
+ continue;
+
+ strcpy(filename, globbuf.gl_pathv[0]);
+ if (is_regular_file (filename))
+ {
+ fd = open (filename, mode);
+ if (fd >= 0)
+ break;
+ }
+ }
+
+ if (filename_opened)
+ {
+ /* If a file was opened, canonicalize its filename. Use xfullpath
+ rather than gdb_realpath to avoid resolving the basename part
+ of filenames when the associated file is a symbolic link. This
+ fixes a potential inconsistency between the filenames known to
+ GDB and the filenames it prints in the annotations. */
+ if (fd < 0)
+ *filename_opened = NULL;
+ else if (IS_ABSOLUTE_PATH (filename))
+ *filename_opened = xfullpath (filename);
+ else
+ {
+ /* Beware the // my son, the Emacs barfs, the botch that catch... */
+
+ char *f = concat (current_directory,
+ IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])
+ ? "" : SLASH_STRING,
+ filename, NULL);
+ *filename_opened = xfullpath (f);
+ xfree (f);
+ }
+ }
+
+ return fd;
+}
+
+
/*
GLOBAL FUNCTION
@@ -201,6 +369,12 @@
if (found_file < 0 && solib_search_path != NULL)
found_file = openp (solib_search_path, OPF_TRY_CWD_FIRST,
in_pathname, O_RDONLY | O_BINARY, 0, &temp_pathname);
+
+ /* If not found and debugging a kernel, try _ and - changes */
+ if (found_file < 0 && solib_search_path != NULL && debugkernel) {
+ found_file = module_openp(solib_search_path,
+ 1, in_pathname, O_RDONLY, 0, &temp_pathname);
+ }
/* If not found, next search the solib_search_path (if any) for the basename
only (ignoring the path). This is to allow reading solibs from a path
@@ -419,7 +593,7 @@
so->sections_end);
so->objfile = symbol_file_add (so->so_name, so->from_tty,
- sap, 0, OBJF_SHARED);
+ sap, 0, OBJF_SHARED | (debugkernel ? OBJF_READNOW : 0));
free_section_addr_info (sap);
return (1);
@@ -625,6 +799,7 @@
/* Notify any observer that the shared object has been
loaded now that we've added it to GDB's tables. */
observer_notify_solib_loaded (i);
+ solib_read_symbols (i, from_tty);
}
}
}
Index: gdb/i386-linux-tdep.c
===================================================================
--- gdb/i386-linux-tdep.c (revision 4)
+++ gdb/i386-linux-tdep.c (working copy)
@@ -2,6 +2,7 @@
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
Free Software Foundation, Inc.
+ Copyright 2004 LinSysSoft Technologies Pvt. Ltd.
This file is part of GDB.
@@ -28,12 +29,15 @@
#include "reggroups.h"
#include "dwarf2-frame.h"
#include "gdb_string.h"
+#include "elf-bfd.h"
#include "i386-tdep.h"
#include "i386-linux-tdep.h"
#include "glibc-tdep.h"
#include "solib-svr4.h"
#include "symtab.h"
+#include "arch-utils.h"
+#include "gdbarch.h"
/* Return the name of register REG. */
@@ -402,6 +406,39 @@
0 * 4 /* %gs */
};
+int i386_inner_than (CORE_ADDR lhsf, CORE_ADDR rhsf, CORE_ADDR lhsc,
+ CORE_ADDR rhsc)
+{
+ /* Read code at rhsc, if it contains a stack switch instruction, return
+ * true. We check for 4 instructions.
+ * 89C4 mov eax, esp
+ * 89DC mov ebx, esp
+ * 89CC mov ecx, esp
+ * 89D4 mov edx, esp
+ * 94 xchg eax, esp
+ * 87DC xchg ebx, esp
+ * 87CC xchg ecx, esp
+ * 87D4 xchg edx, esp
+ */
+ unsigned short twobyte_insns[] = { 0x89c4, 0x89dc, 0x89cc, 0x89d4, 0x87dc,
+ 0x87dc, 0x87cc, 0x87d4 };
+ unsigned char onebyte_insns[] = { 0x94 };
+ unsigned short tmp;
+ int i;
+
+ if (rhsc &&
+ target_read_memory(rhsc, (gdb_byte *)&tmp, sizeof(unsigned short)) == 0)
+ {
+ for (i = 0; i < sizeof(onebyte_insns); i++)
+ if (onebyte_insns[i] == (unsigned char)tmp)
+ return 0;
+ for (i = 0; i < sizeof(twobyte_insns); i++)
+ if (twobyte_insns[i] == tmp)
+ return 0;
+ }
+ return core_addr_lessthan(lhsf, rhsf, lhsc, rhsc);
+}
+
static void
i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
@@ -446,8 +483,32 @@
/* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map);
+
+ /* Stack grows downward. */
+ set_gdbarch_inner_than (gdbarch, i386_inner_than);
}
+static void
+i386_linux_kernel_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ /* Linux Kernel uses ELF format for vmlinux file. */
+ i386_elf_init_abi (info, gdbarch);
+
+ /* We can use the register offsets used for linux applications. Only
+ * first 16 elements of the array will be used for kernel. Offsets of those
+ * are identical for applications and kernel. */
+ tdep->gregset_reg_offset = i386_linux_gregset_reg_offset;
+ tdep->gregset_num_regs = I386_NUM_GREGS;
+ tdep->sizeof_gregset = I386_NUM_GREGS * 4;
+
+ tdep->jb_pc_offset = 20; /* From <bits/setjmp.h>. */
+
+ /* Stack grows downward. */
+ set_gdbarch_inner_than (gdbarch, i386_inner_than);
+}
+
/* Provide a prototype to silence -Wmissing-prototypes. */
extern void _initialize_i386_linux_tdep (void);
@@ -456,4 +517,7 @@
{
gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_LINUX,
i386_linux_init_abi);
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_LINUX_KERNEL,
+ i386_linux_kernel_init_abi);
+
}
Index: gdb/frame.c
===================================================================
--- gdb/frame.c (revision 4)
+++ gdb/frame.c (working copy)
@@ -380,7 +380,8 @@
comment in "frame.h", there is some fuzz here. Frameless
functions are not strictly inner than (same .stack but
different .code and/or .special address). */
- inner = gdbarch_inner_than (gdbarch, l.stack_addr, r.stack_addr);
+ inner = gdbarch_inner_than (gdbarch, l.stack_addr, r.stack_addr,
+ l.code_addr, r.code_addr);
if (frame_debug)
{
fprintf_unfiltered (gdb_stdlog, "{ frame_id_inner (l=");
Index: gdb/arch-utils.c
===================================================================
--- gdb/arch-utils.c (revision 4)
+++ gdb/arch-utils.c (working copy)
@@ -80,9 +80,10 @@
/* Helper functions for gdbarch_inner_than */
int
-core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs)
+core_addr_lessthan (CORE_ADDR lhsf, CORE_ADDR rhsf, CORE_ADDR lhsc,
+ CORE_ADDR rhsc)
{
- return (lhs < rhs);
+ return (lhsf < rhsf);
}
int
Index: gdb/arch-utils.h
===================================================================
--- gdb/arch-utils.h (revision 4)
+++ gdb/arch-utils.h (working copy)
@@ -31,7 +31,8 @@
extern int gdbarch_debug;
/* The only possible cases for inner_than. */
-extern int core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs);
+extern int core_addr_lessthan (CORE_ADDR lhsf, CORE_ADDR rhsf,
+ CORE_ADDR lhsc, CORE_ADDR rhsc);
extern int core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs);
/* Identity functions on a CORE_ADDR. Just return the "addr". */
Index: gdb/osabi.c
===================================================================
--- gdb/osabi.c (revision 4)
+++ gdb/osabi.c (working copy)
@@ -56,6 +56,7 @@
"Solaris",
"OSF/1",
"GNU/Linux",
+ "Linux-kernel",
"FreeBSD a.out",
"FreeBSD ELF",
"NetBSD a.out",
Index: gdb/gcore.c
===================================================================
--- gdb/gcore.c (revision 4)
+++ gdb/gcore.c (working copy)
@@ -184,7 +184,8 @@
/* Save frame pointer of TOS frame. */
*top = get_frame_base (fi);
/* If current stack pointer is more "inner", use that instead. */
- if (gdbarch_inner_than (get_frame_arch (fi), get_frame_sp (fi), *top))
+ if (gdbarch_inner_than (get_frame_arch (fi), get_frame_sp (fi),
+ *top, (CORE_ADDR)NULL, (CORE_ADDR)NULL))
*top = get_frame_sp (fi);
/* Find prev-most frame. */
Index: gdb/defs.h
===================================================================
--- gdb/defs.h (revision 4)
+++ gdb/defs.h (working copy)
@@ -918,6 +918,7 @@
GDB_OSABI_SOLARIS,
GDB_OSABI_OSF1,
GDB_OSABI_LINUX,
+ GDB_OSABI_LINUX_KERNEL,
GDB_OSABI_FREEBSD_AOUT,
GDB_OSABI_FREEBSD_ELF,
GDB_OSABI_NETBSD_AOUT,
@@ -1182,6 +1183,7 @@
extern ULONGEST align_up (ULONGEST v, int n);
extern ULONGEST align_down (ULONGEST v, int n);
+#define LINUX_KERNEL_NAME_STEM "vmlinux"
/* Allocation and deallocation functions for the libiberty hash table
which use obstacks. */
^ permalink raw reply [flat|nested] 55+ messages in thread* Re: symbolic debug of loadable modules with kgdb light 2009-01-09 15:51 symbolic debug of loadable modules with kgdb light Caz Yokoyama @ 2009-04-24 15:33 ` Tom Tromey 2009-04-24 16:49 ` Caz Yokoyama ` (2 more replies) 0 siblings, 3 replies; 55+ messages in thread From: Tom Tromey @ 2009-04-24 15:33 UTC (permalink / raw) To: Caz Yokoyama; +Cc: 'Joel Brobecker', gdb-patches >>>>> "Caz" == Caz Yokoyama <cazyokoyama@gmail.com> writes: Caz> I have attached the patch against gdb-6.8. Thanks. Caz> - This patch is based on Caz> http://kgdb.cvs.sourceforge.net/viewvc/kgdb/gdb/. I removed Caz> garbage as mush as possible. But it still has the code which I Caz> don't know what it is. I don't remove copyright notice which is Caz> there. Do you have copyright assignment papers on file with the FSF? If not, let me know and I can get you started on the process. This is a requirement for getting any code into gdb. Did you write this entire patch yourself? I just want to make sure. If not, we'll need to get papers from any contributor who wrote more than 10 lines of code in the patch. Caz> - I haven't run testsuite because I could not find how to do that while I Caz> run make in testsuite directory. "make check". You need dejagnu installed. And you actually have to run a baseline check without your patch applied, then compare the results. Caz> - I believe that the code follows coding standard. Let me know if Caz> not. I noticed a number of formatting nits. These are no big deal. More importantly, the patch makes a bunch of apparently kernel-debugging-specific changes to generic code. I did not try to read it very closely, but basically all of these will need to be cleaned up. Some of the hunks we definitely do not want; e.g., moving struct value into value.h. Tom ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-04-24 15:33 ` Tom Tromey @ 2009-04-24 16:49 ` Caz Yokoyama 2009-04-26 0:39 ` Caz Yokoyama 2009-05-15 21:14 ` Caz Yokoyama 2 siblings, 0 replies; 55+ messages in thread From: Caz Yokoyama @ 2009-04-24 16:49 UTC (permalink / raw) To: tromey; +Cc: 'Joel Brobecker', gdb-patches Hello Tom, Thank you for pay attention for my patch. Have you read following discussion about this? There are 2 points my patch add to, 1) symbolic debug of loadable modules with kgdb light, 2) break-in by ^C remotely. For 1), Ruby support is integrating into gdb. By using that, it access /proc file system and incorporate a symbol table for a loadable module. Someone told me approach by Ruby is more attractive. So, my understanding of this is my modification is useless because of Ruby support. BTW, I had kept my modification against cvs source of gdb instead of 6.8. For 2), gdb emits BREAK or ^C depending when ^C is typed. On the other hand, kgdb light expects BREAK and then ^C. I introduce debugkernel. When debugkernel is true, BREAK and then ^C is emitted to target. Someone said more elegant scheme is needed instead of debugkernel. So, I lost interest. BTW, this is all of my code and less than 10 lines of code modification. -caz -----Original Message----- From: Tom Tromey [mailto:tromey@redhat.com] Sent: Friday, April 24, 2009 8:32 AM To: Caz Yokoyama Cc: 'Joel Brobecker'; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light >>>>> "Caz" == Caz Yokoyama <cazyokoyama@gmail.com> writes: Caz> I have attached the patch against gdb-6.8. Thanks. Caz> - This patch is based on Caz> http://kgdb.cvs.sourceforge.net/viewvc/kgdb/gdb/. I removed Caz> garbage as mush as possible. But it still has the code which I Caz> don't know what it is. I don't remove copyright notice which is Caz> there. Do you have copyright assignment papers on file with the FSF? If not, let me know and I can get you started on the process. This is a requirement for getting any code into gdb. Did you write this entire patch yourself? I just want to make sure. If not, we'll need to get papers from any contributor who wrote more than 10 lines of code in the patch. Caz> - I haven't run testsuite because I could not find how to do that while I Caz> run make in testsuite directory. "make check". You need dejagnu installed. And you actually have to run a baseline check without your patch applied, then compare the results. Caz> - I believe that the code follows coding standard. Let me know if Caz> not. I noticed a number of formatting nits. These are no big deal. More importantly, the patch makes a bunch of apparently kernel-debugging-specific changes to generic code. I did not try to read it very closely, but basically all of these will need to be cleaned up. Some of the hunks we definitely do not want; e.g., moving struct value into value.h. Tom ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-04-24 15:33 ` Tom Tromey 2009-04-24 16:49 ` Caz Yokoyama @ 2009-04-26 0:39 ` Caz Yokoyama 2009-05-15 21:14 ` Caz Yokoyama 2 siblings, 0 replies; 55+ messages in thread From: Caz Yokoyama @ 2009-04-26 0:39 UTC (permalink / raw) To: tromey; +Cc: 'Joel Brobecker', gdb-patches Correction kgdb light expects BREAK and then ^C. --------- kgdb light expects BREAK and then g. -caz -----Original Message----- From: Caz Yokoyama [mailto:caz@caztech.com] Sent: Friday, April 24, 2009 9:48 AM To: 'tromey@redhat.com' Cc: 'Joel Brobecker'; 'gdb-patches@sourceware.org' Subject: RE: symbolic debug of loadable modules with kgdb light Hello Tom, Thank you for pay attention for my patch. Have you read following discussion about this? There are 2 points my patch add to, 1) symbolic debug of loadable modules with kgdb light, 2) break-in by ^C remotely. For 1), Ruby support is integrating into gdb. By using that, it access /proc file system and incorporate a symbol table for a loadable module. Someone told me approach by Ruby is more attractive. So, my understanding of this is my modification is useless because of Ruby support. BTW, I had kept my modification against cvs source of gdb instead of 6.8. For 2), gdb emits BREAK or ^C depending when ^C is typed. On the other hand, kgdb light expects BREAK and then ^C. I introduce debugkernel. When debugkernel is true, BREAK and then ^C is emitted to target. Someone said more elegant scheme is needed instead of debugkernel. So, I lost interest. BTW, this is all of my code and less than 10 lines of code modification. -caz -----Original Message----- From: Tom Tromey [mailto:tromey@redhat.com] Sent: Friday, April 24, 2009 8:32 AM To: Caz Yokoyama Cc: 'Joel Brobecker'; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light >>>>> "Caz" == Caz Yokoyama <cazyokoyama@gmail.com> writes: Caz> I have attached the patch against gdb-6.8. Thanks. Caz> - This patch is based on Caz> http://kgdb.cvs.sourceforge.net/viewvc/kgdb/gdb/. I removed Caz> garbage as mush as possible. But it still has the code which I Caz> don't know what it is. I don't remove copyright notice which is Caz> there. Do you have copyright assignment papers on file with the FSF? If not, let me know and I can get you started on the process. This is a requirement for getting any code into gdb. Did you write this entire patch yourself? I just want to make sure. If not, we'll need to get papers from any contributor who wrote more than 10 lines of code in the patch. Caz> - I haven't run testsuite because I could not find how to do that while I Caz> run make in testsuite directory. "make check". You need dejagnu installed. And you actually have to run a baseline check without your patch applied, then compare the results. Caz> - I believe that the code follows coding standard. Let me know if Caz> not. I noticed a number of formatting nits. These are no big deal. More importantly, the patch makes a bunch of apparently kernel-debugging-specific changes to generic code. I did not try to read it very closely, but basically all of these will need to be cleaned up. Some of the hunks we definitely do not want; e.g., moving struct value into value.h. Tom ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-04-24 15:33 ` Tom Tromey 2009-04-24 16:49 ` Caz Yokoyama 2009-04-26 0:39 ` Caz Yokoyama @ 2009-05-15 21:14 ` Caz Yokoyama 2009-05-15 21:23 ` Pedro Alves 2 siblings, 1 reply; 55+ messages in thread From: Caz Yokoyama @ 2009-05-15 21:14 UTC (permalink / raw) To: tromey; +Cc: 'Joel Brobecker', gdb-patches Hello Tom, Here is the patch for 2) which enables "break-in Linux kernel 2.6.26 and later which kgdb is enabled. When linux-kgdb is set (i.e. not 0), gdb sends BREAK and g when gdb is started and when ^C is typed on gdb. gdb/main.c - define linux_kgdb gdb/remote.c - sends BREAK and g when gdb is started and when ^C is tyed on gdb. All these modification comes from me. Index: gdb/main.c =================================================================== RCS file: /cvs/src/src/gdb/main.c,v retrieving revision 1.76 diff -p -r1.76 main.c *** gdb/main.c 27 Apr 2009 10:24:08 -0000 1.76 --- gdb/main.c 14 May 2009 17:00:05 -0000 *************** char *gdb_sysroot = 0; *** 67,72 **** --- 67,75 ---- /* GDB datadir, used to store data files. */ char *gdb_datadir = 0; + /* Whether debugging Linux kernel by using its kgdb */ int linux_kgdb + = 0; + struct ui_file *gdb_stdout; struct ui_file *gdb_stderr; struct ui_file *gdb_stdlog; Index: gdb/remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.354 diff -p -r1.354 remote.c *** gdb/remote.c 16 Apr 2009 19:31:03 -0000 1.354 --- gdb/remote.c 14 May 2009 17:00:08 -0000 *************** static struct cmd_list_element *remote_c *** 239,244 **** --- 239,246 ---- static struct cmd_list_element *remote_set_cmdlist; static struct cmd_list_element *remote_show_cmdlist; + extern int linux_kgdb; + /* Description of the remote protocol state for the currently connected target. This is per-target state, and independent of the selected architecture. */ *************** remote_start_remote (struct ui_out *uiou *** 2606,2611 **** --- 2608,2618 ---- /* Ack any packet which the remote side has already sent. */ serial_write (remote_desc, "+", 1); + if (linux_kgdb) { + serial_send_break(remote_desc); + serial_write(remote_desc, "g", 1); + } + /* The first packet we send to the target is the optional "supported packets" request. If the target can answer this, it will tell us which later probes to skip. */ *************** remote_stop_as (ptid_t ptid) *** 4020,4029 **** /* Send a break or a ^C, depending on user preference. */ ! if (remote_break) serial_send_break (remote_desc); ! else ! serial_write (remote_desc, "\003", 1); } /* This is the generic stop called via the target vector. When a target --- 4027,4041 ---- /* Send a break or a ^C, depending on user preference. */ ! if (linux_kgdb) { serial_send_break (remote_desc); ! serial_write (remote_desc, "g", 1); ! } else { ! if (remote_break) ! serial_send_break (remote_desc); ! else ! serial_write (remote_desc, "\003", 1); ! } } /* This is the generic stop called via the target vector. When a target *************** If set, a break, instead of a cntrl-c, i *** 9063,9068 **** --- 9075,9087 ---- NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is %s. */ &setlist, &showlist); + add_setshow_boolean_cmd ("linux-kgdb", no_class, &linux_kgdb, _("\ + Set whether Linux kernel is debugged by using kgdb."), _("\ Show + whether Linux kernel is debugged by using kgdb."), _("\ If set, send a + break and g to the remote target to break-in."), + NULL, NULL, + &setlist, &showlist); + /* Install commands for configuring memory read/write packets. */ add_cmd ("remotewritesize", no_class, set_memory_write_packet_size, _("\ I am working for a patch for 1). -caz -----Original Message----- From: Caz Yokoyama [mailto:caz@caztech.com] Sent: Saturday, April 25, 2009 5:36 PM To: 'tromey@redhat.com' Cc: 'Joel Brobecker'; 'gdb-patches@sourceware.org' Subject: RE: symbolic debug of loadable modules with kgdb light Correction kgdb light expects BREAK and then ^C. --------- kgdb light expects BREAK and then g. -caz -----Original Message----- From: Caz Yokoyama [mailto:caz@caztech.com] Sent: Friday, April 24, 2009 9:48 AM To: 'tromey@redhat.com' Cc: 'Joel Brobecker'; 'gdb-patches@sourceware.org' Subject: RE: symbolic debug of loadable modules with kgdb light Hello Tom, Thank you for pay attention for my patch. Have you read following discussion about this? There are 2 points my patch add to, 1) symbolic debug of loadable modules with kgdb light, 2) break-in by ^C remotely. For 1), Ruby support is integrating into gdb. By using that, it access /proc file system and incorporate a symbol table for a loadable module. Someone told me approach by Ruby is more attractive. So, my understanding of this is my modification is useless because of Ruby support. BTW, I had kept my modification against cvs source of gdb instead of 6.8. For 2), gdb emits BREAK or ^C depending when ^C is typed. On the other hand, kgdb light expects BREAK and then ^C. I introduce debugkernel. When debugkernel is true, BREAK and then ^C is emitted to target. Someone said more elegant scheme is needed instead of debugkernel. So, I lost interest. BTW, this is all of my code and less than 10 lines of code modification. -caz -----Original Message----- From: Tom Tromey [mailto:tromey@redhat.com] Sent: Friday, April 24, 2009 8:32 AM To: Caz Yokoyama Cc: 'Joel Brobecker'; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light >>>>> "Caz" == Caz Yokoyama <cazyokoyama@gmail.com> writes: Caz> I have attached the patch against gdb-6.8. Thanks. Caz> - This patch is based on Caz> http://kgdb.cvs.sourceforge.net/viewvc/kgdb/gdb/. I removed Caz> garbage as mush as possible. But it still has the code which I Caz> don't know what it is. I don't remove copyright notice which is Caz> there. Do you have copyright assignment papers on file with the FSF? If not, let me know and I can get you started on the process. This is a requirement for getting any code into gdb. Did you write this entire patch yourself? I just want to make sure. If not, we'll need to get papers from any contributor who wrote more than 10 lines of code in the patch. Caz> - I haven't run testsuite because I could not find how to do that while I Caz> run make in testsuite directory. "make check". You need dejagnu installed. And you actually have to run a baseline check without your patch applied, then compare the results. Caz> - I believe that the code follows coding standard. Let me know if Caz> not. I noticed a number of formatting nits. These are no big deal. More importantly, the patch makes a bunch of apparently kernel-debugging-specific changes to generic code. I did not try to read it very closely, but basically all of these will need to be cleaned up. Some of the hunks we definitely do not want; e.g., moving struct value into value.h. Tom ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-05-15 21:14 ` Caz Yokoyama @ 2009-05-15 21:23 ` Pedro Alves 2009-05-15 21:34 ` Daniel Jacobowitz 2009-05-15 21:34 ` Caz Yokoyama 0 siblings, 2 replies; 55+ messages in thread From: Pedro Alves @ 2009-05-15 21:23 UTC (permalink / raw) To: gdb-patches; +Cc: Caz Yokoyama, tromey, 'Joel Brobecker' Sounds like you need to fix kgdb instead. Why would it need a 'g' on connection? On Friday 15 May 2009 22:15:31, Caz Yokoyama wrote: > Hello Tom, > Here is the patch for 2) which enables "break-in Linux kernel 2.6.26 and > later which kgdb is enabled. When linux-kgdb is set (i.e. not 0), gdb sends > BREAK and g when gdb is started and when ^C is typed on gdb. > > gdb/main.c - define linux_kgdb > gdb/remote.c - sends BREAK and g when gdb is started and when ^C is tyed on > gdb. > > All these modification comes from me. > > Index: gdb/main.c > =================================================================== > RCS file: /cvs/src/src/gdb/main.c,v > retrieving revision 1.76 > diff -p -r1.76 main.c > *** gdb/main.c 27 Apr 2009 10:24:08 -0000 1.76 > --- gdb/main.c 14 May 2009 17:00:05 -0000 > *************** char *gdb_sysroot = 0; > *** 67,72 **** > --- 67,75 ---- > /* GDB datadir, used to store data files. */ > char *gdb_datadir = 0; > > + /* Whether debugging Linux kernel by using its kgdb */ int linux_kgdb > + = 0; > + > struct ui_file *gdb_stdout; > struct ui_file *gdb_stderr; > struct ui_file *gdb_stdlog; > Index: gdb/remote.c > =================================================================== > RCS file: /cvs/src/src/gdb/remote.c,v > retrieving revision 1.354 > diff -p -r1.354 remote.c > *** gdb/remote.c 16 Apr 2009 19:31:03 -0000 1.354 > --- gdb/remote.c 14 May 2009 17:00:08 -0000 > *************** static struct cmd_list_element *remote_c > *** 239,244 **** > --- 239,246 ---- > static struct cmd_list_element *remote_set_cmdlist; > static struct cmd_list_element *remote_show_cmdlist; > > + extern int linux_kgdb; > + > /* Description of the remote protocol state for the currently > connected target. This is per-target state, and independent of the > selected architecture. */ > *************** remote_start_remote (struct ui_out *uiou > *** 2606,2611 **** > --- 2608,2618 ---- > /* Ack any packet which the remote side has already sent. */ > serial_write (remote_desc, "+", 1); > > + if (linux_kgdb) { > + serial_send_break(remote_desc); > + serial_write(remote_desc, "g", 1); > + } > + > /* The first packet we send to the target is the optional "supported > packets" request. If the target can answer this, it will tell us > which later probes to skip. */ > *************** remote_stop_as (ptid_t ptid) > *** 4020,4029 **** > > /* Send a break or a ^C, depending on user preference. */ > > ! if (remote_break) > serial_send_break (remote_desc); > ! else > ! serial_write (remote_desc, "\003", 1); > } > > /* This is the generic stop called via the target vector. When a target > --- 4027,4041 ---- > > /* Send a break or a ^C, depending on user preference. */ > > ! if (linux_kgdb) { > serial_send_break (remote_desc); > ! serial_write (remote_desc, "g", 1); > ! } else { > ! if (remote_break) > ! serial_send_break (remote_desc); > ! else > ! serial_write (remote_desc, "\003", 1); > ! } > } > > /* This is the generic stop called via the target vector. When a target > *************** If set, a break, instead of a cntrl-c, i > *** 9063,9068 **** > --- 9075,9087 ---- > NULL, NULL, /* FIXME: i18n: Whether to send break > if interrupted is %s. */ > &setlist, &showlist); > > + add_setshow_boolean_cmd ("linux-kgdb", no_class, &linux_kgdb, _("\ > + Set whether Linux kernel is debugged by using kgdb."), _("\ Show > + whether Linux kernel is debugged by using kgdb."), _("\ If set, send a > + break and g to the remote target to break-in."), > + NULL, NULL, > + &setlist, &showlist); > + > /* Install commands for configuring memory read/write packets. */ > > add_cmd ("remotewritesize", no_class, set_memory_write_packet_size, _("\ > > I am working for a patch for 1). > -caz > > -----Original Message----- > From: Caz Yokoyama [mailto:caz@caztech.com] > Sent: Saturday, April 25, 2009 5:36 PM > To: 'tromey@redhat.com' > Cc: 'Joel Brobecker'; 'gdb-patches@sourceware.org' > Subject: RE: symbolic debug of loadable modules with kgdb light > > Correction > kgdb light expects BREAK and then ^C. > --------- > kgdb light expects BREAK and then g. > -caz > > -----Original Message----- > From: Caz Yokoyama [mailto:caz@caztech.com] > Sent: Friday, April 24, 2009 9:48 AM > To: 'tromey@redhat.com' > Cc: 'Joel Brobecker'; 'gdb-patches@sourceware.org' > Subject: RE: symbolic debug of loadable modules with kgdb light > > Hello Tom, > Thank you for pay attention for my patch. > Have you read following discussion about this? There are 2 points my patch > add to, 1) symbolic debug of loadable modules with kgdb light, 2) break-in > by ^C remotely. For 1), Ruby support is integrating into gdb. By using that, > it access /proc file system and incorporate a symbol table for a loadable > module. Someone told me approach by Ruby is more attractive. So, my > understanding of this is my modification is useless because of Ruby support. > BTW, I had kept my modification against cvs source of gdb instead of 6.8. > > For 2), gdb emits BREAK or ^C depending when ^C is typed. On the other hand, > kgdb light expects BREAK and then ^C. I introduce debugkernel. When > debugkernel is true, BREAK and then ^C is emitted to target. Someone said > more elegant scheme is needed instead of debugkernel. So, I lost interest. > BTW, this is all of my code and less than 10 lines of code modification. > -caz > > -----Original Message----- > From: Tom Tromey [mailto:tromey@redhat.com] > Sent: Friday, April 24, 2009 8:32 AM > To: Caz Yokoyama > Cc: 'Joel Brobecker'; gdb-patches@sourceware.org > Subject: Re: symbolic debug of loadable modules with kgdb light > > >>>>> "Caz" == Caz Yokoyama <cazyokoyama@gmail.com> writes: > > Caz> I have attached the patch against gdb-6.8. > > Thanks. > > Caz> - This patch is based on > Caz> http://kgdb.cvs.sourceforge.net/viewvc/kgdb/gdb/. I removed > Caz> garbage as mush as possible. But it still has the code which I > Caz> don't know what it is. I don't remove copyright notice which is > Caz> there. > > Do you have copyright assignment papers on file with the FSF? If not, > let me know and I can get you started on the process. This is a > requirement for getting any code into gdb. > > Did you write this entire patch yourself? I just want to make sure. > If not, we'll need to get papers from any contributor who wrote more > than 10 lines of code in the patch. > > Caz> - I haven't run testsuite because I could not find how to do that while > I > Caz> run make in testsuite directory. > > "make check". You need dejagnu installed. And you actually have to > run a baseline check without your patch applied, then compare the > results. > > Caz> - I believe that the code follows coding standard. Let me know if > Caz> not. > > I noticed a number of formatting nits. These are no big deal. > > More importantly, the patch makes a bunch of apparently > kernel-debugging-specific changes to generic code. I did not try to > read it very closely, but basically all of these will need to be cleaned > up. Some of the hunks we definitely do not want; e.g., moving > struct value into value.h. > > Tom > > -- Pedro Alves ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-05-15 21:23 ` Pedro Alves @ 2009-05-15 21:34 ` Daniel Jacobowitz 2009-05-15 21:41 ` Caz Yokoyama 2009-05-15 21:34 ` Caz Yokoyama 1 sibling, 1 reply; 55+ messages in thread From: Daniel Jacobowitz @ 2009-05-15 21:34 UTC (permalink / raw) To: Pedro Alves; +Cc: gdb-patches, Caz Yokoyama, tromey, 'Joel Brobecker' On Fri, May 15, 2009 at 10:23:57PM +0100, Pedro Alves wrote: > Sounds like you need to fix kgdb instead. Why would it need > a 'g' on connection? BREAK on a serial (or network maybe?) console is magic sysrq; this is sysrq-g, probably for debuG. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-05-15 21:34 ` Daniel Jacobowitz @ 2009-05-15 21:41 ` Caz Yokoyama 2009-05-15 22:13 ` Michael Snyder 0 siblings, 1 reply; 55+ messages in thread From: Caz Yokoyama @ 2009-05-15 21:41 UTC (permalink / raw) To: 'Daniel Jacobowitz', 'Pedro Alves' Cc: gdb-patches, tromey, 'Joel Brobecker' Yes, that is correct. -caz -----Original Message----- From: Daniel Jacobowitz [mailto:drow@false.org] Sent: Friday, May 15, 2009 2:34 PM To: Pedro Alves Cc: gdb-patches@sourceware.org; Caz Yokoyama; tromey@redhat.com; 'Joel Brobecker' Subject: Re: symbolic debug of loadable modules with kgdb light On Fri, May 15, 2009 at 10:23:57PM +0100, Pedro Alves wrote: > Sounds like you need to fix kgdb instead. Why would it need > a 'g' on connection? BREAK on a serial (or network maybe?) console is magic sysrq; this is sysrq-g, probably for debuG. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-05-15 21:41 ` Caz Yokoyama @ 2009-05-15 22:13 ` Michael Snyder 2009-05-15 22:25 ` Caz Yokoyama 2009-08-07 7:17 ` Caz Yokoyama 0 siblings, 2 replies; 55+ messages in thread From: Michael Snyder @ 2009-05-15 22:13 UTC (permalink / raw) To: Caz Yokoyama Cc: 'Daniel Jacobowitz', 'Pedro Alves', gdb-patches, tromey, 'Joel Brobecker' I think we need a generic way to send a BREAK (whatever that may mean) to the target from the command line. Like maybe a "BREAK" command. Caz Yokoyama wrote: > Yes, that is correct. > -caz > -----Original Message----- > From: Daniel Jacobowitz [mailto:drow@false.org] > Sent: Friday, May 15, 2009 2:34 PM > To: Pedro Alves > Cc: gdb-patches@sourceware.org; Caz Yokoyama; tromey@redhat.com; 'Joel > Brobecker' > Subject: Re: symbolic debug of loadable modules with kgdb light > > On Fri, May 15, 2009 at 10:23:57PM +0100, Pedro Alves wrote: >> Sounds like you need to fix kgdb instead. Why would it need >> a 'g' on connection? > > BREAK on a serial (or network maybe?) console is magic sysrq; this is > sysrq-g, probably for debuG. > ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-05-15 22:13 ` Michael Snyder @ 2009-05-15 22:25 ` Caz Yokoyama 2009-08-07 7:17 ` Caz Yokoyama 1 sibling, 0 replies; 55+ messages in thread From: Caz Yokoyama @ 2009-05-15 22:25 UTC (permalink / raw) To: 'Michael Snyder' Cc: 'Daniel Jacobowitz', 'Pedro Alves', gdb-patches, tromey, 'Joel Brobecker' I have no objection regarding generic way of sending a BREAK. However, I had two reasons to introduce linux-kgdb. 1) Someone suggested me the same several months ago. Nobody implemented. 2) I need some way to specify debugging linux kernel by using kgdb for symbolic debug of loadable modules. -caz -----Original Message----- From: Michael Snyder [mailto:msnyder@vmware.com] Sent: Friday, May 15, 2009 3:14 PM To: Caz Yokoyama Cc: 'Daniel Jacobowitz'; 'Pedro Alves'; gdb-patches@sourceware.org; tromey@redhat.com; 'Joel Brobecker' Subject: Re: symbolic debug of loadable modules with kgdb light I think we need a generic way to send a BREAK (whatever that may mean) to the target from the command line. Like maybe a "BREAK" command. Caz Yokoyama wrote: > Yes, that is correct. > -caz > -----Original Message----- > From: Daniel Jacobowitz [mailto:drow@false.org] > Sent: Friday, May 15, 2009 2:34 PM > To: Pedro Alves > Cc: gdb-patches@sourceware.org; Caz Yokoyama; tromey@redhat.com; 'Joel > Brobecker' > Subject: Re: symbolic debug of loadable modules with kgdb light > > On Fri, May 15, 2009 at 10:23:57PM +0100, Pedro Alves wrote: >> Sounds like you need to fix kgdb instead. Why would it need >> a 'g' on connection? > > BREAK on a serial (or network maybe?) console is magic sysrq; this is > sysrq-g, probably for debuG. > ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-05-15 22:13 ` Michael Snyder 2009-05-15 22:25 ` Caz Yokoyama @ 2009-08-07 7:17 ` Caz Yokoyama 2009-08-07 9:22 ` Eli Zaretskii 2009-09-23 0:48 ` Joel Brobecker 1 sibling, 2 replies; 55+ messages in thread From: Caz Yokoyama @ 2009-08-07 7:17 UTC (permalink / raw) To: 'Michael Snyder' Cc: 'Daniel Jacobowitz', 'Pedro Alves', gdb-patches, tromey, 'Joel Brobecker' [-- Attachment #1: Type: text/plain, Size: 6137 bytes --] This patch generalizes remotebreak. It becomes an enum string from a Boolean. It may be "Ctrl-C", "BREAK" or "BREAK-g". When it is "BREAK-g", gdb also sends BREAK g to connect to Linux kernel when it starts. Index: gdb/remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.366 diff -c -r1.366 remote.c *** gdb/remote.c 31 Jul 2009 22:15:15 -0000 1.366 --- gdb/remote.c 7 Aug 2009 03:50:30 -0000 *************** *** 546,558 **** this can go away. */ static int wait_forever_enabled_p = 1; ! /* This variable chooses whether to send a ^C or a break when the user ! requests program interruption. Although ^C is usually what remote ! systems expect, and that is the default here, sometimes a break is ! preferable instead. */ ! ! static int remote_break; /* Descriptor for I/O to remote machine. Initialize it to NULL so that remote_open knows that we don't have a file open when the program --- 546,575 ---- this can go away. */ static int wait_forever_enabled_p = 1; + /* This variable chooses whether to send a ^C, a break or a break g + when the user requests program interruption. + Although ^C is usually what remote systems expect, + and that is the default here, sometimes a break is + preferable instead. For interrupting Linux kernel, a break and g is + expected which is Magic SysReq g. */ + const char bs_Crtl_C[] = "Ctrl-C"; + const char bs_BREAK[] = "BREAK"; + const char bs_BREAK_g[] = "BREAK-g"; + static const char *remotebreak_enum[] = { + bs_Crtl_C, + bs_BREAK, + bs_BREAK_g, + NULL + }; + const char *remotebreak_string = bs_Crtl_C; ! static void show_remotebreak(struct ui_file *file, int from_tty, ! struct cmd_list_element *c, ! const char *value) ! { ! fprintf_unfiltered (file, "remote systems expect %s to be interrupted\n", ! remotebreak_string); ! } /* Descriptor for I/O to remote machine. Initialize it to NULL so that remote_open knows that we don't have a file open when the program *************** *** 2601,2606 **** --- 2618,2629 ---- /* Ack any packet which the remote side has already sent. */ serial_write (remote_desc, "+", 1); + /* send break sequence on debugging Linux kernel */ + if (remotebreak_string == bs_BREAK_g) { + serial_send_break (remote_desc); + serial_write (remote_desc, "g", 1); + } + /* The first packet we send to the target is the optional "supported packets" request. If the target can answer this, it will tell us which later probes to skip. */ *************** *** 4011,4022 **** if (rs->cached_wait_status) return; ! /* Send a break or a ^C, depending on user preference. */ ! ! if (remote_break) serial_send_break (remote_desc); ! else ! serial_write (remote_desc, "\003", 1); } /* This is the generic stop called via the target vector. When a target --- 4034,4048 ---- if (rs->cached_wait_status) return; ! /* Send ^C, a break or a break g, depending on user preference. */ ! if (remotebreak_string == bs_Crtl_C) { ! serial_write (remote_desc, "\003", 1); ! } else if (remotebreak_string == bs_BREAK) { ! serial_send_break (remote_desc); ! } else if (remotebreak_string == bs_BREAK_g) { serial_send_break (remote_desc); ! serial_write (remote_desc, "g", 1); ! } } /* This is the generic stop called via the target vector. When a target *************** *** 9051,9062 **** terminating `#' character and checksum."), &maintenancelist); ! add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ ! Set whether to send break if interrupted."), _("\ ! Show whether to send break if interrupted."), _("\ ! If set, a break, instead of a cntrl-c, is sent to the remote target."), ! NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is %s. */ ! &setlist, &showlist); /* Install commands for configuring memory read/write packets. */ --- 9077,9088 ---- terminating `#' character and checksum."), &maintenancelist); ! add_setshow_enum_cmd ("remotebreak", class_support, ! remotebreak_enum, &remotebreak_string, _("\ ! Set remote break sequence."), _("\ ! Show remote break sequence."), NULL, ! NULL, show_remotebreak, ! &setlist, &showlist); /* Install commands for configuring memory read/write packets. */ -caz -----Original Message----- From: Caz Yokoyama [mailto:caz@caztech.com] Sent: Friday, May 15, 2009 3:26 PM To: 'Michael Snyder' Cc: 'Daniel Jacobowitz'; 'Pedro Alves'; 'gdb-patches@sourceware.org'; 'tromey@redhat.com'; 'Joel Brobecker' Subject: RE: symbolic debug of loadable modules with kgdb light I have no objection regarding generic way of sending a BREAK. However, I had two reasons to introduce linux-kgdb. 1) Someone suggested me the same several months ago. Nobody implemented. 2) I need some way to specify debugging linux kernel by using kgdb for symbolic debug of loadable modules. -caz -----Original Message----- From: Michael Snyder [mailto:msnyder@vmware.com] Sent: Friday, May 15, 2009 3:14 PM To: Caz Yokoyama Cc: 'Daniel Jacobowitz'; 'Pedro Alves'; gdb-patches@sourceware.org; tromey@redhat.com; 'Joel Brobecker' Subject: Re: symbolic debug of loadable modules with kgdb light I think we need a generic way to send a BREAK (whatever that may mean) to the target from the command line. Like maybe a "BREAK" command. Caz Yokoyama wrote: > Yes, that is correct. > -caz > -----Original Message----- > From: Daniel Jacobowitz [mailto:drow@false.org] > Sent: Friday, May 15, 2009 2:34 PM > To: Pedro Alves > Cc: gdb-patches@sourceware.org; Caz Yokoyama; tromey@redhat.com; 'Joel > Brobecker' > Subject: Re: symbolic debug of loadable modules with kgdb light > > On Fri, May 15, 2009 at 10:23:57PM +0100, Pedro Alves wrote: >> Sounds like you need to fix kgdb instead. Why would it need >> a 'g' on connection? > > BREAK on a serial (or network maybe?) console is magic sysrq; this is > sysrq-g, probably for debuG. > [-- Attachment #2: remotebreak.patch --] [-- Type: application/octet-stream, Size: 4407 bytes --] Index: gdb/remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.366 diff -c -r1.366 remote.c *** gdb/remote.c 31 Jul 2009 22:15:15 -0000 1.366 --- gdb/remote.c 7 Aug 2009 03:50:30 -0000 *************** *** 546,558 **** this can go away. */ static int wait_forever_enabled_p = 1; ! /* This variable chooses whether to send a ^C or a break when the user ! requests program interruption. Although ^C is usually what remote ! systems expect, and that is the default here, sometimes a break is ! preferable instead. */ ! ! static int remote_break; /* Descriptor for I/O to remote machine. Initialize it to NULL so that remote_open knows that we don't have a file open when the program --- 546,575 ---- this can go away. */ static int wait_forever_enabled_p = 1; + /* This variable chooses whether to send a ^C, a break or a break g + when the user requests program interruption. + Although ^C is usually what remote systems expect, + and that is the default here, sometimes a break is + preferable instead. For interrupting Linux kernel, a break and g is + expected which is Magic SysReq g. */ + const char bs_Crtl_C[] = "Ctrl-C"; + const char bs_BREAK[] = "BREAK"; + const char bs_BREAK_g[] = "BREAK-g"; + static const char *remotebreak_enum[] = { + bs_Crtl_C, + bs_BREAK, + bs_BREAK_g, + NULL + }; + const char *remotebreak_string = bs_Crtl_C; ! static void show_remotebreak(struct ui_file *file, int from_tty, ! struct cmd_list_element *c, ! const char *value) ! { ! fprintf_unfiltered (file, "remote systems expect %s to be interrupted\n", ! remotebreak_string); ! } /* Descriptor for I/O to remote machine. Initialize it to NULL so that remote_open knows that we don't have a file open when the program *************** *** 2601,2606 **** --- 2618,2629 ---- /* Ack any packet which the remote side has already sent. */ serial_write (remote_desc, "+", 1); + /* send break sequence on debugging Linux kernel */ + if (remotebreak_string == bs_BREAK_g) { + serial_send_break (remote_desc); + serial_write (remote_desc, "g", 1); + } + /* The first packet we send to the target is the optional "supported packets" request. If the target can answer this, it will tell us which later probes to skip. */ *************** *** 4011,4022 **** if (rs->cached_wait_status) return; ! /* Send a break or a ^C, depending on user preference. */ ! ! if (remote_break) serial_send_break (remote_desc); ! else ! serial_write (remote_desc, "\003", 1); } /* This is the generic stop called via the target vector. When a target --- 4034,4048 ---- if (rs->cached_wait_status) return; ! /* Send ^C, a break or a break g, depending on user preference. */ ! if (remotebreak_string == bs_Crtl_C) { ! serial_write (remote_desc, "\003", 1); ! } else if (remotebreak_string == bs_BREAK) { ! serial_send_break (remote_desc); ! } else if (remotebreak_string == bs_BREAK_g) { serial_send_break (remote_desc); ! serial_write (remote_desc, "g", 1); ! } } /* This is the generic stop called via the target vector. When a target *************** *** 9051,9062 **** terminating `#' character and checksum."), &maintenancelist); ! add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ ! Set whether to send break if interrupted."), _("\ ! Show whether to send break if interrupted."), _("\ ! If set, a break, instead of a cntrl-c, is sent to the remote target."), ! NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is %s. */ ! &setlist, &showlist); /* Install commands for configuring memory read/write packets. */ --- 9077,9088 ---- terminating `#' character and checksum."), &maintenancelist); ! add_setshow_enum_cmd ("remotebreak", class_support, ! remotebreak_enum, &remotebreak_string, _("\ ! Set remote break sequence."), _("\ ! Show remote break sequence."), NULL, ! NULL, show_remotebreak, ! &setlist, &showlist); /* Install commands for configuring memory read/write packets. */ ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-08-07 7:17 ` Caz Yokoyama @ 2009-08-07 9:22 ` Eli Zaretskii 2009-08-07 20:42 ` Caz Yokoyama 2009-09-23 0:48 ` Joel Brobecker 1 sibling, 1 reply; 55+ messages in thread From: Eli Zaretskii @ 2009-08-07 9:22 UTC (permalink / raw) To: Caz Yokoyama; +Cc: msnyder, drow, pedro, gdb-patches, tromey, brobecker > From: Caz Yokoyama <cazyokoyama@gmail.com> > Cc: "'Daniel Jacobowitz'" <drow@false.org>, "'Pedro Alves'" <pedro@codesourcery.com>, <gdb-patches@sourceware.org>, <tromey@redhat.com>, "'Joel Brobecker'" <brobecker@adacore.com> > Date: Thu, 6 Aug 2009 21:03:16 -0700 > > ! add_setshow_enum_cmd ("remotebreak", class_support, > ! remotebreak_enum, &remotebreak_string, _("\ > ! Set remote break sequence."), _("\ > ! Show remote break sequence."), NULL, > ! NULL, show_remotebreak, > ! &setlist, &showlist); Thanks. If this patch is approved, please also provide a suitable change to the GDB manual, where it describes this command. ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-08-07 9:22 ` Eli Zaretskii @ 2009-08-07 20:42 ` Caz Yokoyama 0 siblings, 0 replies; 55+ messages in thread From: Caz Yokoyama @ 2009-08-07 20:42 UTC (permalink / raw) To: 'Eli Zaretskii'; +Cc: gdb-patches [-- Attachment #1: Type: text/plain, Size: 1081 bytes --] Minor changes. Make global variables to static. Add a space between function name and left parenthesis. -caz -----Original Message----- From: Eli Zaretskii [mailto:eliz@gnu.org] Sent: Friday, August 07, 2009 1:42 AM To: Caz Yokoyama Cc: msnyder@vmware.com; drow@false.org; pedro@codesourcery.com; gdb-patches@sourceware.org; tromey@redhat.com; brobecker@adacore.com Subject: Re: symbolic debug of loadable modules with kgdb light > From: Caz Yokoyama <cazyokoyama@gmail.com> > Cc: "'Daniel Jacobowitz'" <drow@false.org>, "'Pedro Alves'" <pedro@codesourcery.com>, <gdb-patches@sourceware.org>, <tromey@redhat.com>, "'Joel Brobecker'" <brobecker@adacore.com> > Date: Thu, 6 Aug 2009 21:03:16 -0700 > > ! add_setshow_enum_cmd ("remotebreak", class_support, > ! remotebreak_enum, &remotebreak_string, _("\ > ! Set remote break sequence."), _("\ > ! Show remote break sequence."), NULL, > ! NULL, show_remotebreak, > ! &setlist, &showlist); Thanks. If this patch is approved, please also provide a suitable change to the GDB manual, where it describes this command. [-- Attachment #2: remotebreak.patch --] [-- Type: application/octet-stream, Size: 4436 bytes --] Index: gdb/remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.366 diff -c -r1.366 remote.c *** gdb/remote.c 31 Jul 2009 22:15:15 -0000 1.366 --- gdb/remote.c 7 Aug 2009 18:47:19 -0000 *************** *** 546,558 **** this can go away. */ static int wait_forever_enabled_p = 1; ! /* This variable chooses whether to send a ^C or a break when the user ! requests program interruption. Although ^C is usually what remote ! systems expect, and that is the default here, sometimes a break is ! preferable instead. */ ! ! static int remote_break; /* Descriptor for I/O to remote machine. Initialize it to NULL so that remote_open knows that we don't have a file open when the program --- 546,575 ---- this can go away. */ static int wait_forever_enabled_p = 1; + /* This variable chooses whether to send a ^C, a break or a break g + when the user requests program interruption. + Although ^C is usually what remote systems expect, + and that is the default here, sometimes a break is + preferable instead. For interrupting Linux kernel, a break and g is + expected which is Magic SysReq g. */ + static const char bs_Crtl_C[] = "Ctrl-C"; + static const char bs_BREAK[] = "BREAK"; + static const char bs_BREAK_g[] = "BREAK-g"; + static const char *remotebreak_enum[] = { + bs_Crtl_C, + bs_BREAK, + bs_BREAK_g, + NULL + }; + static const char *remotebreak_string = bs_Crtl_C; ! static void show_remotebreak (struct ui_file *file, int from_tty, ! struct cmd_list_element *c, ! const char *value) ! { ! fprintf_unfiltered (file, "remote systems expect %s to be interrupted\n", ! remotebreak_string); ! } /* Descriptor for I/O to remote machine. Initialize it to NULL so that remote_open knows that we don't have a file open when the program *************** *** 2601,2606 **** --- 2618,2629 ---- /* Ack any packet which the remote side has already sent. */ serial_write (remote_desc, "+", 1); + /* send break sequence on debugging Linux kernel */ + if (remotebreak_string == bs_BREAK_g) { + serial_send_break (remote_desc); + serial_write (remote_desc, "g", 1); + } + /* The first packet we send to the target is the optional "supported packets" request. If the target can answer this, it will tell us which later probes to skip. */ *************** *** 4011,4022 **** if (rs->cached_wait_status) return; ! /* Send a break or a ^C, depending on user preference. */ ! ! if (remote_break) serial_send_break (remote_desc); ! else ! serial_write (remote_desc, "\003", 1); } /* This is the generic stop called via the target vector. When a target --- 4034,4048 ---- if (rs->cached_wait_status) return; ! /* Send ^C, a break or a break g, depending on user preference. */ ! if (remotebreak_string == bs_Crtl_C) { ! serial_write (remote_desc, "\003", 1); ! } else if (remotebreak_string == bs_BREAK) { ! serial_send_break (remote_desc); ! } else if (remotebreak_string == bs_BREAK_g) { serial_send_break (remote_desc); ! serial_write (remote_desc, "g", 1); ! } } /* This is the generic stop called via the target vector. When a target *************** *** 9051,9062 **** terminating `#' character and checksum."), &maintenancelist); ! add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ ! Set whether to send break if interrupted."), _("\ ! Show whether to send break if interrupted."), _("\ ! If set, a break, instead of a cntrl-c, is sent to the remote target."), ! NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is %s. */ ! &setlist, &showlist); /* Install commands for configuring memory read/write packets. */ --- 9077,9088 ---- terminating `#' character and checksum."), &maintenancelist); ! add_setshow_enum_cmd ("remotebreak", class_support, ! remotebreak_enum, &remotebreak_string, _("\ ! Set remote break sequence."), _("\ ! Show remote break sequence."), NULL, ! NULL, show_remotebreak, ! &setlist, &showlist); /* Install commands for configuring memory read/write packets. */ ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-08-07 7:17 ` Caz Yokoyama 2009-08-07 9:22 ` Eli Zaretskii @ 2009-09-23 0:48 ` Joel Brobecker 2009-09-23 1:39 ` Daniel Jacobowitz ` (4 more replies) 1 sibling, 5 replies; 55+ messages in thread From: Joel Brobecker @ 2009-09-23 0:48 UTC (permalink / raw) To: Caz Yokoyama; +Cc: 'Pedro Alves', gdb-patches Global Maintainers (and other contributors), This patch proposes to change "set remotebreak" from being an on/off setting (on = send BREAK to interrupt, while "off" = send Ctrl-c to interrupt), to becoming an enum setting with 3 values: 1. the first value (the default) is to send ctrl-c 2. the second value is to send the BREAK sequence 3. the third value (new behavior) is to send BREAK followed by g (Magic SysReq g in the case of the Linux kernel). This is not exactly upward compatible. My real concern is front-ends, but I don't think this is a setting that's so common that front-ends know about. So I think that the idea of expanding this setting is OK. Any objection? Pedro, Daniel, or anyone with experience in remote.c, I'd love your feedback on this patch... Especially the part that sends an interrupt after having established the connection with the remote agent if the interrupt is set to BREAK+g... See below. Caz, > This patch generalizes remotebreak. It becomes an enum string from a > Boolean. It may be "Ctrl-C", "BREAK" or "BREAK-g". When it is "BREAK-g", gdb > also sends BREAK g to connect to Linux kernel when it starts. Can you provide a ChangeLog entry for all changes you are submitting here. See for instance this message that explains what happens, and then provides a patch and its ChangeLog. Another little detail is that most maintainers tend to prefer unified diffs, so if you could send these instead of context diff, that'd be much appreciated. Last thing: As you're modifying a user-settable setting, the documentation will also need to be updated. But since we're still at the discussion stage, it's OK if you prefer to work on the documentation at the end. > + /* This variable chooses whether to send a ^C, a break or a break g > + when the user requests program interruption. > + Although ^C is usually what remote systems expect, > + and that is the default here, sometimes a break is > + preferable instead. For interrupting Linux kernel, a break and g is > + expected which is Magic SysReq g. */ I would rephrase this a little bit in order to avoid repeating the same thing twice. For instance: /* Allow the user to specify what sequence to send to the remote when he requests a program interruption: Although ^C is usually what remote systems expect (this is the default, here), it is sometimes preferable to send a break. On other systems such as the Linux kernel, a break followed by g, which is Magic SysReq g is required in order to interrupt the execution. */ > + const char bs_Crtl_C[] = "Ctrl-C"; > + const char bs_BREAK[] = "BREAK"; > + const char bs_BREAK_g[] = "BREAK-g"; > + static const char *remotebreak_enum[] = { > + bs_Crtl_C, > + bs_BREAK, > + bs_BREAK_g, > + NULL I personally don't really like the names used here. Perhaps Pedro, who has more experience with the remote protocol code might have suggestions that fit better with the rest of the code. Here is what I suggest: - "interrupt" -> send ^C - "break" -> send the BREAK sequence - "break-g" -> send the BREAK sequence followed by g I'd also like to rename your constants to avoid the capital letters. It's more in line with the current GDB style. Overall, I suggest something like this: const char remote_break_interrupt[] = "interrutpt" const char remote_break_break[] = "break" const char remote_break_sysreq_g[] "sysreq-g" static const char *remote_break_modes[] = { remote_break_interrupt, remote_break_break, remote_break_sysreq_g, NULL }; static const char *remote_break_mode = remote_break_interrupt; > ! static void show_remotebreak(struct ui_file *file, int from_tty, > ! struct cmd_list_element *c, > ! const char *value) > ! { > ! fprintf_unfiltered (file, "remote systems expect %s to be > interrupted\n", > ! remotebreak_string); > ! } Let's use fprintf_filtered, otherwise there is no paging. Rather that talking of what the remote system expects, I'd rather also say what GDB does. I would suggest something like this: if (remote_break_mode == remote_break_interrupt) fprintf_filtered (_("To interrupt the execution of the program, " "send the ASCII ETX character (Ctrl-c) " "to the remote target.")); else if (remote_break_mode = remote_break_break) [...] Please note how messages printed by the debugger are enclosed inside _(). This is for i18n. Also because of i18n, you cannot build the message piecemeal such as: fprintf_filtered (_("To interrupt the execution of the program, ")); if (remote_break_mode == remote_break_interrupt) fprintf_filtered (_("send the ASCII ETX [...])); Translators often need the entire sentence in order to translate it. > + /* send break sequence on debugging Linux kernel */ > + if (remotebreak_string == bs_BREAK_g) { > + serial_send_break (remote_desc); > + serial_write (remote_desc, "g", 1); > + } A couple of nits first: For GDB, the curly brace should be on the next line of code: if (remotebreak_string == bs_BREAK_g) { [...] And sentences in comments should start with a capital letter, and end with a period. I am sorry if this is irritating you, but GDB follows the GNU Coding Style. So, you comment above should be: /* Send the Magic SysReg g sequence when debugging the Linux kernel. */ (notice the two spaces at the end of the sentence as well. However, this being said, I really don't know about this change. It seems to me that this part should not be controlled by the setting that you're modifying, but by another setting. At the very least. In fact, why do you need this at all? Can't your remote agent achieve the same effect as you've established the connection??? I'd like to have others' opinion on this one. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-09-23 0:48 ` Joel Brobecker @ 2009-09-23 1:39 ` Daniel Jacobowitz 2009-09-23 4:16 ` Caz Yokoyama ` (3 subsequent siblings) 4 siblings, 0 replies; 55+ messages in thread From: Daniel Jacobowitz @ 2009-09-23 1:39 UTC (permalink / raw) To: Joel Brobecker; +Cc: Caz Yokoyama, 'Pedro Alves', gdb-patches On Tue, Sep 22, 2009 at 05:48:02PM -0700, Joel Brobecker wrote: > Pedro, Daniel, or anyone with experience in remote.c, > > I'd love your feedback on this patch... Especially the part > that sends an interrupt after having established the connection > with the remote agent if the interrupt is set to BREAK+g... > See below. I have no particular comments. But it sounds like these are two orthogonal settings. > However, this being said, I really don't know about this change. > It seems to me that this part should not be controlled by the setting > that you're modifying, but by another setting. At the very least. > In fact, why do you need this at all? Can't your remote agent achieve > the same effect as you've established the connection??? Hey, that sounds familiar. You can't acheive this in an agent, because we're talking about serial consoles here - there's no other way for the agent to know there's a debugger attached. This sounds more like "set remote interrupt-sequence break-g" and "set remote interrupt-after-connection on". -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-09-23 0:48 ` Joel Brobecker 2009-09-23 1:39 ` Daniel Jacobowitz @ 2009-09-23 4:16 ` Caz Yokoyama 2009-09-23 11:36 ` Caz Yokoyama ` (2 subsequent siblings) 4 siblings, 0 replies; 55+ messages in thread From: Caz Yokoyama @ 2009-09-23 4:16 UTC (permalink / raw) To: 'Joel Brobecker'; +Cc: 'Pedro Alves', gdb-patches Hello Joel, See below for my comments which are under -----. -caz -----Original Message----- From: Joel Brobecker [mailto:brobecker@adacore.com] Sent: Tuesday, September 22, 2009 5:48 PM To: Caz Yokoyama Cc: 'Pedro Alves'; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light Global Maintainers (and other contributors), This patch proposes to change "set remotebreak" from being an on/off setting (on = send BREAK to interrupt, while "off" = send Ctrl-c to interrupt), to becoming an enum setting with 3 values: 1. the first value (the default) is to send ctrl-c 2. the second value is to send the BREAK sequence 3. the third value (new behavior) is to send BREAK followed by g (Magic SysReq g in the case of the Linux kernel). This is not exactly upward compatible. My real concern is front-ends, but I don't think this is a setting that's so common that front-ends know about. So I think that the idea of expanding this setting is OK. Any objection? Pedro, Daniel, or anyone with experience in remote.c, I'd love your feedback on this patch... Especially the part that sends an interrupt after having established the connection with the remote agent if the interrupt is set to BREAK+g... See below. -------------- I am afraid I don't understand what you are saying. Are you able to tell me what the remote agent mean? Does it mean gdbserver for example? Caz, > This patch generalizes remotebreak. It becomes an enum string from a > Boolean. It may be "Ctrl-C", "BREAK" or "BREAK-g". When it is "BREAK-g", gdb > also sends BREAK g to connect to Linux kernel when it starts. Can you provide a ChangeLog entry for all changes you are submitting here. See for instance this message that explains what happens, and then provides a patch and its ChangeLog. Another little detail is that most maintainers tend to prefer unified diffs, so if you could send these instead of context diff, that'd be much appreciated. Last thing: As you're modifying a user-settable setting, the documentation will also need to be updated. But since we're still at the discussion stage, it's OK if you prefer to work on the documentation at the end. > + /* This variable chooses whether to send a ^C, a break or a break g > + when the user requests program interruption. > + Although ^C is usually what remote systems expect, > + and that is the default here, sometimes a break is > + preferable instead. For interrupting Linux kernel, a break and g is > + expected which is Magic SysReq g. */ I would rephrase this a little bit in order to avoid repeating the same thing twice. For instance: /* Allow the user to specify what sequence to send to the remote when he requests a program interruption: Although ^C is usually what remote systems expect (this is the default, here), it is sometimes preferable to send a break. On other systems such as the Linux kernel, a break followed by g, which is Magic SysReq g is required in order to interrupt the execution. */ -------------- Great. The meaning is clear. > + const char bs_Crtl_C[] = "Ctrl-C"; > + const char bs_BREAK[] = "BREAK"; > + const char bs_BREAK_g[] = "BREAK-g"; > + static const char *remotebreak_enum[] = { > + bs_Crtl_C, > + bs_BREAK, > + bs_BREAK_g, > + NULL I personally don't really like the names used here. Perhaps Pedro, who has more experience with the remote protocol code might have suggestions that fit better with the rest of the code. Here is what I suggest: - "interrupt" -> send ^C - "break" -> send the BREAK sequence - "break-g" -> send the BREAK sequence followed by g I'd also like to rename your constants to avoid the capital letters. It's more in line with the current GDB style. Overall, I suggest something like this: const char remote_break_interrupt[] = "interrutpt" const char remote_break_break[] = "break" const char remote_break_sysreq_g[] "sysreq-g" static const char *remote_break_modes[] = { remote_break_interrupt, remote_break_break, remote_break_sysreq_g, NULL }; static const char *remote_break_mode = remote_break_interrupt; --------- BREAK is usually all capitalized in chip manual because it is high level of serial line for certain time. But I don't care weather capitalized or not. > ! static void show_remotebreak(struct ui_file *file, int from_tty, > ! struct cmd_list_element *c, > ! const char *value) > ! { > ! fprintf_unfiltered (file, "remote systems expect %s to be > interrupted\n", > ! remotebreak_string); > ! } Let's use fprintf_filtered, otherwise there is no paging. Rather that talking of what the remote system expects, I'd rather also say what GDB does. I would suggest something like this: if (remote_break_mode == remote_break_interrupt) fprintf_filtered (_("To interrupt the execution of the program, " "send the ASCII ETX character (Ctrl-c) " "to the remote target.")); else if (remote_break_mode = remote_break_break) [...] Please note how messages printed by the debugger are enclosed inside _(). This is for i18n. Also because of i18n, you cannot build the message piecemeal such as: fprintf_filtered (_("To interrupt the execution of the program, ")); if (remote_break_mode == remote_break_interrupt) fprintf_filtered (_("send the ASCII ETX [...])); Translators often need the entire sentence in order to translate it. > + /* send break sequence on debugging Linux kernel */ > + if (remotebreak_string == bs_BREAK_g) { > + serial_send_break (remote_desc); > + serial_write (remote_desc, "g", 1); > + } A couple of nits first: For GDB, the curly brace should be on the next line of code: if (remotebreak_string == bs_BREAK_g) { [...] And sentences in comments should start with a capital letter, and end with a period. I am sorry if this is irritating you, but GDB follows the GNU Coding Style. So, you comment above should be: /* Send the Magic SysReg g sequence when debugging the Linux kernel. */ (notice the two spaces at the end of the sentence as well. However, this being said, I really don't know about this change. It seems to me that this part should not be controlled by the setting that you're modifying, but by another setting. At the very least. In fact, why do you need this at all? Can't your remote agent achieve the same effect as you've established the connection??? ---------------- I don't want to go to another room to type Magic SysRq every time when I start debugging my device driver. Linux kernel has Magic SysRq to be interrupted by gdb. I don't expect Linux kernel changes Magic SysRq to ^C or BREAK. Therefore, the only way to interrupt Linux kernel is that gdb sends Magic SysRq. Is this the one you want to hear? I am confused. I'd like to have others' opinion on this one. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-09-23 0:48 ` Joel Brobecker 2009-09-23 1:39 ` Daniel Jacobowitz 2009-09-23 4:16 ` Caz Yokoyama @ 2009-09-23 11:36 ` Caz Yokoyama 2009-09-24 16:40 ` Caz Yokoyama 2009-09-24 22:42 ` Caz Yokoyama 4 siblings, 0 replies; 55+ messages in thread From: Caz Yokoyama @ 2009-09-23 11:36 UTC (permalink / raw) To: 'Joel Brobecker'; +Cc: 'Pedro Alves', gdb-patches I prefer "Magic SysRq" instead of "Magic SysReq" because keyboard has "SysRq". -caz -----Original Message----- From: Caz Yokoyama [mailto:caz@caztech.com] Sent: Tuesday, September 22, 2009 9:16 PM To: 'Joel Brobecker' Cc: 'Pedro Alves'; 'gdb-patches@sourceware.org' Subject: RE: symbolic debug of loadable modules with kgdb light Hello Joel, See below for my comments which are under -----. -caz -----Original Message----- From: Joel Brobecker [mailto:brobecker@adacore.com] Sent: Tuesday, September 22, 2009 5:48 PM To: Caz Yokoyama Cc: 'Pedro Alves'; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light Global Maintainers (and other contributors), This patch proposes to change "set remotebreak" from being an on/off setting (on = send BREAK to interrupt, while "off" = send Ctrl-c to interrupt), to becoming an enum setting with 3 values: 1. the first value (the default) is to send ctrl-c 2. the second value is to send the BREAK sequence 3. the third value (new behavior) is to send BREAK followed by g (Magic SysReq g in the case of the Linux kernel). This is not exactly upward compatible. My real concern is front-ends, but I don't think this is a setting that's so common that front-ends know about. So I think that the idea of expanding this setting is OK. Any objection? Pedro, Daniel, or anyone with experience in remote.c, I'd love your feedback on this patch... Especially the part that sends an interrupt after having established the connection with the remote agent if the interrupt is set to BREAK+g... See below. -------------- I am afraid I don't understand what you are saying. Are you able to tell me what the remote agent mean? Does it mean gdbserver for example? Caz, > This patch generalizes remotebreak. It becomes an enum string from a > Boolean. It may be "Ctrl-C", "BREAK" or "BREAK-g". When it is "BREAK-g", gdb > also sends BREAK g to connect to Linux kernel when it starts. Can you provide a ChangeLog entry for all changes you are submitting here. See for instance this message that explains what happens, and then provides a patch and its ChangeLog. Another little detail is that most maintainers tend to prefer unified diffs, so if you could send these instead of context diff, that'd be much appreciated. Last thing: As you're modifying a user-settable setting, the documentation will also need to be updated. But since we're still at the discussion stage, it's OK if you prefer to work on the documentation at the end. > + /* This variable chooses whether to send a ^C, a break or a break g > + when the user requests program interruption. > + Although ^C is usually what remote systems expect, > + and that is the default here, sometimes a break is > + preferable instead. For interrupting Linux kernel, a break and g is > + expected which is Magic SysReq g. */ I would rephrase this a little bit in order to avoid repeating the same thing twice. For instance: /* Allow the user to specify what sequence to send to the remote when he requests a program interruption: Although ^C is usually what remote systems expect (this is the default, here), it is sometimes preferable to send a break. On other systems such as the Linux kernel, a break followed by g, which is Magic SysReq g is required in order to interrupt the execution. */ -------------- Great. The meaning is clear. > + const char bs_Crtl_C[] = "Ctrl-C"; > + const char bs_BREAK[] = "BREAK"; > + const char bs_BREAK_g[] = "BREAK-g"; > + static const char *remotebreak_enum[] = { > + bs_Crtl_C, > + bs_BREAK, > + bs_BREAK_g, > + NULL I personally don't really like the names used here. Perhaps Pedro, who has more experience with the remote protocol code might have suggestions that fit better with the rest of the code. Here is what I suggest: - "interrupt" -> send ^C - "break" -> send the BREAK sequence - "break-g" -> send the BREAK sequence followed by g I'd also like to rename your constants to avoid the capital letters. It's more in line with the current GDB style. Overall, I suggest something like this: const char remote_break_interrupt[] = "interrutpt" const char remote_break_break[] = "break" const char remote_break_sysreq_g[] "sysreq-g" static const char *remote_break_modes[] = { remote_break_interrupt, remote_break_break, remote_break_sysreq_g, NULL }; static const char *remote_break_mode = remote_break_interrupt; --------- BREAK is usually all capitalized in chip manual because it is high level of serial line for certain time. But I don't care weather capitalized or not. > ! static void show_remotebreak(struct ui_file *file, int from_tty, > ! struct cmd_list_element *c, > ! const char *value) > ! { > ! fprintf_unfiltered (file, "remote systems expect %s to be > interrupted\n", > ! remotebreak_string); > ! } Let's use fprintf_filtered, otherwise there is no paging. Rather that talking of what the remote system expects, I'd rather also say what GDB does. I would suggest something like this: if (remote_break_mode == remote_break_interrupt) fprintf_filtered (_("To interrupt the execution of the program, " "send the ASCII ETX character (Ctrl-c) " "to the remote target.")); else if (remote_break_mode = remote_break_break) [...] Please note how messages printed by the debugger are enclosed inside _(). This is for i18n. Also because of i18n, you cannot build the message piecemeal such as: fprintf_filtered (_("To interrupt the execution of the program, ")); if (remote_break_mode == remote_break_interrupt) fprintf_filtered (_("send the ASCII ETX [...])); Translators often need the entire sentence in order to translate it. > + /* send break sequence on debugging Linux kernel */ > + if (remotebreak_string == bs_BREAK_g) { > + serial_send_break (remote_desc); > + serial_write (remote_desc, "g", 1); > + } A couple of nits first: For GDB, the curly brace should be on the next line of code: if (remotebreak_string == bs_BREAK_g) { [...] And sentences in comments should start with a capital letter, and end with a period. I am sorry if this is irritating you, but GDB follows the GNU Coding Style. So, you comment above should be: /* Send the Magic SysReg g sequence when debugging the Linux kernel. */ (notice the two spaces at the end of the sentence as well. However, this being said, I really don't know about this change. It seems to me that this part should not be controlled by the setting that you're modifying, but by another setting. At the very least. In fact, why do you need this at all? Can't your remote agent achieve the same effect as you've established the connection??? ---------------- I don't want to go to another room to type Magic SysRq every time when I start debugging my device driver. Linux kernel has Magic SysRq to be interrupted by gdb. I don't expect Linux kernel changes Magic SysRq to ^C or BREAK. Therefore, the only way to interrupt Linux kernel is that gdb sends Magic SysRq. Is this the one you want to hear? I am confused. I'd like to have others' opinion on this one. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-09-23 0:48 ` Joel Brobecker ` (2 preceding siblings ...) 2009-09-23 11:36 ` Caz Yokoyama @ 2009-09-24 16:40 ` Caz Yokoyama 2009-09-24 22:42 ` Caz Yokoyama 4 siblings, 0 replies; 55+ messages in thread From: Caz Yokoyama @ 2009-09-24 16:40 UTC (permalink / raw) To: 'Joel Brobecker'; +Cc: 'Pedro Alves', gdb-patches [-- Attachment #1: Type: text/plain, Size: 13118 bytes --] Hello Joel, Here is the revised patch according to you. ndex: gdb/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.10902 diff -u -r1.10902 ChangeLog --- gdb/ChangeLog 23 Sep 2009 17:27:39 -0000 1.10902 +++ gdb/ChangeLog 24 Sep 2009 16:33:18 -0000 @@ -1,3 +1,9 @@ +2009-09-23 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * remote.c: Allow the user to select one of ^C, a break or + Magic SysRq g as the sequence to the remote in order to + interrupt the execution. + 2009-09-23 John Wright <john.wright@hp.com> PR gdb/10684: Index: gdb/remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.372 diff -u -r1.372 remote.c --- gdb/remote.c 10 Sep 2009 22:47:56 -0000 1.372 +++ gdb/remote.c 24 Sep 2009 16:33:21 -0000 @@ -546,13 +546,48 @@ this can go away. */ static int wait_forever_enabled_p = 1; +/* Allow the user to specify what sequence to send to the remote + when he requests a program interruption: Although ^C is usually + what remote systems expect (this is the default, here), it is + sometimes preferable to send a break. On other systems such + as the Linux kernel, a break followed by g, which is Magic SysRq g + is required in order to interrupt the execution. */ +const char remote_break_interrupt[] = "interrutpt"; +const char remote_break_break[] = "break"; +const char remote_break_sysrq_g[] = "sysrq-g"; +static const char *remote_break_modes[] = + { + remote_break_interrupt, + remote_break_break, + remote_break_sysrq_g, + NULL + }; +const char *remote_break_mode = remote_break_interrupt; -/* This variable chooses whether to send a ^C or a break when the user - requests program interruption. Although ^C is usually what remote - systems expect, and that is the default here, sometimes a break is - preferable instead. */ - -static int remote_break; +static void show_remotebreak (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value) +{ + if (remote_break_mode == remote_break_interrupt) + fprintf_filtered (file, + ("To interrupt the execution of the program, " + "send the ASCII ETX character (Ctrl-c) " + "to the remote target.")); + else if (remote_break_mode == remote_break_break) + fprintf_filtered (file, + ("To interrupt the execution of the program, " + "send a BREAK signal " + "to the remote target.")); + else if (remote_break_mode == remote_break_sysrq_g) + fprintf_filtered (file, + ("To interrupt the execution of Linux kernel, " + "send a BREAK signal and 'g' " + "to the remote Linux kernel.")); + else + fprintf_filtered (file, + ("You are sending %s to the remote target " + "which is not expected."), remote_break_mode); +} /* Descriptor for I/O to remote machine. Initialize it to NULL so that remote_open knows that we don't have a file open when the program @@ -2598,6 +2633,14 @@ /* Ack any packet which the remote side has already sent. */ serial_write (remote_desc, "+", 1); + /* Send the Magic SysRg g sequence in order to interrupt + the execution of Linux kernel. */ + if (remote_break_mode == remote_break_sysrq_g) + { + serial_send_break (remote_desc); + serial_write (remote_desc, "g", 1); + } + /* The first packet we send to the target is the optional "supported packets" request. If the target can answer this, it will tell us which later probes to skip. */ @@ -4021,12 +4064,20 @@ if (rs->cached_wait_status) return; - /* Send a break or a ^C, depending on user preference. */ - - if (remote_break) - serial_send_break (remote_desc); - else - serial_write (remote_desc, "\003", 1); + /* Send ^C, a break or a break g, depending on user preference. */ + if (remote_break_mode == remote_break_interrupt) + { + serial_write (remote_desc, "\003", 1); + } + else if (remote_break_mode == remote_break_break) + { + serial_send_break (remote_desc); + } + else if (remote_break_mode == remote_break_sysrq_g) + { + serial_send_break (remote_desc); + serial_write (remote_desc, "g", 1); + } } /* This is the generic stop called via the target vector. When a target @@ -9056,12 +9107,12 @@ terminating `#' character and checksum."), &maintenancelist); - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ -Set whether to send break if interrupted."), _("\ -Show whether to send break if interrupted."), _("\ -If set, a break, instead of a cntrl-c, is sent to the remote target."), - NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is %s. */ - &setlist, &showlist); + add_setshow_enum_cmd ("remotebreak", class_support, + remote_break_modes, &remote_break_mode, _("\ +Set remote break sequence."), _("\ +Show remote break sequence."), NULL, + NULL, show_remotebreak, + &setlist, &showlist); /* Install commands for configuring memory read/write packets. */ Index: gdb/remote.h =================================================================== RCS file: /cvs/src/src/gdb/remote.h,v retrieving revision 1.17 diff -u -r1.17 remote.h --- gdb/remote.h 3 Jan 2009 05:57:53 -0000 1.17 +++ gdb/remote.h 24 Sep 2009 16:33:21 -0000 @@ -77,4 +77,7 @@ int remote_filename_p (const char *filename); +extern const char remote_break_sysrq_g[]; +extern const char *remote_break_mode; + #endif -caz -----Original Message----- From: Caz Yokoyama [mailto:caz@caztech.com] Sent: Wednesday, September 23, 2009 4:36 AM To: 'Joel Brobecker' Cc: 'Pedro Alves'; 'gdb-patches@sourceware.org' Subject: RE: symbolic debug of loadable modules with kgdb light I prefer "Magic SysRq" instead of "Magic SysReq" because keyboard has "SysRq". -caz -----Original Message----- From: Caz Yokoyama [mailto:caz@caztech.com] Sent: Tuesday, September 22, 2009 9:16 PM To: 'Joel Brobecker' Cc: 'Pedro Alves'; 'gdb-patches@sourceware.org' Subject: RE: symbolic debug of loadable modules with kgdb light Hello Joel, See below for my comments which are under -----. -caz -----Original Message----- From: Joel Brobecker [mailto:brobecker@adacore.com] Sent: Tuesday, September 22, 2009 5:48 PM To: Caz Yokoyama Cc: 'Pedro Alves'; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light Global Maintainers (and other contributors), This patch proposes to change "set remotebreak" from being an on/off setting (on = send BREAK to interrupt, while "off" = send Ctrl-c to interrupt), to becoming an enum setting with 3 values: 1. the first value (the default) is to send ctrl-c 2. the second value is to send the BREAK sequence 3. the third value (new behavior) is to send BREAK followed by g (Magic SysReq g in the case of the Linux kernel). This is not exactly upward compatible. My real concern is front-ends, but I don't think this is a setting that's so common that front-ends know about. So I think that the idea of expanding this setting is OK. Any objection? Pedro, Daniel, or anyone with experience in remote.c, I'd love your feedback on this patch... Especially the part that sends an interrupt after having established the connection with the remote agent if the interrupt is set to BREAK+g... See below. -------------- I am afraid I don't understand what you are saying. Are you able to tell me what the remote agent mean? Does it mean gdbserver for example? Caz, > This patch generalizes remotebreak. It becomes an enum string from a > Boolean. It may be "Ctrl-C", "BREAK" or "BREAK-g". When it is "BREAK-g", gdb > also sends BREAK g to connect to Linux kernel when it starts. Can you provide a ChangeLog entry for all changes you are submitting here. See for instance this message that explains what happens, and then provides a patch and its ChangeLog. Another little detail is that most maintainers tend to prefer unified diffs, so if you could send these instead of context diff, that'd be much appreciated. Last thing: As you're modifying a user-settable setting, the documentation will also need to be updated. But since we're still at the discussion stage, it's OK if you prefer to work on the documentation at the end. > + /* This variable chooses whether to send a ^C, a break or a break g > + when the user requests program interruption. > + Although ^C is usually what remote systems expect, > + and that is the default here, sometimes a break is > + preferable instead. For interrupting Linux kernel, a break and g is > + expected which is Magic SysReq g. */ I would rephrase this a little bit in order to avoid repeating the same thing twice. For instance: /* Allow the user to specify what sequence to send to the remote when he requests a program interruption: Although ^C is usually what remote systems expect (this is the default, here), it is sometimes preferable to send a break. On other systems such as the Linux kernel, a break followed by g, which is Magic SysReq g is required in order to interrupt the execution. */ -------------- Great. The meaning is clear. > + const char bs_Crtl_C[] = "Ctrl-C"; > + const char bs_BREAK[] = "BREAK"; > + const char bs_BREAK_g[] = "BREAK-g"; > + static const char *remotebreak_enum[] = { > + bs_Crtl_C, > + bs_BREAK, > + bs_BREAK_g, > + NULL I personally don't really like the names used here. Perhaps Pedro, who has more experience with the remote protocol code might have suggestions that fit better with the rest of the code. Here is what I suggest: - "interrupt" -> send ^C - "break" -> send the BREAK sequence - "break-g" -> send the BREAK sequence followed by g I'd also like to rename your constants to avoid the capital letters. It's more in line with the current GDB style. Overall, I suggest something like this: const char remote_break_interrupt[] = "interrutpt" const char remote_break_break[] = "break" const char remote_break_sysreq_g[] "sysreq-g" static const char *remote_break_modes[] = { remote_break_interrupt, remote_break_break, remote_break_sysreq_g, NULL }; static const char *remote_break_mode = remote_break_interrupt; --------- BREAK is usually all capitalized in chip manual because it is high level of serial line for certain time. But I don't care weather capitalized or not. > ! static void show_remotebreak(struct ui_file *file, int from_tty, > ! struct cmd_list_element *c, > ! const char *value) > ! { > ! fprintf_unfiltered (file, "remote systems expect %s to be > interrupted\n", > ! remotebreak_string); > ! } Let's use fprintf_filtered, otherwise there is no paging. Rather that talking of what the remote system expects, I'd rather also say what GDB does. I would suggest something like this: if (remote_break_mode == remote_break_interrupt) fprintf_filtered (_("To interrupt the execution of the program, " "send the ASCII ETX character (Ctrl-c) " "to the remote target.")); else if (remote_break_mode = remote_break_break) [...] Please note how messages printed by the debugger are enclosed inside _(). This is for i18n. Also because of i18n, you cannot build the message piecemeal such as: fprintf_filtered (_("To interrupt the execution of the program, ")); if (remote_break_mode == remote_break_interrupt) fprintf_filtered (_("send the ASCII ETX [...])); Translators often need the entire sentence in order to translate it. > + /* send break sequence on debugging Linux kernel */ > + if (remotebreak_string == bs_BREAK_g) { > + serial_send_break (remote_desc); > + serial_write (remote_desc, "g", 1); > + } A couple of nits first: For GDB, the curly brace should be on the next line of code: if (remotebreak_string == bs_BREAK_g) { [...] And sentences in comments should start with a capital letter, and end with a period. I am sorry if this is irritating you, but GDB follows the GNU Coding Style. So, you comment above should be: /* Send the Magic SysReg g sequence when debugging the Linux kernel. */ (notice the two spaces at the end of the sentence as well. However, this being said, I really don't know about this change. It seems to me that this part should not be controlled by the setting that you're modifying, but by another setting. At the very least. In fact, why do you need this at all? Can't your remote agent achieve the same effect as you've established the connection??? ---------------- I don't want to go to another room to type Magic SysRq every time when I start debugging my device driver. Linux kernel has Magic SysRq to be interrupted by gdb. I don't expect Linux kernel changes Magic SysRq to ^C or BREAK. Therefore, the only way to interrupt Linux kernel is that gdb sends Magic SysRq. Is this the one you want to hear? I am confused. I'd like to have others' opinion on this one. -- Joel [-- Attachment #2: remotebreak.patch --] [-- Type: application/octet-stream, Size: 5697 bytes --] Index: gdb/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.10902 diff -u -r1.10902 ChangeLog --- gdb/ChangeLog 23 Sep 2009 17:27:39 -0000 1.10902 +++ gdb/ChangeLog 24 Sep 2009 16:33:18 -0000 @@ -1,3 +1,9 @@ +2009-09-23 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * remote.c: Allow the user to select one of ^C, a break or + Magic SysRq g as the sequence to the remote in order to + interrupt the execution. + 2009-09-23 John Wright <john.wright@hp.com> PR gdb/10684: Index: gdb/remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.372 diff -u -r1.372 remote.c --- gdb/remote.c 10 Sep 2009 22:47:56 -0000 1.372 +++ gdb/remote.c 24 Sep 2009 16:33:21 -0000 @@ -546,13 +546,48 @@ this can go away. */ static int wait_forever_enabled_p = 1; +/* Allow the user to specify what sequence to send to the remote + when he requests a program interruption: Although ^C is usually + what remote systems expect (this is the default, here), it is + sometimes preferable to send a break. On other systems such + as the Linux kernel, a break followed by g, which is Magic SysRq g + is required in order to interrupt the execution. */ +const char remote_break_interrupt[] = "interrutpt"; +const char remote_break_break[] = "break"; +const char remote_break_sysrq_g[] = "sysrq-g"; +static const char *remote_break_modes[] = + { + remote_break_interrupt, + remote_break_break, + remote_break_sysrq_g, + NULL + }; +const char *remote_break_mode = remote_break_interrupt; -/* This variable chooses whether to send a ^C or a break when the user - requests program interruption. Although ^C is usually what remote - systems expect, and that is the default here, sometimes a break is - preferable instead. */ - -static int remote_break; +static void show_remotebreak (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value) +{ + if (remote_break_mode == remote_break_interrupt) + fprintf_filtered (file, + ("To interrupt the execution of the program, " + "send the ASCII ETX character (Ctrl-c) " + "to the remote target.")); + else if (remote_break_mode == remote_break_break) + fprintf_filtered (file, + ("To interrupt the execution of the program, " + "send a BREAK signal " + "to the remote target.")); + else if (remote_break_mode == remote_break_sysrq_g) + fprintf_filtered (file, + ("To interrupt the execution of Linux kernel, " + "send a BREAK signal and 'g' " + "to the remote Linux kernel.")); + else + fprintf_filtered (file, + ("You are sending %s to the remote target " + "which is not expected."), remote_break_mode); +} /* Descriptor for I/O to remote machine. Initialize it to NULL so that remote_open knows that we don't have a file open when the program @@ -2598,6 +2633,14 @@ /* Ack any packet which the remote side has already sent. */ serial_write (remote_desc, "+", 1); + /* Send the Magic SysRg g sequence in order to interrupt + the execution of Linux kernel. */ + if (remote_break_mode == remote_break_sysrq_g) + { + serial_send_break (remote_desc); + serial_write (remote_desc, "g", 1); + } + /* The first packet we send to the target is the optional "supported packets" request. If the target can answer this, it will tell us which later probes to skip. */ @@ -4021,12 +4064,20 @@ if (rs->cached_wait_status) return; - /* Send a break or a ^C, depending on user preference. */ - - if (remote_break) - serial_send_break (remote_desc); - else - serial_write (remote_desc, "\003", 1); + /* Send ^C, a break or a break g, depending on user preference. */ + if (remote_break_mode == remote_break_interrupt) + { + serial_write (remote_desc, "\003", 1); + } + else if (remote_break_mode == remote_break_break) + { + serial_send_break (remote_desc); + } + else if (remote_break_mode == remote_break_sysrq_g) + { + serial_send_break (remote_desc); + serial_write (remote_desc, "g", 1); + } } /* This is the generic stop called via the target vector. When a target @@ -9056,12 +9107,12 @@ terminating `#' character and checksum."), &maintenancelist); - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ -Set whether to send break if interrupted."), _("\ -Show whether to send break if interrupted."), _("\ -If set, a break, instead of a cntrl-c, is sent to the remote target."), - NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is %s. */ - &setlist, &showlist); + add_setshow_enum_cmd ("remotebreak", class_support, + remote_break_modes, &remote_break_mode, _("\ +Set remote break sequence."), _("\ +Show remote break sequence."), NULL, + NULL, show_remotebreak, + &setlist, &showlist); /* Install commands for configuring memory read/write packets. */ Index: gdb/remote.h =================================================================== RCS file: /cvs/src/src/gdb/remote.h,v retrieving revision 1.17 diff -u -r1.17 remote.h --- gdb/remote.h 3 Jan 2009 05:57:53 -0000 1.17 +++ gdb/remote.h 24 Sep 2009 16:33:21 -0000 @@ -77,4 +77,7 @@ int remote_filename_p (const char *filename); +extern const char remote_break_sysrq_g[]; +extern const char *remote_break_mode; + #endif ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-09-23 0:48 ` Joel Brobecker ` (3 preceding siblings ...) 2009-09-24 16:40 ` Caz Yokoyama @ 2009-09-24 22:42 ` Caz Yokoyama 2009-09-25 16:06 ` Joel Brobecker 4 siblings, 1 reply; 55+ messages in thread From: Caz Yokoyama @ 2009-09-24 22:42 UTC (permalink / raw) To: 'Joel Brobecker'; +Cc: 'Pedro Alves', gdb-patches [-- Attachment #1: Type: text/plain, Size: 7866 bytes --] Another revise. Include document. -caz -----Original Message----- From: Caz Yokoyama [mailto:caz@caztech.com] Sent: Thursday, September 24, 2009 9:41 AM To: 'Joel Brobecker' Cc: 'Pedro Alves'; 'gdb-patches@sourceware.org' Subject: RE: symbolic debug of loadable modules with kgdb light Hello Joel, Here is the revised patch according to you. -caz -----Original Message----- From: Caz Yokoyama [mailto:caz@caztech.com] Sent: Wednesday, September 23, 2009 4:36 AM To: 'Joel Brobecker' Cc: 'Pedro Alves'; 'gdb-patches@sourceware.org' Subject: RE: symbolic debug of loadable modules with kgdb light I prefer "Magic SysRq" instead of "Magic SysReq" because keyboard has "SysRq". -caz -----Original Message----- From: Caz Yokoyama [mailto:caz@caztech.com] Sent: Tuesday, September 22, 2009 9:16 PM To: 'Joel Brobecker' Cc: 'Pedro Alves'; 'gdb-patches@sourceware.org' Subject: RE: symbolic debug of loadable modules with kgdb light Hello Joel, See below for my comments which are under -----. -caz -----Original Message----- From: Joel Brobecker [mailto:brobecker@adacore.com] Sent: Tuesday, September 22, 2009 5:48 PM To: Caz Yokoyama Cc: 'Pedro Alves'; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light Global Maintainers (and other contributors), This patch proposes to change "set remotebreak" from being an on/off setting (on = send BREAK to interrupt, while "off" = send Ctrl-c to interrupt), to becoming an enum setting with 3 values: 1. the first value (the default) is to send ctrl-c 2. the second value is to send the BREAK sequence 3. the third value (new behavior) is to send BREAK followed by g (Magic SysReq g in the case of the Linux kernel). This is not exactly upward compatible. My real concern is front-ends, but I don't think this is a setting that's so common that front-ends know about. So I think that the idea of expanding this setting is OK. Any objection? Pedro, Daniel, or anyone with experience in remote.c, I'd love your feedback on this patch... Especially the part that sends an interrupt after having established the connection with the remote agent if the interrupt is set to BREAK+g... See below. -------------- I am afraid I don't understand what you are saying. Are you able to tell me what the remote agent mean? Does it mean gdbserver for example? Caz, > This patch generalizes remotebreak. It becomes an enum string from a > Boolean. It may be "Ctrl-C", "BREAK" or "BREAK-g". When it is "BREAK-g", gdb > also sends BREAK g to connect to Linux kernel when it starts. Can you provide a ChangeLog entry for all changes you are submitting here. See for instance this message that explains what happens, and then provides a patch and its ChangeLog. Another little detail is that most maintainers tend to prefer unified diffs, so if you could send these instead of context diff, that'd be much appreciated. Last thing: As you're modifying a user-settable setting, the documentation will also need to be updated. But since we're still at the discussion stage, it's OK if you prefer to work on the documentation at the end. > + /* This variable chooses whether to send a ^C, a break or a break g > + when the user requests program interruption. > + Although ^C is usually what remote systems expect, > + and that is the default here, sometimes a break is > + preferable instead. For interrupting Linux kernel, a break and g is > + expected which is Magic SysReq g. */ I would rephrase this a little bit in order to avoid repeating the same thing twice. For instance: /* Allow the user to specify what sequence to send to the remote when he requests a program interruption: Although ^C is usually what remote systems expect (this is the default, here), it is sometimes preferable to send a break. On other systems such as the Linux kernel, a break followed by g, which is Magic SysReq g is required in order to interrupt the execution. */ -------------- Great. The meaning is clear. > + const char bs_Crtl_C[] = "Ctrl-C"; > + const char bs_BREAK[] = "BREAK"; > + const char bs_BREAK_g[] = "BREAK-g"; > + static const char *remotebreak_enum[] = { > + bs_Crtl_C, > + bs_BREAK, > + bs_BREAK_g, > + NULL I personally don't really like the names used here. Perhaps Pedro, who has more experience with the remote protocol code might have suggestions that fit better with the rest of the code. Here is what I suggest: - "interrupt" -> send ^C - "break" -> send the BREAK sequence - "break-g" -> send the BREAK sequence followed by g I'd also like to rename your constants to avoid the capital letters. It's more in line with the current GDB style. Overall, I suggest something like this: const char remote_break_interrupt[] = "interrutpt" const char remote_break_break[] = "break" const char remote_break_sysreq_g[] "sysreq-g" static const char *remote_break_modes[] = { remote_break_interrupt, remote_break_break, remote_break_sysreq_g, NULL }; static const char *remote_break_mode = remote_break_interrupt; --------- BREAK is usually all capitalized in chip manual because it is high level of serial line for certain time. But I don't care weather capitalized or not. > ! static void show_remotebreak(struct ui_file *file, int from_tty, > ! struct cmd_list_element *c, > ! const char *value) > ! { > ! fprintf_unfiltered (file, "remote systems expect %s to be > interrupted\n", > ! remotebreak_string); > ! } Let's use fprintf_filtered, otherwise there is no paging. Rather that talking of what the remote system expects, I'd rather also say what GDB does. I would suggest something like this: if (remote_break_mode == remote_break_interrupt) fprintf_filtered (_("To interrupt the execution of the program, " "send the ASCII ETX character (Ctrl-c) " "to the remote target.")); else if (remote_break_mode = remote_break_break) [...] Please note how messages printed by the debugger are enclosed inside _(). This is for i18n. Also because of i18n, you cannot build the message piecemeal such as: fprintf_filtered (_("To interrupt the execution of the program, ")); if (remote_break_mode == remote_break_interrupt) fprintf_filtered (_("send the ASCII ETX [...])); Translators often need the entire sentence in order to translate it. > + /* send break sequence on debugging Linux kernel */ > + if (remotebreak_string == bs_BREAK_g) { > + serial_send_break (remote_desc); > + serial_write (remote_desc, "g", 1); > + } A couple of nits first: For GDB, the curly brace should be on the next line of code: if (remotebreak_string == bs_BREAK_g) { [...] And sentences in comments should start with a capital letter, and end with a period. I am sorry if this is irritating you, but GDB follows the GNU Coding Style. So, you comment above should be: /* Send the Magic SysReg g sequence when debugging the Linux kernel. */ (notice the two spaces at the end of the sentence as well. However, this being said, I really don't know about this change. It seems to me that this part should not be controlled by the setting that you're modifying, but by another setting. At the very least. In fact, why do you need this at all? Can't your remote agent achieve the same effect as you've established the connection??? ---------------- I don't want to go to another room to type Magic SysRq every time when I start debugging my device driver. Linux kernel has Magic SysRq to be interrupted by gdb. I don't expect Linux kernel changes Magic SysRq to ^C or BREAK. Therefore, the only way to interrupt Linux kernel is that gdb sends Magic SysRq. Is this the one you want to hear? I am confused. I'd like to have others' opinion on this one. -- Joel [-- Attachment #2: remotebreak.patch --] [-- Type: application/octet-stream, Size: 8384 bytes --] Index: gdb/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.10903 diff -u -r1.10903 ChangeLog --- gdb/ChangeLog 24 Sep 2009 17:58:04 -0000 1.10903 +++ gdb/ChangeLog 24 Sep 2009 22:39:30 -0000 @@ -1,3 +1,9 @@ +2009-09-23 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * remote.c: Allow the user to select one of ^C, a break or + Magic SysRq g as the sequence to the remote in order to + interrupt the execution. + 2009-09-23 Joel Brobecker <brobecker@adacore.com> * record.c (record_open, record_store_registers, record_xfer_partial): Index: gdb/remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.372 diff -u -r1.372 remote.c --- gdb/remote.c 10 Sep 2009 22:47:56 -0000 1.372 +++ gdb/remote.c 24 Sep 2009 22:39:33 -0000 @@ -546,13 +546,48 @@ this can go away. */ static int wait_forever_enabled_p = 1; +/* Allow the user to specify what sequence to send to the remote + when he requests a program interruption: Although ^C is usually + what remote systems expect (this is the default, here), it is + sometimes preferable to send a break. On other systems such + as the Linux kernel, a break followed by g, which is Magic SysRq g + is required in order to interrupt the execution. */ +const char remote_break_interrupt[] = "interrutpt"; +const char remote_break_break[] = "break"; +const char remote_break_sysrq_g[] = "sysrq-g"; +static const char *remote_break_modes[] = + { + remote_break_interrupt, + remote_break_break, + remote_break_sysrq_g, + NULL + }; +const char *remote_break_mode = remote_break_interrupt; -/* This variable chooses whether to send a ^C or a break when the user - requests program interruption. Although ^C is usually what remote - systems expect, and that is the default here, sometimes a break is - preferable instead. */ - -static int remote_break; +static void show_remotebreak (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value) +{ + if (remote_break_mode == remote_break_interrupt) + fprintf_filtered (file, + ("To interrupt the execution of the program, " + "send the ASCII ETX character (Ctrl-c) " + "to the remote target.")); + else if (remote_break_mode == remote_break_break) + fprintf_filtered (file, + ("To interrupt the execution of the program, " + "send a BREAK signal " + "to the remote target.")); + else if (remote_break_mode == remote_break_sysrq_g) + fprintf_filtered (file, + ("To interrupt the execution of Linux kernel, " + "send a BREAK signal and 'g' " + "to the remote Linux kernel.")); + else + fprintf_filtered (file, + ("You are sending %s to the remote target " + "which is not expected."), remote_break_mode); +} /* Descriptor for I/O to remote machine. Initialize it to NULL so that remote_open knows that we don't have a file open when the program @@ -2598,6 +2633,14 @@ /* Ack any packet which the remote side has already sent. */ serial_write (remote_desc, "+", 1); + /* Send the Magic SysRg g sequence in order to interrupt + the execution of Linux kernel. */ + if (remote_break_mode == remote_break_sysrq_g) + { + serial_send_break (remote_desc); + serial_write (remote_desc, "g", 1); + } + /* The first packet we send to the target is the optional "supported packets" request. If the target can answer this, it will tell us which later probes to skip. */ @@ -4021,12 +4064,20 @@ if (rs->cached_wait_status) return; - /* Send a break or a ^C, depending on user preference. */ - - if (remote_break) - serial_send_break (remote_desc); - else - serial_write (remote_desc, "\003", 1); + /* Send ^C, a break or a break g, depending on user preference. */ + if (remote_break_mode == remote_break_interrupt) + { + serial_write (remote_desc, "\003", 1); + } + else if (remote_break_mode == remote_break_break) + { + serial_send_break (remote_desc); + } + else if (remote_break_mode == remote_break_sysrq_g) + { + serial_send_break (remote_desc); + serial_write (remote_desc, "g", 1); + } } /* This is the generic stop called via the target vector. When a target @@ -9056,12 +9107,12 @@ terminating `#' character and checksum."), &maintenancelist); - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ -Set whether to send break if interrupted."), _("\ -Show whether to send break if interrupted."), _("\ -If set, a break, instead of a cntrl-c, is sent to the remote target."), - NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is %s. */ - &setlist, &showlist); + add_setshow_enum_cmd ("remotebreak", class_support, + remote_break_modes, &remote_break_mode, _("\ +Set remote break sequence."), _("\ +Show remote break sequence."), NULL, + NULL, show_remotebreak, + &setlist, &showlist); /* Install commands for configuring memory read/write packets. */ Index: gdb/remote.h =================================================================== RCS file: /cvs/src/src/gdb/remote.h,v retrieving revision 1.17 diff -u -r1.17 remote.h --- gdb/remote.h 3 Jan 2009 05:57:53 -0000 1.17 +++ gdb/remote.h 24 Sep 2009 22:39:33 -0000 @@ -77,4 +77,7 @@ int remote_filename_p (const char *filename); +extern const char remote_break_sysrq_g[]; +extern const char *remote_break_mode; + #endif Index: gdb/doc/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/doc/ChangeLog,v retrieving revision 1.957 diff -u -r1.957 ChangeLog --- gdb/doc/ChangeLog 24 Sep 2009 17:49:56 -0000 1.957 +++ gdb/doc/ChangeLog 24 Sep 2009 22:39:37 -0000 @@ -1,3 +1,8 @@ +2009-09-24 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * gdb.texinfo: change the type of remotebreak. It may be one of + "interrutpt", "break" or "sysrq-g". + 2009-09-23 Joel Brobecker <brobecker@adacore.com> * observer.texi (solib_unloaded): Document explicitly the fact that Index: gdb/doc/gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.628 diff -u -r1.628 gdb.texinfo --- gdb/doc/gdb.texinfo 21 Sep 2009 12:48:36 -0000 1.628 +++ gdb/doc/gdb.texinfo 24 Sep 2009 22:39:50 -0000 @@ -14942,17 +14942,19 @@ @item set remotebreak @cindex interrupt remote programs -@cindex BREAK signal instead of Ctrl-C +@cindex select Ctrl-C, BREAK signal or BREAK g @anchor{set remotebreak} -If set to on, @value{GDBN} sends a @code{BREAK} signal to the remote -when you type @kbd{Ctrl-c} to interrupt the program running -on the remote. If set to off, @value{GDBN} sends the @samp{Ctrl-C} -character instead. The default is off, since most remote systems -expect to see @samp{Ctrl-C} as the interrupt signal. +Allow the user to specify what sequence to send to the remote +when he requests a program interruption: Although @kbd{Ctrl-c} is usually +what remote systems expect (this is the default, here), it is +sometimes preferable to send a @code{BREAK}. On other systems such +as the Linux kernel, a @code{BREAK} followed by @code{g}, which is +@code{Magic SysRq g} +is required in order to interrupt the execution. @item show remotebreak -Show whether @value{GDBN} sends @code{BREAK} or @samp{Ctrl-C} to -interrupt the remote program. +Show which of @samp{Ctrl-C}, @code{BREAK} or @code{BREAK} followed by @code{g} +is sent by @value{GDBN} to interrupt the remote program. @item set remoteflow on @itemx set remoteflow off @@ -29807,7 +29809,8 @@ @cindex interrupts (remote protocol) When a program on the remote target is running, @value{GDBN} may -attempt to interrupt it by sending a @samp{Ctrl-C} or a @code{BREAK}, +attempt to interrupt it by sending one of @samp{Ctrl-C}, @code{BREAK} or +@code{BREAK} followed by @code{g}, control of which is specified via @value{GDBN}'s @samp{remotebreak} setting (@pxref{set remotebreak}). ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-09-24 22:42 ` Caz Yokoyama @ 2009-09-25 16:06 ` Joel Brobecker 2009-09-26 3:43 ` Caz Yokoyama 0 siblings, 1 reply; 55+ messages in thread From: Joel Brobecker @ 2009-09-25 16:06 UTC (permalink / raw) To: Caz Yokoyama; +Cc: 'Pedro Alves', gdb-patches Caz, A couple of opening remarks: Is there any way you can quote emails using the standard '>' or '|' instead of using using '------------------'. This convention makes it harder to separate my text from your replies. The second remark is that the other Global Maintainers that I talked to about this, felt that sending (or not) the interrupt sequence when connecting to the target should be done independently of the actual interruption sequence. We all really like Daniel's (drow) suggestion: set/show remote interrupt-sequence <interrupt|BREAK|BREAK-g> set/show remote interrupt-after-connection [on|off] If "set remote interrupt-sequence interrupt" sounds weird, then perhaps we should go back to your initial suggestion of using "control-c". The last remark is that some of us felt that it was unusual to introduce some Linux-specific code in remote.c, and that this could be easily handled in a netcat-like wrapper. You'd then do: (gdb) target remote | kernel-wrapper /foo/device What do you think? We're not opposed to your patch, but the wrapper does have the advantage of allowing you to work with any debugger, including older versions of it :). > BREAK is usually all capitalized in chip manual because it is high level of > serial line for certain time. But I don't care weather capitalized or not. OK, let's use BREAK then. > +2009-09-23 Kazuyoshi Caz Yokoyama <caz@caztech.com> > + > + * remote.c: Allow the user to select one of ^C, a break or > + Magic SysRq g as the sequence to the remote in order to > + interrupt the execution. You'll have to be a little more detailed in the ChangeLog entry. Have a look at the ChangeLog file for tons of example on how we are expected to write them. > +/* Allow the user to specify what sequence to send to the remote > + when he requests a program interruption: Although ^C is usually > + what remote systems expect (this is the default, here), it is > + sometimes preferable to send a break. On other systems such > + as the Linux kernel, a break followed by g, which is Magic SysRq g > + is required in order to interrupt the execution. */ > +const char remote_break_interrupt[] = "interrutpt"; [etc] Can you change the name of this option and add the second option as per above? Also, still in line with having these two new commands, this makes the old "set remotedebug" command deprecated. To help users transition to the new set of commands, can you do the following: If the user tries to change the behavior using "set remotebreak", then issue a warning that this command is deprecated in favor of "set remote interrupt-...", and then change the set remote interrupt-sequence setting accordingly. If the user types "show remotebreak", then just emit the deprecated warning, but then either print nothing, or print the output that "show remote interrupt-sequence" would print. To achieve this, you will need: deprecate_cmd, and you'll need to use the set_fun/show_func arguments of the add_..._cmd function. > + fprintf_filtered (file, > + ("You are sending %s to the remote target " > + "which is not expected."), remote_break_mode); Let's replace that with an internal_error. > + /* Send the Magic SysRg g sequence in order to interrupt ^^^^^ typo: SysRq > + the execution of Linux kernel. */ > + if (remote_break_mode == remote_break_sysrq_g) > + { > + serial_send_break (remote_desc); > + serial_write (remote_desc, "g", 1); This block needs to be conditionalized on the second option. > + /* Send ^C, a break or a break g, depending on user preference. */ > + if (remote_break_mode == remote_break_interrupt) > + { > + serial_write (remote_desc, "\003", 1); > + } > + else if (remote_break_mode == remote_break_break) > + { > + serial_send_break (remote_desc); > + } If the if/while/etc block only contains one statement, then we prefer that the curly braces NOT be used. Can you remove them, please? > =================================================================== > RCS file: /cvs/src/src/gdb/remote.h,v > retrieving revision 1.17 > diff -u -r1.17 remote.h > --- gdb/remote.h 3 Jan 2009 05:57:53 -0000 1.17 > +++ gdb/remote.h 24 Sep 2009 22:39:33 -0000 > @@ -77,4 +77,7 @@ > > int remote_filename_p (const char *filename); > > +extern const char remote_break_sysrq_g[]; > +extern const char *remote_break_mode; > + > #endif I don't think you meant to make these changes (and they are not described in the ChangeLog). Just make sure you undo them in your local sandbox, to make sure you don't accidently check them in. > Index: gdb/doc/gdb.texinfo The documentation patch is reviewed by Eli. Can you also add an entry in the NEWS file describing the new commands, and explaining that the old "set/show remotebreak" commands are now deprecated? -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-09-25 16:06 ` Joel Brobecker @ 2009-09-26 3:43 ` Caz Yokoyama [not found] ` <535d47e30909260627n662135a1hf6d1a0bb33368b3a@mail.gmail.com> 0 siblings, 1 reply; 55+ messages in thread From: Caz Yokoyama @ 2009-09-26 3:43 UTC (permalink / raw) To: 'Joel Brobecker'; +Cc: 'Pedro Alves', gdb-patches [-- Attachment #1: Type: text/plain, Size: 5281 bytes --] Hello Joel, I revised my patch. As I wrote in ChangeLog, I expanded interrupt_sequence to arbitrary characters include ^C and BREAK instead of 3 choices. -caz -----Original Message----- From: Joel Brobecker [mailto:brobecker@adacore.com] Sent: Friday, September 25, 2009 9:06 AM To: Caz Yokoyama Cc: 'Pedro Alves'; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light Caz, A couple of opening remarks: Is there any way you can quote emails using the standard '>' or '|' instead of using using '------------------'. This convention makes it harder to separate my text from your replies. The second remark is that the other Global Maintainers that I talked to about this, felt that sending (or not) the interrupt sequence when connecting to the target should be done independently of the actual interruption sequence. We all really like Daniel's (drow) suggestion: set/show remote interrupt-sequence <interrupt|BREAK|BREAK-g> set/show remote interrupt-after-connection [on|off] If "set remote interrupt-sequence interrupt" sounds weird, then perhaps we should go back to your initial suggestion of using "control-c". The last remark is that some of us felt that it was unusual to introduce some Linux-specific code in remote.c, and that this could be easily handled in a netcat-like wrapper. You'd then do: (gdb) target remote | kernel-wrapper /foo/device What do you think? We're not opposed to your patch, but the wrapper does have the advantage of allowing you to work with any debugger, including older versions of it :). > BREAK is usually all capitalized in chip manual because it is high level of > serial line for certain time. But I don't care weather capitalized or not. OK, let's use BREAK then. > +2009-09-23 Kazuyoshi Caz Yokoyama <caz@caztech.com> > + > + * remote.c: Allow the user to select one of ^C, a break or > + Magic SysRq g as the sequence to the remote in order to > + interrupt the execution. You'll have to be a little more detailed in the ChangeLog entry. Have a look at the ChangeLog file for tons of example on how we are expected to write them. > +/* Allow the user to specify what sequence to send to the remote > + when he requests a program interruption: Although ^C is usually > + what remote systems expect (this is the default, here), it is > + sometimes preferable to send a break. On other systems such > + as the Linux kernel, a break followed by g, which is Magic SysRq g > + is required in order to interrupt the execution. */ > +const char remote_break_interrupt[] = "interrutpt"; [etc] Can you change the name of this option and add the second option as per above? Also, still in line with having these two new commands, this makes the old "set remotedebug" command deprecated. To help users transition to the new set of commands, can you do the following: If the user tries to change the behavior using "set remotebreak", then issue a warning that this command is deprecated in favor of "set remote interrupt-...", and then change the set remote interrupt-sequence setting accordingly. If the user types "show remotebreak", then just emit the deprecated warning, but then either print nothing, or print the output that "show remote interrupt-sequence" would print. To achieve this, you will need: deprecate_cmd, and you'll need to use the set_fun/show_func arguments of the add_..._cmd function. > + fprintf_filtered (file, > + ("You are sending %s to the remote target " > + "which is not expected."), remote_break_mode); Let's replace that with an internal_error. > + /* Send the Magic SysRg g sequence in order to interrupt ^^^^^ typo: SysRq > + the execution of Linux kernel. */ > + if (remote_break_mode == remote_break_sysrq_g) > + { > + serial_send_break (remote_desc); > + serial_write (remote_desc, "g", 1); This block needs to be conditionalized on the second option. > + /* Send ^C, a break or a break g, depending on user preference. */ > + if (remote_break_mode == remote_break_interrupt) > + { > + serial_write (remote_desc, "\003", 1); > + } > + else if (remote_break_mode == remote_break_break) > + { > + serial_send_break (remote_desc); > + } If the if/while/etc block only contains one statement, then we prefer that the curly braces NOT be used. Can you remove them, please? > =================================================================== > RCS file: /cvs/src/src/gdb/remote.h,v > retrieving revision 1.17 > diff -u -r1.17 remote.h > --- gdb/remote.h 3 Jan 2009 05:57:53 -0000 1.17 > +++ gdb/remote.h 24 Sep 2009 22:39:33 -0000 > @@ -77,4 +77,7 @@ > > int remote_filename_p (const char *filename); > > +extern const char remote_break_sysrq_g[]; > +extern const char *remote_break_mode; > + > #endif I don't think you meant to make these changes (and they are not described in the ChangeLog). Just make sure you undo them in your local sandbox, to make sure you don't accidently check them in. > Index: gdb/doc/gdb.texinfo The documentation patch is reviewed by Eli. Can you also add an entry in the NEWS file describing the new commands, and explaining that the old "set/show remotebreak" commands are now deprecated? -- Joel [-- Attachment #2: remotebreak.patch --] [-- Type: application/octet-stream, Size: 7593 bytes --] Index: gdb/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.10906 diff -u -r1.10906 ChangeLog --- gdb/ChangeLog 25 Sep 2009 21:39:52 -0000 1.10906 +++ gdb/ChangeLog 26 Sep 2009 03:38:17 -0000 @@ -1,3 +1,24 @@ +2009-09-25 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * remote.c: Add a new remote variable, interrupt_sequence and + interrupt-on-start. interrupt_sequence provides arbitrary number of + characters include Ctrl-C to the remote target to stop the execution + of the program on the target. Not only characters but it also send + BREAK signal to the target. For example, + ^C: ASCII ETX character (Ctrl-c, 0x03) + BREAK: BREAK signal + BREAK-g: BREAK signal and 'g' which is Magic SysRq which interrupt + the execution of Linux kernel + abcdef: ASCII character, abcdef + abc-xyz: ASCII character, abcxyz + remotebreak is deprecated even though it is still available. It switches + ^C and BREAK. + interrupt-on-start is a boolean variable and controls whether + interrupt_sequence is sent when gdb starts. When you debug Linux kernel, + you probably do + set remote interrupt-sequence BREAK-g + set remote interrupt-on-start on + 2009-09-25 Tom Tromey <tromey@redhat.com> PR python/10664: Index: gdb/remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.372 diff -u -r1.372 remote.c --- gdb/remote.c 10 Sep 2009 22:47:56 -0000 1.372 +++ gdb/remote.c 26 Sep 2009 03:38:20 -0000 @@ -546,13 +546,66 @@ this can go away. */ static int wait_forever_enabled_p = 1; +/* Interrupt sequence to the remote target to interrupt the program + or OS. */ + +#define CTRL_C "^C" /* default of interrupt_sequence */ +#define BREAK "BREAK" +static char *interrupt_sequence = NULL; + +/* This boolean variable specifies whether interrupt_sequence is sent + to remote target when gdb starts. This is mostly needed when you debug + Linux kernel. Linux kernel expects BREAK g which is Magic SysRq for + connecting gdb. + */ +static int interrupt_on_start = 0; /* This variable chooses whether to send a ^C or a break when the user requests program interruption. Although ^C is usually what remote systems expect, and that is the default here, sometimes a break is preferable instead. */ -static int remote_break; +static int remote_break = 0; + +static void +set_remote_break (char *args, int from_tty, struct cmd_list_element *c) +{ + if (strcmp(interrupt_sequence, CTRL_C) == 0) + { + interrupt_sequence = xmalloc(sizeof(BREAK) + 1); + strcpy(interrupt_sequence, BREAK); + remote_break = 1; + } + else if (strcmp(interrupt_sequence, BREAK) == 0) + { + interrupt_sequence = xmalloc(sizeof(CTRL_C) + 1); + strcpy(interrupt_sequence, CTRL_C); + remote_break = 0; + } +#if 0 + fprintf_filtered (file, _("\ +Deprecated. Use interrupt_sequence instead.")); +#endif +} + +static void +show_remote_break (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value) +{ + if (strcmp(interrupt_sequence, CTRL_C) == 0) + fprintf_filtered (file, _("\ +Whether to send break if interrupted is off.\n\ +Deprecated. Use set remote interrupt_sequence instead.\n")); + else if (strcmp(interrupt_sequence, "BREAK") == 0) + fprintf_filtered (file, _("\ +Whether to send break if interrupted is on.\n\ +Deprecated. Use set remote interrupt_sequence instead.\n")); + else + fprintf_filtered (file, _("\ +Sending %s as interrupt_sequence.\n\ +Deprecated. Use interrupt_sequence instead.\n"), interrupt_sequence); +} /* Descriptor for I/O to remote machine. Initialize it to NULL so that remote_open knows that we don't have a file open when the program @@ -2585,6 +2638,38 @@ int extended_p; }; +/* + Send interrupt_sequence to remote target. +*/ +static void +send_interrupt_sequence () +{ + char *b, *p, ch; + + b = xmalloc (strlen(interrupt_sequence) + 1); + if (b == NULL) + internal_error (__FILE__, __LINE__, + _("can't allocate b in send_interrupt_sequence()")); + strcpy (b, interrupt_sequence); + for (p = strtok (b, "-"); + p; p = strtok(NULL, "-")) + { + if (strcmp(p, CTRL_C) == 0) + serial_write (remote_desc, "\x03", 1); + else if (strcmp(p, "BREAK") == 0) + serial_send_break (remote_desc); + else if (*p == '\\') + { + sscanf (p, "%c", &ch); + serial_write (remote_desc, &ch, 1); + } + else + serial_write (remote_desc, p, strlen(p)); + } + + xfree (b); +} + static void remote_start_remote (struct ui_out *uiout, void *opaque) { @@ -2598,6 +2683,12 @@ /* Ack any packet which the remote side has already sent. */ serial_write (remote_desc, "+", 1); + /* Interrupt_sequence is sent to remote target when gdb starts. + This is mostly needed when you debug Linux kernel. + Linux kernel expects BREAK g which is Magic SysRq for connecting gdb. */ + if (interrupt_on_start) + send_interrupt_sequence (); + /* The first packet we send to the target is the optional "supported packets" request. If the target can answer this, it will tell us which later probes to skip. */ @@ -4021,12 +4112,8 @@ if (rs->cached_wait_status) return; - /* Send a break or a ^C, depending on user preference. */ - - if (remote_break) - serial_send_break (remote_desc); - else - serial_write (remote_desc, "\003", 1); + /* Send interrupt_sequence to remote target. */ + send_interrupt_sequence(); } /* This is the generic stop called via the target vector. When a target @@ -9056,13 +9143,33 @@ terminating `#' character and checksum."), &maintenancelist); - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ + add_setshow_boolean_cmd ("remotebreak", class_obscure, &remote_break, _("\ Set whether to send break if interrupted."), _("\ Show whether to send break if interrupted."), _("\ If set, a break, instead of a cntrl-c, is sent to the remote target."), - NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is %s. */ + set_remote_break, show_remote_break, &setlist, &showlist); + /* When set command is called for the item which is defined by + add_setshow_string_cmd, a string is freed when the string is not NULL + even it is set by initialization. */ + interrupt_sequence = xmalloc(sizeof(CTRL_C) + 1); + strcpy(interrupt_sequence, CTRL_C); + add_setshow_string_noescape_cmd ("interrupt-sequence", class_support, + &interrupt_sequence, _("\ +Set interrupt sequence to remote target."), _("\ +Show interrupt sequence to remote target."), _("\ +\\xNN, ^C and BREAK are interpreted as appropriately."), + NULL, NULL, + &remote_set_cmdlist, &remote_show_cmdlist); + + add_setshow_boolean_cmd ("interrupt-on-start", no_class, &interrupt_on_start, _("\ +Set whether to send interrupt sequence when gdb starts."), _(" \ +Show whether to send interrupt sequence when gdb starts."), _(" \ +If set, interrupt sequence is sent to the remote target."), + NULL, NULL, + &remote_set_cmdlist, &remote_show_cmdlist); + /* Install commands for configuring memory read/write packets. */ add_cmd ("remotewritesize", no_class, set_memory_write_packet_size, _("\ ^ permalink raw reply [flat|nested] 55+ messages in thread
[parent not found: <535d47e30909260627n662135a1hf6d1a0bb33368b3a@mail.gmail.com>]
* Re: symbolic debug of loadable modules with kgdb light [not found] ` <535d47e30909260627n662135a1hf6d1a0bb33368b3a@mail.gmail.com> @ 2009-09-29 1:58 ` Joel Brobecker 2009-09-29 3:23 ` Caz Yokoyama 0 siblings, 1 reply; 55+ messages in thread From: Joel Brobecker @ 2009-09-29 1:58 UTC (permalink / raw) To: caz yokoyama; +Cc: Pedro Alves, gdb-patches > > I revised my patch. As I wrote in ChangeLog, I expanded interrupt_sequence > > to arbitrary characters include ^C and BREAK instead of 3 choices. Actually, I'm sorry, but I don't agree with this change. I don't think it's providing much in terms of user experience and your implementation has many downsides: The command hander no longer verifies that the user enters valid values (the user finds this out later when connecting to the target or possibly only when requesting an interrupt; either way, it's too late), you lose tab-completion, and your implementation of send_interrupt_sequence becomes unecessarily complex and inefficient as a result. > -static int remote_break; > +static int remote_break = 0; > + > +static void > +set_remote_break (char *args, int from_tty, struct cmd_list_element *c) > +{ > + if (strcmp (interrupt_sequence, CTRL_C) == 0) > + { > + interrupt_sequence = xmalloc (sizeof(BREAK) + 1); > + strcpy (interrupt_sequence, BREAK); > + remote_break = 1; > + } > + else > + { > + interrupt_sequence = xmalloc (sizeof(CTRL_C) + 1); > + strcpy (interrupt_sequence, CTRL_C); > + remote_break = 0; > + } > +} What we are trying to achieve, here, is make things work for a user that was used to using "set remotebreak" while yet telling him which command should now be used instead. In other words, "set remotebreak on" should act as if the user entered "set remote interrupt-sequence BREAK" and "set remotebreak off" should act as if the user entered "set remote interrupt-sequence control-c". The code itself should *ignore* the boolean that set/show remotebreak use internally, and use the "enum" that "set remote interrupt-sequence" uses instead. Calling deprecate_cmd on the cmd_list_element structs associcated to the set/show remotebreak commands will make sure that the user is informed which commands are replacing these commands, and allows us to remove them eventually, once users have had a chance to transition to the new ones. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-09-29 1:58 ` Joel Brobecker @ 2009-09-29 3:23 ` Caz Yokoyama 2009-09-29 4:22 ` Joel Brobecker 0 siblings, 1 reply; 55+ messages in thread From: Caz Yokoyama @ 2009-09-29 3:23 UTC (permalink / raw) To: 'Joel Brobecker'; +Cc: 'Pedro Alves', gdb-patches Hello Joel, I understand 1) You don't want to introduce dependency of the target into gdb 2) You want to check whether the user enters correct setting to interrupt_sequence. In case of debugging user space program, interrupt_sequence is always ^C. However, when we debug kernel, interrupt_sequence is varied from kernel to kernel. It means interrupt_sequence depends on each kernel. To check correctness of interrupt_sequence, we have to know which kernel we are debugging. It introduces dependency of kernel. As the result, it is impossible to satisfy both 1) and 2). I give up. Thank you for reviewing my patches. -caz -----Original Message----- From: Joel Brobecker [mailto:brobecker@adacore.com] Sent: Monday, September 28, 2009 6:59 PM To: caz yokoyama Cc: Pedro Alves; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light > > I revised my patch. As I wrote in ChangeLog, I expanded interrupt_sequence > > to arbitrary characters include ^C and BREAK instead of 3 choices. Actually, I'm sorry, but I don't agree with this change. I don't think it's providing much in terms of user experience and your implementation has many downsides: The command hander no longer verifies that the user enters valid values (the user finds this out later when connecting to the target or possibly only when requesting an interrupt; either way, it's too late), you lose tab-completion, and your implementation of send_interrupt_sequence becomes unecessarily complex and inefficient as a result. > -static int remote_break; > +static int remote_break = 0; > + > +static void > +set_remote_break (char *args, int from_tty, struct cmd_list_element *c) > +{ > + if (strcmp (interrupt_sequence, CTRL_C) == 0) > + { > + interrupt_sequence = xmalloc (sizeof(BREAK) + 1); > + strcpy (interrupt_sequence, BREAK); > + remote_break = 1; > + } > + else > + { > + interrupt_sequence = xmalloc (sizeof(CTRL_C) + 1); > + strcpy (interrupt_sequence, CTRL_C); > + remote_break = 0; > + } > +} What we are trying to achieve, here, is make things work for a user that was used to using "set remotebreak" while yet telling him which command should now be used instead. In other words, "set remotebreak on" should act as if the user entered "set remote interrupt-sequence BREAK" and "set remotebreak off" should act as if the user entered "set remote interrupt-sequence control-c". The code itself should *ignore* the boolean that set/show remotebreak use internally, and use the "enum" that "set remote interrupt-sequence" uses instead. Calling deprecate_cmd on the cmd_list_element structs associcated to the set/show remotebreak commands will make sure that the user is informed which commands are replacing these commands, and allows us to remove them eventually, once users have had a chance to transition to the new ones. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-09-29 3:23 ` Caz Yokoyama @ 2009-09-29 4:22 ` Joel Brobecker 2009-09-29 4:58 ` Caz Yokoyama 0 siblings, 1 reply; 55+ messages in thread From: Joel Brobecker @ 2009-09-29 4:22 UTC (permalink / raw) To: Caz Yokoyama; +Cc: 'Pedro Alves', gdb-patches > However, when we debug kernel, interrupt_sequence is varied from kernel to > kernel. It means interrupt_sequence depends on each kernel. To check > correctness of interrupt_sequence, we have to know which kernel we are > debugging. It introduces dependency of kernel. As the result, it is > impossible to satisfy both 1) and 2). I give up. Thank you for reviewing my > patches. You have to believe me when I say that I'm very sorry to hear that. We've both invested a lot of time on these patches, it's a shame to give up when we're so close to a solution. There was one part that I wasn't aware of until you mentioned it, which is the fact that the interrupt sequence varies from kernel to kernel. We can discuss a solution to that issue if you tell us what the possible variations are. Please let us also know if you'd prefer someone else to review your patches. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-09-29 4:22 ` Joel Brobecker @ 2009-09-29 4:58 ` Caz Yokoyama 2009-09-29 5:19 ` Joel Brobecker 0 siblings, 1 reply; 55+ messages in thread From: Caz Yokoyama @ 2009-09-29 4:58 UTC (permalink / raw) To: 'Joel Brobecker'; +Cc: 'Pedro Alves', gdb-patches Hello Joel, >We can discuss a solution to that issue if you tell us what the possible >variations are. I know Magic SysRq is the one for Linux kernel. I planned to propose BREAK for Xen hypervisor if my patch were approved. I don't know what interrupt_sequence is on other OSes. However, I believe that introducing the possible variations into gdb is not your intention. You don't want to change the code when OS changes its interrupt_sequence or supporting new OS. >Please let us also know if you'd prefer someone else to review your patches. I am new to gdb mailing list. I know nobody who is a maintainer of gdb. -caz -----Original Message----- From: Joel Brobecker [mailto:brobecker@adacore.com] Sent: Monday, September 28, 2009 9:22 PM To: Caz Yokoyama Cc: 'Pedro Alves'; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light > However, when we debug kernel, interrupt_sequence is varied from kernel to > kernel. It means interrupt_sequence depends on each kernel. To check > correctness of interrupt_sequence, we have to know which kernel we are > debugging. It introduces dependency of kernel. As the result, it is > impossible to satisfy both 1) and 2). I give up. Thank you for reviewing my > patches. You have to believe me when I say that I'm very sorry to hear that. We've both invested a lot of time on these patches, it's a shame to give up when we're so close to a solution. There was one part that I wasn't aware of until you mentioned it, which is the fact that the interrupt sequence varies from kernel to kernel. We can discuss a solution to that issue if you tell us what the possible variations are. Please let us also know if you'd prefer someone else to review your patches. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-09-29 4:58 ` Caz Yokoyama @ 2009-09-29 5:19 ` Joel Brobecker 2009-09-29 16:12 ` Caz Yokoyama 0 siblings, 1 reply; 55+ messages in thread From: Joel Brobecker @ 2009-09-29 5:19 UTC (permalink / raw) To: Caz Yokoyama; +Cc: 'Pedro Alves', gdb-patches > I know Magic SysRq is the one for Linux kernel. I planned to propose BREAK > for Xen hypervisor if my patch were approved. I don't know what > interrupt_sequence is on other OSes. However, I believe that introducing the > possible variations into gdb is not your intention. You don't want to change > the code when OS changes its interrupt_sequence or supporting new OS. In my opinion, if you have a debugger that works with BREAK, this will help supporting your suggestion to use BREAK. If you want extensibility while at the same time being able to check the value entered by the user, then perhaps the solution is with the use of an XML file, similar to what has been done for the "catch syscall" command. I am not very familiar with this part of the debugger, but other maintainers are. However, I think you're worriying about something that may or may not become an issue. I'm not saying it is a bad thing, but you have something that's very close to acceptable and will work for your current situation (current Linux kernel). Was it Lean Programming that said fix a weakness only when it becomes an issue? With the current proposed user interface, I believe we should be able to expand the implementation to accomodate other various sequences. > >Please let us also know if you'd prefer someone else to review your > patches. > I am new to gdb mailing list. I know nobody who is a maintainer of gdb. What I meant to imply is that, if you think there is a problem with my reviews, I can ask someone else from the group of maintainers to take over this thread. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-09-29 5:19 ` Joel Brobecker @ 2009-09-29 16:12 ` Caz Yokoyama 2009-09-29 16:39 ` Joel Brobecker 0 siblings, 1 reply; 55+ messages in thread From: Caz Yokoyama @ 2009-09-29 16:12 UTC (permalink / raw) To: 'Joel Brobecker'; +Cc: 'Pedro Alves', gdb-patches Hello Joel, Do you think we have to check correctness of user input for interrupt_sequence? Setting-up debugging environment of Linux device driver by gdb is not a trivial task for the first timer. Connect serial port, validate its connection, modify menu.lst, reboot, re-compile device driver with -g -O0. It took 2 weeks in my case. I recently consults 2 people who set-up Linux device driver debugging environment who failed. The people who debug device driver are not tape monkeys. They prefer flexibility. At the same time, almost only people who touch interrupt_sequence are kernel developers. Therefore, I prefer send_interrupt_sequence () which does not have kernel dependency and has flexibility of user setting. -caz -----Original Message----- From: Joel Brobecker [mailto:brobecker@adacore.com] Sent: Monday, September 28, 2009 10:19 PM To: Caz Yokoyama Cc: 'Pedro Alves'; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light > I know Magic SysRq is the one for Linux kernel. I planned to propose BREAK > for Xen hypervisor if my patch were approved. I don't know what > interrupt_sequence is on other OSes. However, I believe that introducing the > possible variations into gdb is not your intention. You don't want to change > the code when OS changes its interrupt_sequence or supporting new OS. In my opinion, if you have a debugger that works with BREAK, this will help supporting your suggestion to use BREAK. If you want extensibility while at the same time being able to check the value entered by the user, then perhaps the solution is with the use of an XML file, similar to what has been done for the "catch syscall" command. I am not very familiar with this part of the debugger, but other maintainers are. However, I think you're worriying about something that may or may not become an issue. I'm not saying it is a bad thing, but you have something that's very close to acceptable and will work for your current situation (current Linux kernel). Was it Lean Programming that said fix a weakness only when it becomes an issue? With the current proposed user interface, I believe we should be able to expand the implementation to accomodate other various sequences. > >Please let us also know if you'd prefer someone else to review your > patches. > I am new to gdb mailing list. I know nobody who is a maintainer of gdb. What I meant to imply is that, if you think there is a problem with my reviews, I can ask someone else from the group of maintainers to take over this thread. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-09-29 16:12 ` Caz Yokoyama @ 2009-09-29 16:39 ` Joel Brobecker 2009-09-30 4:45 ` Caz Yokoyama 0 siblings, 1 reply; 55+ messages in thread From: Joel Brobecker @ 2009-09-29 16:39 UTC (permalink / raw) To: Caz Yokoyama; +Cc: 'Pedro Alves', gdb-patches > Do you think we have to check correctness of user input for > interrupt_sequence? Yes, if only for the vast majority of users who will be using either the default or using BREAK. > Setting-up debugging environment of Linux device driver by gdb is not > a trivial task I don't doubt that, and I do not doubt that users prefer flexibility. The current solution, which offers the user 3 choices for the interrupt sequence, has no kernel dependency. It's very clear what each choices does, and I do not understand how allowing free text instead of a defined set of choices helps make things easier, especially when only specific choices will actually be accepted in the end. You are arguing that we may need more choices in the future. I answered that we can worry about that later, *when/if* the situation actually arises. Adding more choices is a matter of seconds with a 10-line patch. But, again, I also repeat that, if you think this is unnacceptable, then perhaps we can accomodate extensibility while not needing code recompilation by using a technical solution based on XML. You can have a look at how "catch syscall" is implemented for an illustration. But this can be done as a second phase, after the patch on which you've been working on is approved and checked in. In other words: 1. Implement a patch that adds: set/show remote interrupt-sequence <control-c|BREAK|BREAK-g> set/show remote interrupt-at-startup [on|off] Make the old set/show remotedebug deprecated (please take a look at my earlier reply on what I mean by that) 2. Look into adding extensibility through the use of an XML file If you prefer to do all the work in one patch, you are welcome to do so, but you are letting the best be the enemy of good, IMO, and only delaying the time when vanilla FSF GDB can debug Linux Kernel modules. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-09-29 16:39 ` Joel Brobecker @ 2009-09-30 4:45 ` Caz Yokoyama 2009-09-30 17:28 ` Joel Brobecker 2009-09-30 19:16 ` Eli Zaretskii 0 siblings, 2 replies; 55+ messages in thread From: Caz Yokoyama @ 2009-09-30 4:45 UTC (permalink / raw) To: 'Joel Brobecker'; +Cc: 'Pedro Alves', gdb-patches [-- Attachment #1: Type: text/plain, Size: 2233 bytes --] Hello Joel, Here is the patch for 1. Let me know if I forget something. Also any comments are welcome. Thank you. -caz -----Original Message----- From: Joel Brobecker [mailto:brobecker@adacore.com] Sent: Tuesday, September 29, 2009 9:39 AM To: Caz Yokoyama Cc: 'Pedro Alves'; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light > Do you think we have to check correctness of user input for > interrupt_sequence? Yes, if only for the vast majority of users who will be using either the default or using BREAK. > Setting-up debugging environment of Linux device driver by gdb is not > a trivial task I don't doubt that, and I do not doubt that users prefer flexibility. The current solution, which offers the user 3 choices for the interrupt sequence, has no kernel dependency. It's very clear what each choices does, and I do not understand how allowing free text instead of a defined set of choices helps make things easier, especially when only specific choices will actually be accepted in the end. You are arguing that we may need more choices in the future. I answered that we can worry about that later, *when/if* the situation actually arises. Adding more choices is a matter of seconds with a 10-line patch. But, again, I also repeat that, if you think this is unnacceptable, then perhaps we can accomodate extensibility while not needing code recompilation by using a technical solution based on XML. You can have a look at how "catch syscall" is implemented for an illustration. But this can be done as a second phase, after the patch on which you've been working on is approved and checked in. In other words: 1. Implement a patch that adds: set/show remote interrupt-sequence <control-c|BREAK|BREAK-g> set/show remote interrupt-at-startup [on|off] Make the old set/show remotedebug deprecated (please take a look at my earlier reply on what I mean by that) 2. Look into adding extensibility through the use of an XML file If you prefer to do all the work in one patch, you are welcome to do so, but you are letting the best be the enemy of good, IMO, and only delaying the time when vanilla FSF GDB can debug Linux Kernel modules. -- Joel [-- Attachment #2: remotebreak.patch --] [-- Type: application/octet-stream, Size: 13066 bytes --] Index: gdb/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.10923 diff -u -r1.10923 ChangeLog --- gdb/ChangeLog 29 Sep 2009 16:27:05 -0000 1.10923 +++ gdb/ChangeLog 30 Sep 2009 04:41:50 -0000 @@ -1,3 +1,13 @@ +2009-09-29 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * remote.c: Allow the user to select one of ^C, a break or + Magic SysRq g as the sequence to the remote in order to + interrupt the execution. The syntax is + set remote interrupt-sequence [control-c | break | sysrq-g] + control-c is a default. Some system prefers break which is high level of + serial line for some certain time. Linux kernel prefers sysrq-g, a.k.a + Magic SysRq. It is break signal and character 'g'. + 2009-09-29 Jan Kratochvil <jan.kratochvil@redhat.com> * ia64-tdep.c (ia64_convert_from_func_ptr_addr): New variable buf. Index: gdb/NEWS =================================================================== RCS file: /cvs/src/src/gdb/NEWS,v retrieving revision 1.331 diff -u -r1.331 NEWS --- gdb/NEWS 15 Sep 2009 03:30:04 -0000 1.331 +++ gdb/NEWS 30 Sep 2009 04:41:52 -0000 @@ -3,6 +3,15 @@ *** Changes since GDB 6.8 +* "set/show remotebreak" command is deprecated. "set/show remote interrupt-sequence" +is added. They add break signal followed by a character 'g' in addition to control-c +and a break signal. break signal and g is also known as Magic SysRq and it interrupts +Linux kernel. + +* "set/show remote interrupt-on-start" command is added. When this is ON, +gdb sends interrupt-sequence to the remote target when gdb starts. This is needed when +you debug Linux kernel. + * GDB now has an interface for JIT compilation. Applications that dynamically generate code can create symbol files in memory and register them with GDB. For users, the feature should work transparently, and Index: gdb/remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.372 diff -u -r1.372 remote.c --- gdb/remote.c 10 Sep 2009 22:47:56 -0000 1.372 +++ gdb/remote.c 30 Sep 2009 04:41:54 -0000 @@ -546,14 +546,83 @@ this can go away. */ static int wait_forever_enabled_p = 1; +/* Allow the user to specify what sequence to send to the remote + when he requests a program interruption: Although ^C is usually + what remote systems expect (this is the default, here), it is + sometimes preferable to send a break. On other systems such + as the Linux kernel, a break followed by g, which is Magic SysRq g + is required in order to interrupt the execution. */ +const char interrupt_sequence_control_c[] = "control-c"; +const char interrupt_sequence_break[] = "break"; +const char interrupt_sequence_sysrq_g[] = "sysrq-g"; +static const char *interrupt_sequence_modes[] = + { + interrupt_sequence_control_c, + interrupt_sequence_break, + interrupt_sequence_sysrq_g, + NULL + }; +const char *interrupt_sequence_mode = interrupt_sequence_control_c; + +static void show_interrupt_sequence (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value) +{ + if (interrupt_sequence_mode == interrupt_sequence_control_c) + fprintf_filtered (file, + _("Send the ASCII ETX character (Ctrl-c) " + "to the remote target to interrupt the " + "execution of the program.\n")); + else if (interrupt_sequence_mode == interrupt_sequence_break) + fprintf_filtered (file, + _("send a break signal to the remote target " + "to interrupt the execution of the program.\n")); + else if (interrupt_sequence_mode == interrupt_sequence_sysrq_g) + fprintf_filtered (file, + _("Send a break signal and 'g' a.k.a. sysrq-g and Magic SysRq to " + "the remote target to interrupt the execution " + "of Linux kernel.\n")); + else + internal_error (__FILE__, __LINE__, + _("You are sending unexpected %s to the remote target."), + interrupt_sequence_mode); +} + +/* This boolean variable specifies whether interrupt_sequence is sent + to remote target when gdb starts. This is mostly needed when you debug + Linux kernel. Linux kernel expects BREAK g which is Magic SysRq for + connecting gdb. + */ +static int interrupt_on_start = 0; /* This variable chooses whether to send a ^C or a break when the user requests program interruption. Although ^C is usually what remote systems expect, and that is the default here, sometimes a break is preferable instead. */ - static int remote_break; +static void set_remotebreak (char *args, int from_tty, struct cmd_list_element *c) +{ + printf_filtered (_("%s\n"), c->doc); + if (interrupt_sequence_mode == interrupt_sequence_control_c) + { + interrupt_sequence_mode = interrupt_sequence_break; + remote_break = 0; + } + else + { + interrupt_sequence_mode = interrupt_sequence_control_c; + remote_break = 1; + } +} + +static void show_remotebreak (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value) +{ + fprintf_filtered (file, _("%s\n"), c->doc); +} + /* Descriptor for I/O to remote machine. Initialize it to NULL so that remote_open knows that we don't have a file open when the program starts. */ @@ -2585,6 +2654,23 @@ int extended_p; }; +/* + Send interrupt_sequence to remote target. +*/ +static void +send_interrupt_sequence () +{ + if (interrupt_sequence_mode == interrupt_sequence_control_c) + serial_write (remote_desc, "\x03", 1); + else if (interrupt_sequence_mode == interrupt_sequence_break) + serial_send_break (remote_desc); + else if (interrupt_sequence_mode == interrupt_sequence_sysrq_g) + { + serial_send_break (remote_desc); + serial_write (remote_desc, "g", 1); + } +} + static void remote_start_remote (struct ui_out *uiout, void *opaque) { @@ -2598,6 +2684,12 @@ /* Ack any packet which the remote side has already sent. */ serial_write (remote_desc, "+", 1); + /* Interrupt_sequence is sent to remote target when gdb starts. + This is mostly needed when you debug Linux kernel. + Linux kernel expects BREAK g which is Magic SysRq for connecting gdb. */ + if (interrupt_on_start) + send_interrupt_sequence (); + /* The first packet we send to the target is the optional "supported packets" request. If the target can answer this, it will tell us which later probes to skip. */ @@ -4021,12 +4113,8 @@ if (rs->cached_wait_status) return; - /* Send a break or a ^C, depending on user preference. */ - - if (remote_break) - serial_send_break (remote_desc); - else - serial_write (remote_desc, "\003", 1); + /* Send interrupt_sequence to remote target. */ + send_interrupt_sequence (); } /* This is the generic stop called via the target vector. When a target @@ -9056,13 +9144,30 @@ terminating `#' character and checksum."), &maintenancelist); - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ -Set whether to send break if interrupted."), _("\ -Show whether to send break if interrupted."), _("\ + add_setshow_boolean_cmd ("remotebreak", class_obscure, &remote_break, _("\ +Deprecated. Use \"set remote interrupt-sequence [control-c|break]\" instead."), _("\ +Deprecated. Use \"show remote interrupt-sequence\" instead."), _("\ If set, a break, instead of a cntrl-c, is sent to the remote target."), - NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is %s. */ + set_remotebreak, show_remotebreak, &setlist, &showlist); + add_setshow_enum_cmd ("interrupt-sequence", class_support, + interrupt_sequence_modes, &interrupt_sequence_mode, _("\ +Set interrupt sequence to remote target, control-c/break/sysrq-g."), _("\ +Show interrupt sequence to remote target."), + NULL, + NULL, show_interrupt_sequence, + &remote_set_cmdlist, + &remote_show_cmdlist); + + add_setshow_boolean_cmd ("interrupt-on-start", class_support, + &interrupt_on_start, _("\ +Set whether to send interrupt sequence when gdb starts."), _(" \ +Show whether to send interrupt sequence when gdb starts."), _(" \ +If set, interrupt sequence is sent to the remote target."), + NULL, NULL, + &remote_set_cmdlist, &remote_show_cmdlist); + /* Install commands for configuring memory read/write packets. */ add_cmd ("remotewritesize", no_class, set_memory_write_packet_size, _("\ Index: gdb/doc/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/doc/ChangeLog,v retrieving revision 1.958 diff -u -r1.958 ChangeLog --- gdb/doc/ChangeLog 26 Sep 2009 16:47:13 -0000 1.958 +++ gdb/doc/ChangeLog 30 Sep 2009 04:41:58 -0000 @@ -1,3 +1,9 @@ +2009-09-29 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * gdb.texinfo: remove "set/show remotebreak" command. + Add "set/show remote interrupt-sequence" and + "set/show remote interrupt-on-start" command. + 2009-09-26 Pierre Muller <muller@ics.u-strasbg.fr> * gdb.texinfo (Cygwin Native): Mention support for Ctrl-BREAK. Index: gdb/doc/gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.629 diff -u -r1.629 gdb.texinfo --- gdb/doc/gdb.texinfo 26 Sep 2009 16:47:13 -0000 1.629 +++ gdb/doc/gdb.texinfo 30 Sep 2009 04:42:11 -0000 @@ -14940,20 +14940,6 @@ @item show remotebaud Show the current speed of the remote connection. -@item set remotebreak -@cindex interrupt remote programs -@cindex BREAK signal instead of Ctrl-C -@anchor{set remotebreak} -If set to on, @value{GDBN} sends a @code{BREAK} signal to the remote -when you type @kbd{Ctrl-c} to interrupt the program running -on the remote. If set to off, @value{GDBN} sends the @samp{Ctrl-C} -character instead. The default is off, since most remote systems -expect to see @samp{Ctrl-C} as the interrupt signal. - -@item show remotebreak -Show whether @value{GDBN} sends @code{BREAK} or @samp{Ctrl-C} to -interrupt the remote program. - @item set remoteflow on @itemx set remoteflow off @kindex set remoteflow @@ -15011,6 +14997,34 @@ target system. If it is not set, the target will use a default filename (e.g.@: the last program run). +@item set interrupt-sequence +@cindex interrupt remote programs +@cindex select control-c, break or sysrq-g +@anchor{set interrupt-sequence} +Allow the user to specify what sequence to send to the remote target +when he requests a program interruption: Although @kbd{control-c} is usually +what remote systems expect (this is the default, here), it is +sometimes preferable to send a @code{break}. On other systems such +as the Linux kernel, a @code{break} followed by @code{g}, which is +@code{Magic SysRq g} +is required in order to interrupt the execution. + +@item show interrupt-sequence +Show which of @samp{Ctrl-C}, @code{break} or @code{break} followed by @code{g} +is sent by @value{GDBN} to interrupt the remote program. + +@item set interrupt-on-start +@cindex send interrupt-sequence on start +@anchor{set interrupt-on-start} +Specify whether interrupt_sequence is sent +to remote target when gdb starts. This is mostly needed when you debug +@code{Linux kernel}. Linux kernel expects @code{BREAK g} which is @code{Magic SysRq} +in order to connect gdb. + +@item show interrupt-on-start +Show whether interrupt_sequence is sent +to remote target when gdb starts. + @kindex set tcp @kindex show tcp @item set tcp auto-retry on @@ -29817,9 +29831,9 @@ @cindex interrupts (remote protocol) When a program on the remote target is running, @value{GDBN} may -attempt to interrupt it by sending a @samp{Ctrl-C} or a @code{BREAK}, -control of which is specified via @value{GDBN}'s @samp{remotebreak} -setting (@pxref{set remotebreak}). +attempt to interrupt it by sending a @samp{Ctrl-C}, @samp{BREAK} or a @samp{BREAK g}, +control of which is specified via @value{GDBN}'s @samp{interrupt-sequence} +setting (@pxref{set remote interrupt-sequence}). The precise meaning of @code{BREAK} is defined by the transport mechanism and may, in fact, be undefined. @value{GDBN} does not @@ -29836,6 +29850,10 @@ (@pxref{X packet}), used for binary downloads, may include an unescaped @code{0x03} as part of its packet. +@code{BREAK g} is also known as Magic SysRq and is @code{BREAK} and character 'g'. +When Linux kernel receives this sequence from serial port, it stops execution and +connects to gdb. + Stubs are not required to recognize these interrupt mechanisms and the precise meaning associated with receipt of the interrupt is implementation defined. If the target supports debugging of multiple ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-09-30 4:45 ` Caz Yokoyama @ 2009-09-30 17:28 ` Joel Brobecker 2009-09-30 19:16 ` Eli Zaretskii 1 sibling, 0 replies; 55+ messages in thread From: Joel Brobecker @ 2009-09-30 17:28 UTC (permalink / raw) To: Caz Yokoyama; +Cc: 'Pedro Alves', gdb-patches Caz, > 2009-09-29 Kazuyoshi Caz Yokoyama <caz@caztech.com> > > * remote.c: Allow the user to select one of ^C, a break or > Magic SysRq g as the sequence to the remote in order to > interrupt the execution. The syntax is > set remote interrupt-sequence [control-c | break | sysrq-g] > control-c is a default. Some system prefers break which is high level of > serial line for some certain time. Linux kernel prefers sysrq-g, a.k.a > Magic SysRq. It is break signal and character 'g'. You're missing an entry for the NEWS file (but good thinking on updating this file!). This part will be reviewed by a different maintainer (Eli), so I won't look at it personally. Same for the documentation changes. For the changes to remote.c, unfortunately, you'll have to describe the changes on a per-entity basis. For instance: * remote.c (interrupt_sequence_control_c) (interrupt_sequence_break, interrupt_sequence_sysrq_g) (interrupt_sequence_modes): New constants. (interrupt_sequence_mode): New global variable. (show_interrupt_sequence): New function. [...] (remote_open): Call send_interrupt_sequence if interrupt_on_start. One last question: How did you test this change? Have you run the testsuite? > +const char *interrupt_sequence_mode = interrupt_sequence_control_c; This variable should be made static. > +static void show_interrupt_sequence (struct ui_file *file, int from_tty, > + struct cmd_list_element *c, > + const char *value) Just a formatting nit: the function name should be starting at column 0. Therefore: static void show_interrupt_sequence (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) It looks like you have several functions that need to be reformatted that way. Can you take care of that? > + internal_error (__FILE__, __LINE__, > + _("You are sending unexpected %s to the remote target."), > + interrupt_sequence_mode); I would rather say: "Invalid value for interrupt_sequence_mode: %s.", interrupt_sequence_mode Your version implies that the user is doing something wrong ("you are sending"), whereas we should land there only if there was a software error in GDB. > +/* This boolean variable specifies whether interrupt_sequence is sent > + to remote target when gdb starts. This is mostly needed when you debug > + Linux kernel. Linux kernel expects BREAK g which is Magic SysRq for > + connecting gdb. > + */ Just a couple of formatting nits: Plese use 2 spaces after each period. And can you also join the "*/" at the end of the last line: connecting gdb. */ > /* This variable chooses whether to send a ^C or a break when the user > requests program interruption. Although ^C is usually what remote > systems expect, and that is the default here, sometimes a break is > preferable instead. */ > - > static int remote_break; In this case, the comment needs to be updated, because this variable should no longer have any effect on the code. It's just used to implement a command that is now deprecated. Here is what I would say: /* This variable is used to implement the "set/show remotebreak" commands. Since these commands are now deprecated in favor of "set/show remote interrupt-sequence", it no longer has any effect on the code. */ > +static void set_remotebreak (char *args, int from_tty, struct cmd_list_element *c) > +{ > + printf_filtered (_("%s\n"), c->doc); > + if (interrupt_sequence_mode == interrupt_sequence_control_c) > + { > + interrupt_sequence_mode = interrupt_sequence_break; > + remote_break = 0; > + } > + else > + { > + interrupt_sequence_mode = interrupt_sequence_control_c; > + remote_break = 1; > + } > +} That's better, but still not quite right. Let's look at what we're trying to achieve, at the user level, before we look at the code. What we're trying to achieve, here, is to allow the user to use "set remotebreak [on|off]", even if this command is deprecated. So, when the user types "set remotebreak on", then we need to act as if he entered "set remote interrupt-sequence break", and when he entered "set remotebreak off", we need to act as if he entered "set remote interrupt-sequence control-c". Now, on the technical side, here is how we do this: After the "set remotebreak" command is entered, the remote_break value gets updated according to the choice the user made (0 for "off", nonzero for "on"), and then set_remotebreak gets called back. This is when we look at the new choice the user made, and update interrupt_sequence_mode accordingly. Try the following instead: if (remote_break) interrupt_sequence_mode = interrupt_sequence_break; else interrupt_sequence_mode = interrupt_sequence_control_c; Please remove the printf of the command documentation. > +static void show_remotebreak (struct ui_file *file, int from_tty, > + struct cmd_list_element *c, > + const char *value) > +{ > + fprintf_filtered (file, _("%s\n"), c->doc); > +} Actually, please print nothing. > +/* > + Send interrupt_sequence to remote target. > +*/ Formatting: Can you join all three lines? /* Send interrupt_sequence to remote target. */ > + if (interrupt_sequence_mode == interrupt_sequence_control_c) > + serial_write (remote_desc, "\x03", 1); > + else if (interrupt_sequence_mode == interrupt_sequence_break) > + serial_send_break (remote_desc); > + else if (interrupt_sequence_mode == interrupt_sequence_sysrq_g) > + { > + serial_send_break (remote_desc); > + serial_write (remote_desc, "g", 1); > + } Can you add another internal_error here if interrupt_sequence_mode has an unexpected value? > + /* Interrupt_sequence is sent to remote target when gdb starts. > + This is mostly needed when you debug Linux kernel. > + Linux kernel expects BREAK g which is Magic SysRq for connecting gdb. */ I would suggest rewording your comment a bit, as it implies that the interrupt sequence is always sent at startup, which is not true. It also says "when GDB starts" whereas it should say when the connection is established. However, this comment is redundant with the comment you wrote besides the interrupt_on_start declaration, so let's just drop that one. > - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ > -Set whether to send break if interrupted."), _("\ > -Show whether to send break if interrupted."), _("\ > + add_setshow_boolean_cmd ("remotebreak", class_obscure, &remote_break, _("\ > +Deprecated. Use \"set remote interrupt-sequence [control-c|break]\" instead."), _("\ > +Deprecated. Use \"show remote interrupt-sequence\" instead."), _("\ > If set, a break, instead of a cntrl-c, is sent to the remote target."), > - NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is %s. */ > + set_remotebreak, show_remotebreak, > &setlist, &showlist); That's not quite how things should be done. Everytime a command is added, we create a struct cmd_list_element for it. In order to deprecate a command, we then call deprecate_cmd, passing the associated struct cmd_list_element, and the name of the command that replaces it. I don't see any other way to get the cmd_list_element for both the set and show command other than by using lookup_cmd, unfortunately. Most add_cmd_* functions return a pointer to the new command, but not the setshow, probably because they create 2 commands rather than one. So, something like the following just after the call do add_setshow_boolean_cmd should do the trick: cmd = lookup_cmd ("set remotebreak", setlist, -1, 1); deprecate_cmd (cmd, "set remote interrupt-sequence"); cmd = lookup_cmd ("show remotebreak", setlist, -1, 1); deprecate_cmd (cmd, "show remote interrupt-sequence"); This should have a visual effect similar to below when you try the "set/show remotebreak" commands: (gdb) disable tracepoints Warning: command 'disable tracepoints' is deprecated. Use 'disable'. You don't need to change the documentation for the set/show remotebreak command. > + add_setshow_enum_cmd ("interrupt-sequence", class_support, > + interrupt_sequence_modes, &interrupt_sequence_mode, _("\ > +Set interrupt sequence to remote target, control-c/break/sysrq-g."), _("\ > +Show interrupt sequence to remote target."), > + add_setshow_boolean_cmd ("interrupt-on-start", class_support, > + &interrupt_on_start, _("\ > +Set whether to send interrupt sequence when gdb starts."), _(" \ > +Show whether to send interrupt sequence when gdb starts."), _(" \ > +If set, interrupt sequence is sent to the remote target."), > + NULL, NULL, > + &remote_set_cmdlist, &remote_show_cmdlist); > + Eli usually reviews the documentation part of these commands. My comment is that you'll need to elaborate a little more on the various choices that are available. Here is an example that passed Eli's review: > add_setshow_enum_cmd ("multiple-symbols", no_class, > multiple_symbols_modes, &multiple_symbols_mode, > _("\ >Set the debugger behavior when more than one symbol are possible matches\n\ >in an expression."), _("\ >Show how the debugger handles ambiguities in expressions."), _("\ >Valid values are \"ask\", \"all\", \"cancel\", and the default is \"all\"."), > NULL, NULL, &setlist, &showlist); If we stay on track, and you take care of the comments I made, I believe the next version of this patch might be the one that gets checked in! -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-09-30 4:45 ` Caz Yokoyama 2009-09-30 17:28 ` Joel Brobecker @ 2009-09-30 19:16 ` Eli Zaretskii 2009-09-30 20:12 ` Joel Brobecker 1 sibling, 1 reply; 55+ messages in thread From: Eli Zaretskii @ 2009-09-30 19:16 UTC (permalink / raw) To: Caz Yokoyama; +Cc: brobecker, pedro, gdb-patches > From: Caz Yokoyama <cazyokoyama@gmail.com> > Cc: "'Pedro Alves'" <pedro@codesourcery.com>, <gdb-patches@sourceware.org> > Date: Tue, 29 Sep 2009 21:45:46 -0700 > > Here is the patch for 1. Let me know if I forget something. Also any > comments are welcome. Thank you. Thanks. > --- gdb/NEWS 15 Sep 2009 03:30:04 -0000 1.331 > +++ gdb/NEWS 30 Sep 2009 04:41:52 -0000 > @@ -3,6 +3,15 @@ > > *** Changes since GDB 6.8 > > +* "set/show remotebreak" command is deprecated. "set/show remote interrupt-sequence" > +is added. They add break signal followed by a character 'g' in addition to control-c > +and a break signal. break signal and g is also known as Magic SysRq and it interrupts > +Linux kernel. > + > +* "set/show remote interrupt-on-start" command is added. When this is ON, > +gdb sends interrupt-sequence to the remote target when gdb starts. This is needed when > +you debug Linux kernel. Several comments about the changes in NEWS: . Please put this in the "New commands" section. . Please format it like the other entries about new commands. . Please use shorter lines, like no more than 70 characters. . Please leave two spaces between sentences. > + add_setshow_enum_cmd ("interrupt-sequence", class_support, > + interrupt_sequence_modes, &interrupt_sequence_mode, _("\ > +Set interrupt sequence to remote target, control-c/break/sysrq-g."), _("\ You cannot have commas on the first line of the doc string, because commands that show only the first line will stop at the first comma. > --- gdb/doc/ChangeLog 26 Sep 2009 16:47:13 -0000 1.958 > +++ gdb/doc/ChangeLog 30 Sep 2009 04:41:58 -0000 Several comments about the patch to the manual: +2009-09-29 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * gdb.texinfo: remove "set/show remotebreak" command. + Add "set/show remote interrupt-sequence" and + "set/show remote interrupt-on-start" command. + ChangeLog entries should begin with a capital letter, and should mention the name of the node where you make changes (as if the node were a function in some programming language). > -@item set remotebreak > -@cindex interrupt remote programs > -@cindex BREAK signal instead of Ctrl-C > -@anchor{set remotebreak} > -If set to on, @value{GDBN} sends a @code{BREAK} signal to the remote > -when you type @kbd{Ctrl-c} to interrupt the program running > -on the remote. If set to off, @value{GDBN} sends the @samp{Ctrl-C} > -character instead. The default is off, since most remote systems > -expect to see @samp{Ctrl-C} as the interrupt signal. > - > -@item show remotebreak > -Show whether @value{GDBN} sends @code{BREAK} or @samp{Ctrl-C} to > -interrupt the remote program. > - > @item set remoteflow on > @itemx set remoteflow off > @kindex set remoteflow > @@ -15011,6 +14997,34 @@ > target system. If it is not set, the target will use a default > filename (e.g.@: the last program run). > > +@item set interrupt-sequence > +@cindex interrupt remote programs > +@cindex select control-c, break or sysrq-g Please use the same conventions for these keys as in the portion you are replacing. For example, BREAK should be in caps and control-c should be spelled Ctrl-C. > +@anchor{set interrupt-sequence} Why are you setting up an @anchor? I don't see that you use it anywhere in the patch. An @anchor is for use in a cross-reference, like @xref or @pxref. > +Allow the user to specify what sequence to send to the remote target > +when he requests a program interruption: Although @kbd{control-c} is usually > +what remote systems expect (this is the default, here), it is > +sometimes preferable to send a @code{break}. This description leaves the reader in the dark what she should or could type to set the interrupt key sequence. Will a literal "control-c" be acceptable? what about "Ctrl-C"? is the string case-sensitive or not? what sequences are recognized and supported? Or do I just press the key sequence itself, i.e. press and hold Ctrl and hit C, or hit BREAK then g? > On other systems such as the Linux kernel Linux kernel is not a system. Please use "On other systems such as GNU/Linux" or "when debugging the Linux kernel". > +@anchor{set interrupt-on-start} This anchor is also unused. > +Specify whether interrupt_sequence is sent ^^^^^^^^^^^^^^^^^^ Why with an underscore? > +to remote target when gdb starts. This is mostly needed when you debug Please use @value{GDBN}" instead of a literal "gdb". > +@code{Linux kernel}. Linux kernel expects @code{BREAK g} which is @code{Magic SysRq} ^^ Two spaces between sentences, please. Also, keyboard input should have the @kbd markup: @kbd{@key{BREAK} g}. Note that I used @key{BREAK} to indicate that this is a single key, not the sequence of characters B R E A K. > +setting (@pxref{set remote interrupt-sequence}). I don't think this @pxref will work. Did you try to say "make info" after changing gdb.texinfo, and if so, did it complain? ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-09-30 19:16 ` Eli Zaretskii @ 2009-09-30 20:12 ` Joel Brobecker 2009-10-01 3:48 ` Caz Yokoyama 0 siblings, 1 reply; 55+ messages in thread From: Joel Brobecker @ 2009-09-30 20:12 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Caz Yokoyama, pedro, gdb-patches > > +@item set interrupt-sequence > > +@cindex interrupt remote programs > > +@cindex select control-c, break or sysrq-g BTW: It should be "set remote interrupt-sequence". Same for "show remote interrupt-sequence". -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-09-30 20:12 ` Joel Brobecker @ 2009-10-01 3:48 ` Caz Yokoyama 2009-10-01 4:08 ` Eli Zaretskii 2009-10-01 16:33 ` Joel Brobecker 0 siblings, 2 replies; 55+ messages in thread From: Caz Yokoyama @ 2009-10-01 3:48 UTC (permalink / raw) To: 'Joel Brobecker', 'Eli Zaretskii'; +Cc: pedro, gdb-patches [-- Attachment #1: Type: text/plain, Size: 972 bytes --] Hello Joel and Eli, Here is the patch which integrates your inputs. Even though I carefully look through your inputs, there may be missing. Let me know if you find. Notes: - Use Ctrl-C, BREAK and SysRq-g according to Eli's suggestion. - "make info" in gdb/doc has no complain. - I always test the connection with Linux kernel. - I did manual test like "help remote interrupt-sequence" and see its output. - I ran "make check". Let me know if you want its output. -caz -----Original Message----- From: Joel Brobecker [mailto:brobecker@adacore.com] Sent: Wednesday, September 30, 2009 1:12 PM To: Eli Zaretskii Cc: Caz Yokoyama; pedro@codesourcery.com; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light > > +@item set interrupt-sequence > > +@cindex interrupt remote programs > > +@cindex select control-c, break or sysrq-g BTW: It should be "set remote interrupt-sequence". Same for "show remote interrupt-sequence". -- Joel [-- Attachment #2: remotebreak.patch --] [-- Type: application/octet-stream, Size: 13732 bytes --] Index: gdb/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.10923 diff -u -r1.10923 ChangeLog --- gdb/ChangeLog 29 Sep 2009 16:27:05 -0000 1.10923 +++ gdb/ChangeLog 1 Oct 2009 03:32:17 -0000 @@ -1,3 +1,17 @@ +2009-09-30 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * remote.c (interrupt_sequence_control_c) + (interrupt_sequence_break, interrupt_sequence_sysrq_g) + (interrupt_sequence_modes): New constants. + (interrupt_sequence_mode, interrupt_on_connect): New variable. + (show_interrupt_sequence): New function. + (set_remotebreak, show_remotebreak): New function. + (send_interrupt_sequence: New function. + (remote_start_remote): Call send_interrupt_sequence if interrupt_on_connect. + (remote_stop_as): Call send_interrupt_sequence. + (_initialize_remote): Add interrupt-sequence and interrupt-on-connect, + modify remotebreak to call set_remotebreak and show_remotebreak. + 2009-09-29 Jan Kratochvil <jan.kratochvil@redhat.com> * ia64-tdep.c (ia64_convert_from_func_ptr_addr): New variable buf. Index: gdb/NEWS =================================================================== RCS file: /cvs/src/src/gdb/NEWS,v retrieving revision 1.331 diff -u -r1.331 NEWS --- gdb/NEWS 15 Sep 2009 03:30:04 -0000 1.331 +++ gdb/NEWS 1 Oct 2009 03:32:18 -0000 @@ -3,6 +3,9 @@ *** Changes since GDB 6.8 +* "set/show remotebreak" command is deprecated. Use "set/show remote +interrupt-sequence" instead. + * GDB now has an interface for JIT compilation. Applications that dynamically generate code can create symbol files in memory and register them with GDB. For users, the feature should work transparently, and @@ -234,6 +237,20 @@ * New commands (for set/show, see "New options" below) +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g] +show remote interrupt-sequence + Allow the user to select one of ^C, a break or Magic SysRq g as the + sequence to the remote target in order to interrupt the execution. + Ctrl-C is a default. Some system prefers BREAK which is high level of + serial line for some certain time. Linux kernel prefers SysRq-g, a.k.a + Magic SysRq. It is BREAK signal and character 'g'. + +set remote interrupt-on-connect [on | off] +show remote interrupt-on-connect + When interrupt-on-connect is ON, gdb sends interrupt-sequence to + remote target when gdb connects to it. This is needed when you debug + Linux kernel. + catch syscall [NAME(S) | NUMBER(S)] Catch system calls. Arguments, which should be names of system calls or their numbers, mean catch only those syscalls. Without Index: gdb/remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.372 diff -u -r1.372 remote.c --- gdb/remote.c 10 Sep 2009 22:47:56 -0000 1.372 +++ gdb/remote.c 1 Oct 2009 03:32:21 -0000 @@ -546,14 +546,76 @@ this can go away. */ static int wait_forever_enabled_p = 1; +/* Allow the user to specify what sequence to send to the remote + when he requests a program interruption: Although ^C is usually + what remote systems expect (this is the default, here), it is + sometimes preferable to send a break. On other systems such + as the Linux kernel, a break followed by g, which is Magic SysRq g + is required in order to interrupt the execution. */ +const char interrupt_sequence_control_c[] = "Ctrl-C"; +const char interrupt_sequence_break[] = "BREAK"; +const char interrupt_sequence_sysrq_g[] = "SysRq-g"; +static const char *interrupt_sequence_modes[] = + { + interrupt_sequence_control_c, + interrupt_sequence_break, + interrupt_sequence_sysrq_g, + NULL + }; +static const char *interrupt_sequence_mode = interrupt_sequence_control_c; -/* This variable chooses whether to send a ^C or a break when the user - requests program interruption. Although ^C is usually what remote - systems expect, and that is the default here, sometimes a break is - preferable instead. */ +static void +show_interrupt_sequence (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value) +{ + if (interrupt_sequence_mode == interrupt_sequence_control_c) + fprintf_filtered (file, + _("Send the ASCII ETX character (Ctrl-c) " + "to the remote target to interrupt the " + "execution of the program.\n")); + else if (interrupt_sequence_mode == interrupt_sequence_break) + fprintf_filtered (file, + _("send a break signal to the remote target " + "to interrupt the execution of the program.\n")); + else if (interrupt_sequence_mode == interrupt_sequence_sysrq_g) + fprintf_filtered (file, + _("Send a break signal and 'g' a.k.a. SysRq-g and Magic SysRq to " + "the remote target to interrupt the execution " + "of Linux kernel.\n")); + else + internal_error (__FILE__, __LINE__, + _("Invalid value for interrupt_sequence_mode: %s."), + interrupt_sequence_mode); +} +/* This boolean variable specifies whether interrupt_sequence is sent + to remote target when gdb starts. This is mostly needed when you debug + Linux kernel. Linux kernel expects BREAK g which is Magic SysRq for + connecting gdb. */ +static int interrupt_on_connect = 0; + +/* This variable is used to implement the "set/show remotebreak" commands. + Since these commands are now deprecated in favor of "set/show remote + interrupt-sequence", it no longer has any effect on the code. */ static int remote_break; +static void +set_remotebreak (char *args, int from_tty, struct cmd_list_element *c) +{ + if (remote_break) + interrupt_sequence_mode = interrupt_sequence_break; + else + interrupt_sequence_mode = interrupt_sequence_control_c; +} + +static void +show_remotebreak (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value) +{ +} + /* Descriptor for I/O to remote machine. Initialize it to NULL so that remote_open knows that we don't have a file open when the program starts. */ @@ -2585,6 +2647,25 @@ int extended_p; }; +/* Send interrupt_sequence to remote target. */ +static void +send_interrupt_sequence () +{ + if (interrupt_sequence_mode == interrupt_sequence_control_c) + serial_write (remote_desc, "\x03", 1); + else if (interrupt_sequence_mode == interrupt_sequence_break) + serial_send_break (remote_desc); + else if (interrupt_sequence_mode == interrupt_sequence_sysrq_g) + { + serial_send_break (remote_desc); + serial_write (remote_desc, "g", 1); + } + else + internal_error (__FILE__, __LINE__, + _("Invalid value for interrupt_sequence_mode: %s."), + interrupt_sequence_mode); +} + static void remote_start_remote (struct ui_out *uiout, void *opaque) { @@ -2598,6 +2679,9 @@ /* Ack any packet which the remote side has already sent. */ serial_write (remote_desc, "+", 1); + if (interrupt_on_connect) + send_interrupt_sequence (); + /* The first packet we send to the target is the optional "supported packets" request. If the target can answer this, it will tell us which later probes to skip. */ @@ -4021,12 +4105,8 @@ if (rs->cached_wait_status) return; - /* Send a break or a ^C, depending on user preference. */ - - if (remote_break) - serial_send_break (remote_desc); - else - serial_write (remote_desc, "\003", 1); + /* Send interrupt_sequence to remote target. */ + send_interrupt_sequence (); } /* This is the generic stop called via the target vector. When a target @@ -8993,6 +9073,10 @@ _initialize_remote (void) { struct remote_state *rs; + struct cmd_list_element *cmd; + /* I can't use the same string for lookup_cmd(). Cause segment fault. */ + static char *_set_remotebreak_ = "remotebreak"; + static char *_show_remotebreak_ = "remotebreak"; /* architecture specific data */ remote_gdbarch_data_handle = @@ -9056,12 +9140,33 @@ terminating `#' character and checksum."), &maintenancelist); - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ -Set whether to send break if interrupted."), _("\ -Show whether to send break if interrupted."), _("\ + add_setshow_boolean_cmd ("remotebreak", class_obscure, &remote_break, _("\ +Deprecated. Use \"set remote interrupt-sequence [control-c|break]\" instead."), _("\ +Deprecated. Use \"show remote interrupt-sequence\" instead."), _("\ If set, a break, instead of a cntrl-c, is sent to the remote target."), - NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is %s. */ + set_remotebreak, show_remotebreak, &setlist, &showlist); + cmd = lookup_cmd (&_set_remotebreak_, setlist, "", -1, 1); + deprecate_cmd (cmd, "set remote interrupt-sequence"); + cmd = lookup_cmd (&_show_remotebreak_, showlist, "", -1, 1); + deprecate_cmd (cmd, "show remote interrupt-sequence"); + + add_setshow_enum_cmd ("interrupt-sequence", class_support, + interrupt_sequence_modes, &interrupt_sequence_mode, _("\ +Set interrupt sequence to remote target."), _("\ +Show interrupt sequence to remote target."), _("\ +Valid value is \"Ctrl-C\", \"BREAK\" or \"SysRq-g\". The default is \"Ctrl-C\"."), + NULL, show_interrupt_sequence, + &remote_set_cmdlist, + &remote_show_cmdlist); + + add_setshow_boolean_cmd ("interrupt-on-connect", class_support, + &interrupt_on_connect, _("\ +Set whether interrupt-sequence is sent to remote target when gdb connects to."), _(" \ +Show whether interrupt-sequence is sent to remote target when gdb connects to."), _(" \ +If set, interrupt sequence is sent to remote target."), + NULL, NULL, + &remote_set_cmdlist, &remote_show_cmdlist); /* Install commands for configuring memory read/write packets. */ Index: gdb/doc/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/doc/ChangeLog,v retrieving revision 1.958 diff -u -r1.958 ChangeLog --- gdb/doc/ChangeLog 26 Sep 2009 16:47:13 -0000 1.958 +++ gdb/doc/ChangeLog 1 Oct 2009 03:32:23 -0000 @@ -1,3 +1,8 @@ +2009-09-30 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * gdb.texinfo (Remote Configuration): Add "set/show remote interrupt-sequence" and + "set/show remote interrupt-on-connect" command. + 2009-09-26 Pierre Muller <muller@ics.u-strasbg.fr> * gdb.texinfo (Cygwin Native): Mention support for Ctrl-BREAK. Index: gdb/doc/gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.629 diff -u -r1.629 gdb.texinfo --- gdb/doc/gdb.texinfo 26 Sep 2009 16:47:13 -0000 1.629 +++ gdb/doc/gdb.texinfo 1 Oct 2009 03:32:36 -0000 @@ -15011,6 +15011,33 @@ target system. If it is not set, the target will use a default filename (e.g.@: the last program run). +@item set remote interrupt-sequence +@cindex interrupt remote programs +@cindex select Ctrl-C, BREAK or SysRq-g +Allow the user to specify what sequence @value{GDBN} sends to the remote target +when you type @samp{Ctrl-c} to interrupt the program running +on the remote target. Although @samp{Ctrl-C} is usually +what remote systems expect (this is the default, here), it is +sometimes preferable to send a @code{BREAK}. When debugging the Linux kernel, +a @code{BREAK} followed by @code{g}, which is +Magic SysRq g is required in order to interrupt the execution. + +@item show interrupt-sequence +Show which of @samp{Ctrl-C}, @code{BREAK} or @code{BREAK} followed by @code{g} +is sent by @value{GDBN} to interrupt the remote program. +@code{BREAK} followed by @code{g} is also known as Magic SysRq. + +@item set remote interrupt-on-connect +@cindex send interrupt-sequence on start +Specify whether interrupt_sequence is sent +to remote target when @value{GDBN} connects to it. This is mostly needed when you debug +Linux kernel. Linux kernel expects @code{BREAK} followed by @code{g} which is Magic SysRq +in order to connect @value{GDBN}. + +@item show interrupt-on-connect +Show whether interrupt-sequence is sent +to remote target when @value{GDBN} connects to it. + @kindex set tcp @kindex show tcp @item set tcp auto-retry on @@ -29817,9 +29844,9 @@ @cindex interrupts (remote protocol) When a program on the remote target is running, @value{GDBN} may -attempt to interrupt it by sending a @samp{Ctrl-C} or a @code{BREAK}, -control of which is specified via @value{GDBN}'s @samp{remotebreak} -setting (@pxref{set remotebreak}). +attempt to interrupt it by sending a @samp{Ctrl-C}, @code{BREAK} or +a @code{BREAK} followed by @code{g}, +control of which is specified via @value{GDBN}'s @samp{interrupt-sequence}. The precise meaning of @code{BREAK} is defined by the transport mechanism and may, in fact, be undefined. @value{GDBN} does not @@ -29836,6 +29863,11 @@ (@pxref{X packet}), used for binary downloads, may include an unescaped @code{0x03} as part of its packet. +@code{BREAK} followed by @code{g} is also known as Magic SysRq and is +@code{BREAK} and @code{g}. +When Linux kernel receives this sequence from serial port, +it stops execution and connects to gdb. + Stubs are not required to recognize these interrupt mechanisms and the precise meaning associated with receipt of the interrupt is implementation defined. If the target supports debugging of multiple ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-10-01 3:48 ` Caz Yokoyama @ 2009-10-01 4:08 ` Eli Zaretskii 2009-10-01 4:51 ` Caz Yokoyama 2009-10-01 16:33 ` Joel Brobecker 1 sibling, 1 reply; 55+ messages in thread From: Eli Zaretskii @ 2009-10-01 4:08 UTC (permalink / raw) To: Caz Yokoyama; +Cc: brobecker, pedro, gdb-patches > From: Caz Yokoyama <cazyokoyama@gmail.com> > Cc: <pedro@codesourcery.com>, > <gdb-patches@sourceware.org> > Date: Wed, 30 Sep 2009 20:48:37 -0700 > > Hello Joel and Eli, > Here is the patch which integrates your inputs. Even though I carefully look > through your inputs, there may be missing. Let me know if you find. Thanks. > --- gdb/NEWS 15 Sep 2009 03:30:04 -0000 1.331 > +++ gdb/NEWS 1 Oct 2009 03:32:18 -0000 > @@ -3,6 +3,9 @@ > > *** Changes since GDB 6.8 > > +* "set/show remotebreak" command is deprecated. Use "set/show remote > +interrupt-sequence" instead. I'd prefer this to be in the "New commands" section, even though it is not strictly speaking a new command. > +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g] > +show remote interrupt-sequence > + Allow the user to select one of ^C, a break or Magic SysRq g as the > + sequence to the remote target in order to interrupt the execution. > + Ctrl-C is a default. Some system prefers BREAK which is high level of > + serial line for some certain time. Linux kernel prefers SysRq-g, a.k.a > + Magic SysRq. It is BREAK signal and character 'g'. ^^ Still one space. > - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ > -Set whether to send break if interrupted."), _("\ > -Show whether to send break if interrupted."), _("\ > + add_setshow_boolean_cmd ("remotebreak", class_obscure, &remote_break, _("\ > +Deprecated. Use \"set remote interrupt-sequence [control-c|break]\" instead."), _("\ > +Deprecated. Use \"show remote interrupt-sequence\" instead."), _("\ You cannot have periods in the first line of the command's doc string. > +@item set remote interrupt-sequence > +@cindex interrupt remote programs > +@cindex select Ctrl-C, BREAK or SysRq-g > +Allow the user to specify what sequence @value{GDBN} sends to the remote target > +when you type @samp{Ctrl-c} to interrupt the program running > +on the remote target. Although @samp{Ctrl-C} is usually > +what remote systems expect (this is the default, here), it is > +sometimes preferable to send a @code{BREAK}. When debugging the Linux kernel, > +a @code{BREAK} followed by @code{g}, which is > +Magic SysRq g is required in order to interrupt the execution. Sorry, this still doesn't say what can be given to "set remote interrupt-sequence" to set the sequence, and does not clearly state the list of supported alternatives. > +Specify whether interrupt_sequence is sent ^^^^^^^^^^^^^^^^^^ Why do you use an underscore here? ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-10-01 4:08 ` Eli Zaretskii @ 2009-10-01 4:51 ` Caz Yokoyama 2009-10-01 20:04 ` Eli Zaretskii 0 siblings, 1 reply; 55+ messages in thread From: Caz Yokoyama @ 2009-10-01 4:51 UTC (permalink / raw) To: 'Eli Zaretskii'; +Cc: brobecker, pedro, gdb-patches [-- Attachment #1: Type: text/plain, Size: 2874 bytes --] How about this? I am not familiar with texinfo. -caz -----Original Message----- From: Eli Zaretskii [mailto:eliz@gnu.org] Sent: Wednesday, September 30, 2009 9:11 PM To: Caz Yokoyama Cc: brobecker@adacore.com; pedro@codesourcery.com; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light > From: Caz Yokoyama <cazyokoyama@gmail.com> > Cc: <pedro@codesourcery.com>, > <gdb-patches@sourceware.org> > Date: Wed, 30 Sep 2009 20:48:37 -0700 > > Hello Joel and Eli, > Here is the patch which integrates your inputs. Even though I carefully look > through your inputs, there may be missing. Let me know if you find. Thanks. > --- gdb/NEWS 15 Sep 2009 03:30:04 -0000 1.331 > +++ gdb/NEWS 1 Oct 2009 03:32:18 -0000 > @@ -3,6 +3,9 @@ > > *** Changes since GDB 6.8 > > +* "set/show remotebreak" command is deprecated. Use "set/show remote > +interrupt-sequence" instead. I'd prefer this to be in the "New commands" section, even though it is not strictly speaking a new command. > +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g] > +show remote interrupt-sequence > + Allow the user to select one of ^C, a break or Magic SysRq g as the > + sequence to the remote target in order to interrupt the execution. > + Ctrl-C is a default. Some system prefers BREAK which is high level of > + serial line for some certain time. Linux kernel prefers SysRq-g, a.k.a > + Magic SysRq. It is BREAK signal and character 'g'. ^^ Still one space. > - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ > -Set whether to send break if interrupted."), _("\ > -Show whether to send break if interrupted."), _("\ > + add_setshow_boolean_cmd ("remotebreak", class_obscure, &remote_break, _("\ > +Deprecated. Use \"set remote interrupt-sequence [control-c|break]\" instead."), _("\ > +Deprecated. Use \"show remote interrupt-sequence\" instead."), _("\ You cannot have periods in the first line of the command's doc string. > +@item set remote interrupt-sequence > +@cindex interrupt remote programs > +@cindex select Ctrl-C, BREAK or SysRq-g > +Allow the user to specify what sequence @value{GDBN} sends to the remote target > +when you type @samp{Ctrl-c} to interrupt the program running > +on the remote target. Although @samp{Ctrl-C} is usually > +what remote systems expect (this is the default, here), it is > +sometimes preferable to send a @code{BREAK}. When debugging the Linux kernel, > +a @code{BREAK} followed by @code{g}, which is > +Magic SysRq g is required in order to interrupt the execution. Sorry, this still doesn't say what can be given to "set remote interrupt-sequence" to set the sequence, and does not clearly state the list of supported alternatives. > +Specify whether interrupt_sequence is sent ^^^^^^^^^^^^^^^^^^ Why do you use an underscore here? [-- Attachment #2: remotebreak.patch --] [-- Type: application/octet-stream, Size: 37785 bytes --] ? cscope.out ? serdep.tmp ? bfd/.deps ? bfd/.libs ? bfd/Makefile ? bfd/aout32.lo ? bfd/archive.lo ? bfd/archive64.lo ? bfd/archures.lo ? bfd/bfd-in3.h ? bfd/bfd.h ? bfd/bfd.lo ? bfd/bfd_stdint.h ? bfd/bfdio.lo ? bfd/bfdver.h ? bfd/bfdwin.lo ? bfd/binary.lo ? bfd/cache.lo ? bfd/coffgen.lo ? bfd/cofflink.lo ? bfd/compress.lo ? bfd/config.cache ? bfd/config.h ? bfd/config.log ? bfd/config.status ? bfd/corefile.lo ? bfd/cpu-i386.lo ? bfd/cpu-l1om.lo ? bfd/dwarf1.lo ? bfd/dwarf2.lo ? bfd/elf-attrs.lo ? bfd/elf-eh-frame.lo ? bfd/elf-ifunc.lo ? bfd/elf-strtab.lo ? bfd/elf-vxworks.lo ? bfd/elf.lo ? bfd/elf32-gen.lo ? bfd/elf32-i386.lo ? bfd/elf32-target.h ? bfd/elf32.lo ? bfd/elf64-gen.lo ? bfd/elf64-target.h ? bfd/elf64-x86-64.lo ? bfd/elf64.lo ? bfd/elflink.lo ? bfd/format.lo ? bfd/hash.lo ? bfd/i386linux.lo ? bfd/ihex.lo ? bfd/init.lo ? bfd/libbfd.la ? bfd/libbfd.lo ? bfd/libtool ? bfd/libtool-soversion ? bfd/linker.lo ? bfd/merge.lo ? bfd/ofiles ? bfd/opncls.lo ? bfd/pei-i386.lo ? bfd/pei-x86_64.lo ? bfd/peigen.c ? bfd/peigen.lo ? bfd/pex64igen.c ? bfd/pex64igen.lo ? bfd/reloc.lo ? bfd/section.lo ? bfd/simple.lo ? bfd/srec.lo ? bfd/stab-syms.lo ? bfd/stabs.lo ? bfd/stamp-h1 ? bfd/stamp-lib ? bfd/stamp-ofiles ? bfd/stmp-bfd-h ? bfd/syms.lo ? bfd/targets.lo ? bfd/targmatch.h ? bfd/tekhex.lo ? bfd/verilog.lo ? bfd/doc/Makefile ? bfd/doc/aoutx.texi ? bfd/doc/archive.texi ? bfd/doc/archures.texi ? bfd/doc/bfd.info ? bfd/doc/bfdio.texi ? bfd/doc/bfdt.texi ? bfd/doc/bfdver.texi ? bfd/doc/bfdwin.texi ? bfd/doc/cache.texi ? bfd/doc/chew ? bfd/doc/coffcode.texi ? bfd/doc/core.texi ? bfd/doc/elf.texi ? bfd/doc/elfcode.texi ? bfd/doc/format.texi ? bfd/doc/hash.texi ? bfd/doc/init.texi ? bfd/doc/libbfd.texi ? bfd/doc/linker.texi ? bfd/doc/mmo.texi ? bfd/doc/opncls.texi ? bfd/doc/reloc.texi ? bfd/doc/section.texi ? bfd/doc/syms.texi ? bfd/doc/targets.texi ? bfd/po/BLD-POTFILES ? bfd/po/Makefile ? bfd/po/Makefile.in ? bfd/po/SRC-POTFILES ? etc/Makefile ? etc/config.cache ? etc/config.status ? etc/configure.info ? etc/standards.info ? gdb/.deps ? gdb/.gdbinit ? gdb/.remote.c-00 ? gdb/ChangeLog-00 ? gdb/ChangeLog-01 ? gdb/Makefile ? gdb/ada-exp.c ? gdb/ada-lex.c ? gdb/c-exp.c ? gdb/config.cache ? gdb/config.h ? gdb/config.log ? gdb/config.status ? gdb/cp-name-parser.c ? gdb/f-exp.c ? gdb/gdb ? gdb/gdbtui ? gdb/init.c ? gdb/jv-exp.c ? gdb/m2-exp.c ? gdb/objc-exp.c ? gdb/observer.h ? gdb/observer.inc ? gdb/p-exp.c ? gdb/remote.c-00 ? gdb/remote.c-01 ? gdb/remote.c-02 ? gdb/remote.h-00 ? gdb/remote.h-01 ? gdb/solib-svr4.c-00 ? gdb/stZSyur3 ? gdb/stamp-h ? gdb/stamp-h1 ? gdb/stamp-xml ? gdb/stqYjWZH ? gdb/symfile.c-00 ? gdb/symfile.c-01 ? gdb/symfile.c-02 ? gdb/symfile.c-03 ? gdb/version.c ? gdb/xml-builtin.c ? gdb/doc/ChangeLog-00 ? gdb/doc/GDBvn.texi ? gdb/doc/Makefile ? gdb/doc/annotate.info ? gdb/doc/annotate.pdf ? gdb/doc/config.log ? gdb/doc/config.status ? gdb/doc/gdb.aux ? gdb/doc/gdb.bt ? gdb/doc/gdb.cp ? gdb/doc/gdb.cps ? gdb/doc/gdb.fn ? gdb/doc/gdb.info ? gdb/doc/gdb.info-1 ? gdb/doc/gdb.info-2 ? gdb/doc/gdb.info-3 ? gdb/doc/gdb.info-4 ? gdb/doc/gdb.info-5 ? gdb/doc/gdb.ky ? gdb/doc/gdb.log ? gdb/doc/gdb.pdf ? gdb/doc/gdb.pg ? gdb/doc/gdb.pgs ? gdb/doc/gdb.texinfo-00 ? gdb/doc/gdb.toc ? gdb/doc/gdb.tp ? gdb/doc/gdb.vr ? gdb/doc/gdbint.info ? gdb/doc/gdbint.info-1 ? gdb/doc/gdbint.info-2 ? gdb/doc/gdbint.pdf ? gdb/doc/refcard.pdf ? gdb/doc/stabs.info ? gdb/doc/stabs.pdf ? gdb/gdbserver/Makefile ? gdb/gdbserver/config.h ? gdb/gdbserver/config.log ? gdb/gdbserver/config.status ? gdb/gdbserver/gdbreplay ? gdb/gdbserver/gdbserver ? gdb/gdbserver/reg-i386-linux.c ? gdb/gdbserver/reg-x86-64-linux.c ? gdb/gdbserver/stamp-h ? gdb/gdbserver/version.c ? gdb/gnulib/.deps ? gdb/gnulib/Makefile ? gdb/gnulib/string.h ? gdb/testsuite/.gdb_history ? gdb/testsuite/Makefile ? gdb/testsuite/bigcore.corefile ? gdb/testsuite/cell20277-spu.c ? gdb/testsuite/cell20277.c ? gdb/testsuite/cell25846-spu.c ? gdb/testsuite/cell25846.c ? gdb/testsuite/cell8669-spu.c ? gdb/testsuite/cell8669.c ? gdb/testsuite/cell9747-spu.c ? gdb/testsuite/cell9747.c ? gdb/testsuite/config.log ? gdb/testsuite/config.status ? gdb/testsuite/copy1.txt ? gdb/testsuite/foobar.baz ? gdb/testsuite/gdb.base1 ? gdb/testsuite/gdb.base2 ? gdb/testsuite/gdb.log ? gdb/testsuite/gdb.sum ? gdb/testsuite/site.exp ? gdb/testsuite/tracecommandsscript ? gdb/testsuite/gdb.ada/Makefile ? gdb/testsuite/gdb.ada/gdb.log ? gdb/testsuite/gdb.ada/gdb.sum ? gdb/testsuite/gdb.arch/Makefile ? gdb/testsuite/gdb.arch/amd64-disp-step ? gdb/testsuite/gdb.arch/amd64-i386-address ? gdb/testsuite/gdb.arch/gdb.log ? gdb/testsuite/gdb.arch/gdb.sum ? gdb/testsuite/gdb.arch/i386-permbkpt ? gdb/testsuite/gdb.arch/i386-signal ? gdb/testsuite/gdb.arch/i386-sse ? gdb/testsuite/gdb.asm/Makefile ? gdb/testsuite/gdb.asm/asm-source ? gdb/testsuite/gdb.asm/gdb.log ? gdb/testsuite/gdb.asm/gdb.sum ? gdb/testsuite/gdb.base/.build-id ? gdb/testsuite/gdb.base/.debug ? gdb/testsuite/gdb.base/Makefile ? gdb/testsuite/gdb.base/a2-run ? gdb/testsuite/gdb.base/advance ? gdb/testsuite/gdb.base/all-types ? gdb/testsuite/gdb.base/annota1 ? gdb/testsuite/gdb.base/annota1-watch_thread_num ? gdb/testsuite/gdb.base/annota3 ? gdb/testsuite/gdb.base/args ? gdb/testsuite/gdb.base/arrayidx ? gdb/testsuite/gdb.base/async ? gdb/testsuite/gdb.base/attach ? gdb/testsuite/gdb.base/attach2 ? gdb/testsuite/gdb.base/auxv ? gdb/testsuite/gdb.base/auxv.gcore ? gdb/testsuite/gdb.base/bang! ? gdb/testsuite/gdb.base/bfp-test ? gdb/testsuite/gdb.base/bigcore ? gdb/testsuite/gdb.base/bigcore.corefile ? gdb/testsuite/gdb.base/bitfields ? gdb/testsuite/gdb.base/bitfields2 ? gdb/testsuite/gdb.base/break ? gdb/testsuite/gdb.base/break-always ? gdb/testsuite/gdb.base/breako2 ? gdb/testsuite/gdb.base/breakpoint-shadow ? gdb/testsuite/gdb.base/call-ar-st ? gdb/testsuite/gdb.base/call-rt-st ? gdb/testsuite/gdb.base/call-sc-tc ? gdb/testsuite/gdb.base/call-sc-td ? gdb/testsuite/gdb.base/call-sc-te ? gdb/testsuite/gdb.base/call-sc-tf ? gdb/testsuite/gdb.base/call-sc-ti ? gdb/testsuite/gdb.base/call-sc-tl ? gdb/testsuite/gdb.base/call-sc-tld ? gdb/testsuite/gdb.base/call-sc-tll ? gdb/testsuite/gdb.base/call-sc-ts ? gdb/testsuite/gdb.base/call-signals ? gdb/testsuite/gdb.base/call-strs ? gdb/testsuite/gdb.base/callexit ? gdb/testsuite/gdb.base/callfuncs ? gdb/testsuite/gdb.base/catch-syscall ? gdb/testsuite/gdb.base/charset ? gdb/testsuite/gdb.base/checkpoint ? gdb/testsuite/gdb.base/chng-syms ? gdb/testsuite/gdb.base/commands ? gdb/testsuite/gdb.base/compl-uNiQuEdIr ? gdb/testsuite/gdb.base/complex ? gdb/testsuite/gdb.base/consecutive ? gdb/testsuite/gdb.base/constvars ? gdb/testsuite/gdb.base/corefile ? gdb/testsuite/gdb.base/coremaker ? gdb/testsuite/gdb.base/cursal ? gdb/testsuite/gdb.base/cvexpr ? gdb/testsuite/gdb.base/dbx-test ? gdb/testsuite/gdb.base/del ? gdb/testsuite/gdb.base/display ? gdb/testsuite/gdb.base/dump ? gdb/testsuite/gdb.base/ending-run ? gdb/testsuite/gdb.base/execd-prog ? gdb/testsuite/gdb.base/expand-psymtabs ? gdb/testsuite/gdb.base/exprs ? gdb/testsuite/gdb.base/fileio ? gdb/testsuite/gdb.base/find ? gdb/testsuite/gdb.base/finish ? gdb/testsuite/gdb.base/fixsection ? gdb/testsuite/gdb.base/fixsectshr.sl ? gdb/testsuite/gdb.base/float ? gdb/testsuite/gdb.base/foll-exec ? gdb/testsuite/gdb.base/foll-fork ? gdb/testsuite/gdb.base/foll-vfork ? gdb/testsuite/gdb.base/frame-args ? gdb/testsuite/gdb.base/freebpcmd ? gdb/testsuite/gdb.base/fullname ? gdb/testsuite/gdb.base/funcargs ? gdb/testsuite/gdb.base/gcore ? gdb/testsuite/gdb.base/gcore-buffer-overflow-01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ? gdb/testsuite/gdb.base/gcore-buffer-overflow.test ? gdb/testsuite/gdb.base/gcore.test ? gdb/testsuite/gdb.base/gdb1090 ? gdb/testsuite/gdb.base/gdb1250 ? gdb/testsuite/gdb.base/gdb1555-main ? gdb/testsuite/gdb.base/gdb1821 ? gdb/testsuite/gdb.base/gdbvars ? gdb/testsuite/gdb.base/hashline1 ? gdb/testsuite/gdb.base/hashline1.c ? gdb/testsuite/gdb.base/hashline2 ? gdb/testsuite/gdb.base/hashline2.c ? gdb/testsuite/gdb.base/hashline3 ? gdb/testsuite/gdb.base/hashline3.c ? gdb/testsuite/gdb.base/hook-stop-continue ? gdb/testsuite/gdb.base/hook-stop-frame ? gdb/testsuite/gdb.base/huge ? gdb/testsuite/gdb.base/included ? gdb/testsuite/gdb.base/infnan ? gdb/testsuite/gdb.base/info-target ? gdb/testsuite/gdb.base/int-type ? gdb/testsuite/gdb.base/interrupt ? gdb/testsuite/gdb.base/jump ? gdb/testsuite/gdb.base/langs ? gdb/testsuite/gdb.base/lineinc ? gdb/testsuite/gdb.base/list ? gdb/testsuite/gdb.base/long_long ? gdb/testsuite/gdb.base/longjmp ? gdb/testsuite/gdb.base/macscp ? gdb/testsuite/gdb.base/mips_pro ? gdb/testsuite/gdb.base/miscexprs ? gdb/testsuite/gdb.base/multi-forks ? gdb/testsuite/gdb.base/nodebug ? gdb/testsuite/gdb.base/nofield ? gdb/testsuite/gdb.base/opaque ? gdb/testsuite/gdb.base/pc-fp ? gdb/testsuite/gdb.base/pending ? gdb/testsuite/gdb.base/pendshr.sl ? gdb/testsuite/gdb.base/pie-support ? gdb/testsuite/gdb.base/pointers ? gdb/testsuite/gdb.base/prelink.core ? gdb/testsuite/gdb.base/prelinkt ? gdb/testsuite/gdb.base/printcmds ? gdb/testsuite/gdb.base/prologue ? gdb/testsuite/gdb.base/psymtab ? gdb/testsuite/gdb.base/ptr-typedef ? gdb/testsuite/gdb.base/ptype ? gdb/testsuite/gdb.base/randomize ? gdb/testsuite/gdb.base/recurse ? gdb/testsuite/gdb.base/relational ? gdb/testsuite/gdb.base/relativedebug ? gdb/testsuite/gdb.base/reread ? gdb/testsuite/gdb.base/reread1 ? gdb/testsuite/gdb.base/restore ? gdb/testsuite/gdb.base/return ? gdb/testsuite/gdb.base/return-nodebug-int ? gdb/testsuite/gdb.base/return-nodebug-long ? gdb/testsuite/gdb.base/return-nodebug-long-long ? gdb/testsuite/gdb.base/return-nodebug-short ? gdb/testsuite/gdb.base/return-nodebug-signed-char ? gdb/testsuite/gdb.base/return2 ? gdb/testsuite/gdb.base/savedregs ? gdb/testsuite/gdb.base/scope ? gdb/testsuite/gdb.base/sep ? gdb/testsuite/gdb.base/sepdebug ? gdb/testsuite/gdb.base/sepdebug.stripped ? gdb/testsuite/gdb.base/sepsymtab ? gdb/testsuite/gdb.base/sepsymtab.stripped ? gdb/testsuite/gdb.base/setshow ? gdb/testsuite/gdb.base/setvar ? gdb/testsuite/gdb.base/shmain ? gdb/testsuite/gdb.base/shr1.sl ? gdb/testsuite/gdb.base/shr2.sl ? gdb/testsuite/gdb.base/shreloc ? gdb/testsuite/gdb.base/shreloc.txt ? gdb/testsuite/gdb.base/shreloc1.sl ? gdb/testsuite/gdb.base/shreloc2.sl ? gdb/testsuite/gdb.base/sigall ? gdb/testsuite/gdb.base/sigaltstack ? gdb/testsuite/gdb.base/sigbpt ? gdb/testsuite/gdb.base/sigchld ? gdb/testsuite/gdb.base/siginfo ? gdb/testsuite/gdb.base/siginfo-addr ? gdb/testsuite/gdb.base/siginfo-obj ? gdb/testsuite/gdb.base/signals ? gdb/testsuite/gdb.base/signull ? gdb/testsuite/gdb.base/sigrepeat ? gdb/testsuite/gdb.base/sigstep ? gdb/testsuite/gdb.base/sizeof ? gdb/testsuite/gdb.base/so-impl-ld ? gdb/testsuite/gdb.base/solib-display-main ? gdb/testsuite/gdb.base/solib-overlap-lib1-0x40000000.so-running ? gdb/testsuite/gdb.base/solib-overlap-lib1-0x50000000.so-running ? gdb/testsuite/gdb.base/solib-overlap-lib2-0x40000000.so-running ? gdb/testsuite/gdb.base/solib-overlap-lib2-0x50000000.so-running ? gdb/testsuite/gdb.base/solib-overlap-main-0x40000000 ? gdb/testsuite/gdb.base/solib-overlap-main-0x50000000 ? gdb/testsuite/gdb.base/solib-symbol-main ? gdb/testsuite/gdb.base/solib-weak ? gdb/testsuite/gdb.base/solib-weak-lib2 ? gdb/testsuite/gdb.base/solib1.sl ? gdb/testsuite/gdb.base/stack-checking ? gdb/testsuite/gdb.base/start ? gdb/testsuite/gdb.base/step-break ? gdb/testsuite/gdb.base/step-bt ? gdb/testsuite/gdb.base/step-line ? gdb/testsuite/gdb.base/step-test ? gdb/testsuite/gdb.base/store ? gdb/testsuite/gdb.base/structs-tc ? gdb/testsuite/gdb.base/structs-tc-td ? gdb/testsuite/gdb.base/structs-tc-tf ? gdb/testsuite/gdb.base/structs-tc-ti ? gdb/testsuite/gdb.base/structs-tc-tl ? gdb/testsuite/gdb.base/structs-tc-tld ? gdb/testsuite/gdb.base/structs-tc-tll ? gdb/testsuite/gdb.base/structs-tc-ts ? gdb/testsuite/gdb.base/structs-td ? gdb/testsuite/gdb.base/structs-td-tc ? gdb/testsuite/gdb.base/structs-td-tf ? gdb/testsuite/gdb.base/structs-tf ? gdb/testsuite/gdb.base/structs-tf-tc ? gdb/testsuite/gdb.base/structs-tf-td ? gdb/testsuite/gdb.base/structs-ti ? gdb/testsuite/gdb.base/structs-ti-tc ? gdb/testsuite/gdb.base/structs-tl ? gdb/testsuite/gdb.base/structs-tl-tc ? gdb/testsuite/gdb.base/structs-tld ? gdb/testsuite/gdb.base/structs-tld-tc ? gdb/testsuite/gdb.base/structs-tll ? gdb/testsuite/gdb.base/structs-tll-tc ? gdb/testsuite/gdb.base/structs-ts ? gdb/testsuite/gdb.base/structs-ts-tc ? gdb/testsuite/gdb.base/structs2 ? gdb/testsuite/gdb.base/structs3 ? gdb/testsuite/gdb.base/term ? gdb/testsuite/gdb.base/tmp-fullname.c ? gdb/testsuite/gdb.base/twice-tmp ? gdb/testsuite/gdb.base/twice-tmp.c ? gdb/testsuite/gdb.base/type-opaque-main ? gdb/testsuite/gdb.base/unload ? gdb/testsuite/gdb.base/unloadshr.sl ? gdb/testsuite/gdb.base/until ? gdb/testsuite/gdb.base/unwindonsignal ? gdb/testsuite/gdb.base/value-double-free ? gdb/testsuite/gdb.base/varargs ? gdb/testsuite/gdb.base/vforked-prog ? gdb/testsuite/gdb.base/volatile ? gdb/testsuite/gdb.base/watch_thread_num ? gdb/testsuite/gdb.base/watchpoint ? gdb/testsuite/gdb.base/watchpoint-hw ? gdb/testsuite/gdb.base/watchpoint-solib ? gdb/testsuite/gdb.base/watchpoint-solib-shr.sl ? gdb/testsuite/gdb.base/watchpoints ? gdb/testsuite/gdb.base/weaklib1.sl ? gdb/testsuite/gdb.base/weaklib2.sl ? gdb/testsuite/gdb.base/whatis ? gdb/testsuite/gdb.base/whatis-exp ? gdb/testsuite/gdb.cell/gdb.log ? gdb/testsuite/gdb.cell/gdb.sum ? gdb/testsuite/gdb.cp/Makefile ? gdb/testsuite/gdb.cp/abstract-origin ? gdb/testsuite/gdb.cp/annota2 ? gdb/testsuite/gdb.cp/annota3 ? gdb/testsuite/gdb.cp/anon-union ? gdb/testsuite/gdb.cp/arg-reference ? gdb/testsuite/gdb.cp/bool ? gdb/testsuite/gdb.cp/breakpoint ? gdb/testsuite/gdb.cp/bs15503 ? gdb/testsuite/gdb.cp/call-c ? gdb/testsuite/gdb.cp/casts ? gdb/testsuite/gdb.cp/class2 ? gdb/testsuite/gdb.cp/classes ? gdb/testsuite/gdb.cp/cplusfuncs ? gdb/testsuite/gdb.cp/cttiadd ? gdb/testsuite/gdb.cp/derivation ? gdb/testsuite/gdb.cp/exception ? gdb/testsuite/gdb.cp/expand-sals ? gdb/testsuite/gdb.cp/formatted-ref ? gdb/testsuite/gdb.cp/gdb.log ? gdb/testsuite/gdb.cp/gdb.sum ? gdb/testsuite/gdb.cp/gdb1355 ? gdb/testsuite/gdb.cp/gdb2384 ? gdb/testsuite/gdb.cp/gdb2495 ? gdb/testsuite/gdb.cp/hang ? gdb/testsuite/gdb.cp/inherit ? gdb/testsuite/gdb.cp/local ? gdb/testsuite/gdb.cp/m-data ? gdb/testsuite/gdb.cp/m-static ? gdb/testsuite/gdb.cp/mb-ctor ? gdb/testsuite/gdb.cp/mb-inline ? gdb/testsuite/gdb.cp/mb-templates ? gdb/testsuite/gdb.cp/member-ptr ? gdb/testsuite/gdb.cp/method ? gdb/testsuite/gdb.cp/method2 ? gdb/testsuite/gdb.cp/misc ? gdb/testsuite/gdb.cp/namespace ? gdb/testsuite/gdb.cp/namespace-nested-import ? gdb/testsuite/gdb.cp/namespace-using ? gdb/testsuite/gdb.cp/overload ? gdb/testsuite/gdb.cp/ovldbreak ? gdb/testsuite/gdb.cp/pass-by-ref ? gdb/testsuite/gdb.cp/pr-1023 ? gdb/testsuite/gdb.cp/pr-1210 ? gdb/testsuite/gdb.cp/pr-574 ? gdb/testsuite/gdb.cp/pr9594 ? gdb/testsuite/gdb.cp/pr9631 ? gdb/testsuite/gdb.cp/printmethod ? gdb/testsuite/gdb.cp/psmang ? gdb/testsuite/gdb.cp/ref-params ? gdb/testsuite/gdb.cp/ref-types ? gdb/testsuite/gdb.cp/rtti ? gdb/testsuite/gdb.cp/templates ? gdb/testsuite/gdb.cp/try_catch ? gdb/testsuite/gdb.cp/userdef ? gdb/testsuite/gdb.cp/virtfunc ? gdb/testsuite/gdb.disasm/Makefile ? gdb/testsuite/gdb.disasm/gdb.log ? gdb/testsuite/gdb.disasm/gdb.sum ? gdb/testsuite/gdb.dwarf2/Makefile ? gdb/testsuite/gdb.dwarf2/dup-psym.x ? gdb/testsuite/gdb.dwarf2/dw2-basic.x ? gdb/testsuite/gdb.dwarf2/dw2-compressed.x ? gdb/testsuite/gdb.dwarf2/dw2-cu-size.x ? gdb/testsuite/gdb.dwarf2/dw2-inheritance.x ? gdb/testsuite/gdb.dwarf2/dw2-intercu.x ? gdb/testsuite/gdb.dwarf2/dw2-intermix.x ? gdb/testsuite/gdb.dwarf2/dw2-noloc ? gdb/testsuite/gdb.dwarf2/dw2-producer.x ? gdb/testsuite/gdb.dwarf2/dw2-ranges ? gdb/testsuite/gdb.dwarf2/dw2-restore.x ? gdb/testsuite/gdb.dwarf2/dw2-strp.x ? gdb/testsuite/gdb.dwarf2/dw2-unresolved ? gdb/testsuite/gdb.dwarf2/gdb.log ? gdb/testsuite/gdb.dwarf2/gdb.sum ? gdb/testsuite/gdb.dwarf2/mac-fileno.x ? gdb/testsuite/gdb.fortran/Makefile ? gdb/testsuite/gdb.fortran/gdb.log ? gdb/testsuite/gdb.fortran/gdb.sum ? gdb/testsuite/gdb.gdb/gdb.log ? gdb/testsuite/gdb.gdb/gdb.sum ? gdb/testsuite/gdb.java/Makefile ? gdb/testsuite/gdb.java/gdb.log ? gdb/testsuite/gdb.java/gdb.sum ? gdb/testsuite/gdb.mi/Makefile ? gdb/testsuite/gdb.mi/basics ? gdb/testsuite/gdb.mi/gdb.log ? gdb/testsuite/gdb.mi/gdb.sum ? gdb/testsuite/gdb.mi/gdb669-pthreads ? gdb/testsuite/gdb.mi/gdb701 ? gdb/testsuite/gdb.mi/gdb792 ? gdb/testsuite/gdb.mi/mi-async ? gdb/testsuite/gdb.mi/mi-basics ? gdb/testsuite/gdb.mi/mi-break ? gdb/testsuite/gdb.mi/mi-cli ? gdb/testsuite/gdb.mi/mi-console ? gdb/testsuite/gdb.mi/mi-disassemble ? gdb/testsuite/gdb.mi/mi-eval ? gdb/testsuite/gdb.mi/mi-file ? gdb/testsuite/gdb.mi/mi-file-transfer ? gdb/testsuite/gdb.mi/mi-non-stop ? gdb/testsuite/gdb.mi/mi-non-stop-exit ? gdb/testsuite/gdb.mi/mi-nsintrall ? gdb/testsuite/gdb.mi/mi-nsmoribund ? gdb/testsuite/gdb.mi/mi-nsthrexec ? gdb/testsuite/gdb.mi/mi-pending ? gdb/testsuite/gdb.mi/mi-pendshr.sl ? gdb/testsuite/gdb.mi/mi-pthreads ? gdb/testsuite/gdb.mi/mi-read-memory ? gdb/testsuite/gdb.mi/mi-regs ? gdb/testsuite/gdb.mi/mi-return ? gdb/testsuite/gdb.mi/mi-simplerun ? gdb/testsuite/gdb.mi/mi-stack ? gdb/testsuite/gdb.mi/mi-stepi ? gdb/testsuite/gdb.mi/mi-syn-frame ? gdb/testsuite/gdb.mi/mi-var-block ? gdb/testsuite/gdb.mi/mi-var-child ? gdb/testsuite/gdb.mi/mi-var-cmd ? gdb/testsuite/gdb.mi/mi-var-cp ? gdb/testsuite/gdb.mi/mi-var-display ? gdb/testsuite/gdb.mi/mi-var-invalidate ? gdb/testsuite/gdb.mi/mi-var-invalidate_bis ? gdb/testsuite/gdb.mi/mi-watch ? gdb/testsuite/gdb.mi/mi2-basics ? gdb/testsuite/gdb.mi/mi2-break ? gdb/testsuite/gdb.mi/mi2-cli ? gdb/testsuite/gdb.mi/mi2-disassemble ? gdb/testsuite/gdb.mi/mi2-eval ? gdb/testsuite/gdb.mi/mi2-file ? gdb/testsuite/gdb.mi/mi2-pthreads ? gdb/testsuite/gdb.mi/mi2-regs ? gdb/testsuite/gdb.mi/mi2-return ? gdb/testsuite/gdb.mi/mi2-simplerun ? gdb/testsuite/gdb.mi/mi2-stepi ? gdb/testsuite/gdb.mi/mi2-var-block ? gdb/testsuite/gdb.mi/mi2-var-child ? gdb/testsuite/gdb.mi/mi2-var-cmd ? gdb/testsuite/gdb.mi/mi2-var-display ? gdb/testsuite/gdb.mi/mi2-watch ? gdb/testsuite/gdb.mi/until ? gdb/testsuite/gdb.modula2/Makefile ? gdb/testsuite/gdb.modula2/gdb.log ? gdb/testsuite/gdb.modula2/gdb.sum ? gdb/testsuite/gdb.modula2/unbounded1 ? gdb/testsuite/gdb.objc/Makefile ? gdb/testsuite/gdb.objc/gdb.log ? gdb/testsuite/gdb.objc/gdb.sum ? gdb/testsuite/gdb.opt/Makefile ? gdb/testsuite/gdb.opt/clobbered-registers-O2 ? gdb/testsuite/gdb.opt/gdb.log ? gdb/testsuite/gdb.opt/gdb.sum ? gdb/testsuite/gdb.opt/inline-bt ? gdb/testsuite/gdb.opt/inline-cmds ? gdb/testsuite/gdb.opt/inline-locals ? gdb/testsuite/gdb.pascal/Makefile ? gdb/testsuite/gdb.pascal/gdb.log ? gdb/testsuite/gdb.pascal/gdb.sum ? gdb/testsuite/gdb.python/Makefile ? gdb/testsuite/gdb.python/gdb.log ? gdb/testsuite/gdb.python/gdb.sum ? gdb/testsuite/gdb.python/py-frame ? gdb/testsuite/gdb.python/py-prettyprint ? gdb/testsuite/gdb.python/py-template ? gdb/testsuite/gdb.python/py-value ? gdb/testsuite/gdb.python/python-frame ? gdb/testsuite/gdb.python/python-prettyprint ? gdb/testsuite/gdb.python/python-template ? gdb/testsuite/gdb.reverse/Makefile ? gdb/testsuite/gdb.reverse/gdb.log ? gdb/testsuite/gdb.reverse/gdb.sum ? gdb/testsuite/gdb.server/Makefile ? gdb/testsuite/gdb.server/ext-attach ? gdb/testsuite/gdb.server/ext-run ? gdb/testsuite/gdb.server/file-transfer ? gdb/testsuite/gdb.server/gdb.log ? gdb/testsuite/gdb.server/gdb.sum ? gdb/testsuite/gdb.server/server-mon ? gdb/testsuite/gdb.server/server-run ? gdb/testsuite/gdb.stabs/Makefile ? gdb/testsuite/gdb.stabs/config.log ? gdb/testsuite/gdb.stabs/config.status ? gdb/testsuite/gdb.stabs/exclfwd ? gdb/testsuite/gdb.stabs/gdb.log ? gdb/testsuite/gdb.stabs/gdb.sum ? gdb/testsuite/gdb.threads/Makefile ? gdb/testsuite/gdb.threads/attach-into-signal ? gdb/testsuite/gdb.threads/attach-stopped ? gdb/testsuite/gdb.threads/attachstop-mt ? gdb/testsuite/gdb.threads/bp_in_thread ? gdb/testsuite/gdb.threads/current-lwp-dead ? gdb/testsuite/gdb.threads/execl ? gdb/testsuite/gdb.threads/execl1 ? gdb/testsuite/gdb.threads/fork-child-threads ? gdb/testsuite/gdb.threads/fork-thread-pending ? gdb/testsuite/gdb.threads/gcore-pthreads ? gdb/testsuite/gdb.threads/gcore.test ? gdb/testsuite/gdb.threads/gdb.log ? gdb/testsuite/gdb.threads/gdb.sum ? gdb/testsuite/gdb.threads/hand-call-in-threads ? gdb/testsuite/gdb.threads/interrupted-hand-call ? gdb/testsuite/gdb.threads/killed ? gdb/testsuite/gdb.threads/linux-dp ? gdb/testsuite/gdb.threads/manythreads ? gdb/testsuite/gdb.threads/multi-create ? gdb/testsuite/gdb.threads/pending-step ? gdb/testsuite/gdb.threads/print-threads ? gdb/testsuite/gdb.threads/pthread_cond_wait ? gdb/testsuite/gdb.threads/pthreads ? gdb/testsuite/gdb.threads/schedlock ? gdb/testsuite/gdb.threads/sigthread ? gdb/testsuite/gdb.threads/staticthreads ? gdb/testsuite/gdb.threads/switch-threads ? gdb/testsuite/gdb.threads/thread-execl ? gdb/testsuite/gdb.threads/thread-specific ? gdb/testsuite/gdb.threads/thread_check ? gdb/testsuite/gdb.threads/thread_events ? gdb/testsuite/gdb.threads/threadapply ? gdb/testsuite/gdb.threads/threxit-hop-specific ? gdb/testsuite/gdb.threads/tls ? gdb/testsuite/gdb.threads/tls-main ? gdb/testsuite/gdb.threads/tls-nodebug ? gdb/testsuite/gdb.threads/watchthreads ? gdb/testsuite/gdb.threads/watchthreads2 ? gdb/testsuite/gdb.trace/Makefile ? gdb/testsuite/gdb.trace/actions ? gdb/testsuite/gdb.trace/backtrace ? gdb/testsuite/gdb.trace/circ ? gdb/testsuite/gdb.trace/collection ? gdb/testsuite/gdb.trace/deltrace ? gdb/testsuite/gdb.trace/gdb.log ? gdb/testsuite/gdb.trace/gdb.sum ? gdb/testsuite/gdb.trace/infotrace ? gdb/testsuite/gdb.trace/limits ? gdb/testsuite/gdb.trace/packetlen ? gdb/testsuite/gdb.trace/passc-dyn ? gdb/testsuite/gdb.trace/passcount ? gdb/testsuite/gdb.trace/report ? gdb/testsuite/gdb.trace/save-trace ? gdb/testsuite/gdb.trace/tfind ? gdb/testsuite/gdb.trace/tracecmd ? gdb/testsuite/gdb.trace/while-dyn ? gdb/testsuite/gdb.trace/while-stepping ? gdb/testsuite/gdb.xml/Makefile ? gdb/testsuite/gdb.xml/gdb.log ? gdb/testsuite/gdb.xml/gdb.sum ? intl/Makefile ? intl/config.cache ? intl/config.h ? intl/config.intl ? intl/config.log ? intl/config.status ? libdecnumber/Makefile ? libdecnumber/config.cache ? libdecnumber/config.h ? libdecnumber/config.log ? libdecnumber/config.status ? libdecnumber/gstdint.h ? libdecnumber/stamp-h1 ? libiberty/Makefile ? libiberty/config.cache ? libiberty/config.h ? libiberty/config.log ? libiberty/config.status ? libiberty/required-list ? libiberty/stamp-h ? libiberty/stamp-picdir ? libiberty/xhost-mkfrag ? libiberty/testsuite/Makefile ? libiberty/testsuite/test-demangle ? libiberty/testsuite/test-expandargv ? libiberty/testsuite/test-pexecute ? opcodes/.deps ? opcodes/.libs ? opcodes/Makefile ? opcodes/config.cache ? opcodes/config.h ? opcodes/config.log ? opcodes/config.status ? opcodes/dis-buf.lo ? opcodes/dis-init.lo ? opcodes/disassemble.lo ? opcodes/i386-dis.lo ? opcodes/i386-opc.lo ? opcodes/libopcodes.la ? opcodes/libtool ? opcodes/stamp-h1 ? opcodes/stamp-lib ? opcodes/po/Makefile ? opcodes/po/Makefile.in ? opcodes/po/POTFILES ? readline/Makefile ? readline/config.cache ? readline/config.h ? readline/config.log ? readline/config.status ? readline/stamp-h ? readline/doc/Makefile ? readline/examples/Makefile ? readline/shlib/Makefile ? sim/Makefile ? sim/config.cache ? sim/config.log ? sim/config.status Index: gdb/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.10923 diff -u -r1.10923 ChangeLog --- gdb/ChangeLog 29 Sep 2009 16:27:05 -0000 1.10923 +++ gdb/ChangeLog 1 Oct 2009 04:49:47 -0000 @@ -1,3 +1,17 @@ +2009-09-30 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * remote.c (interrupt_sequence_control_c) + (interrupt_sequence_break, interrupt_sequence_sysrq_g) + (interrupt_sequence_modes): New constants. + (interrupt_sequence_mode, interrupt_on_connect): New variable. + (show_interrupt_sequence): New function. + (set_remotebreak, show_remotebreak): New function. + (send_interrupt_sequence: New function. + (remote_start_remote): Call send_interrupt_sequence if interrupt_on_connect. + (remote_stop_as): Call send_interrupt_sequence. + (_initialize_remote): Add interrupt-sequence and interrupt-on-connect, + modify remotebreak to call set_remotebreak and show_remotebreak. + 2009-09-29 Jan Kratochvil <jan.kratochvil@redhat.com> * ia64-tdep.c (ia64_convert_from_func_ptr_addr): New variable buf. Index: gdb/NEWS =================================================================== RCS file: /cvs/src/src/gdb/NEWS,v retrieving revision 1.331 diff -u -r1.331 NEWS --- gdb/NEWS 15 Sep 2009 03:30:04 -0000 1.331 +++ gdb/NEWS 1 Oct 2009 04:49:49 -0000 @@ -234,6 +234,24 @@ * New commands (for set/show, see "New options" below) +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g] +show remote interrupt-sequence + Allow the user to select one of ^C, a break or Magic SysRq g as the + sequence to the remote target in order to interrupt the execution. + Ctrl-C is a default. Some system prefers BREAK which is high level of + serial line for some certain time. Linux kernel prefers SysRq-g, a.k.a + Magic SysRq. It is BREAK signal and character 'g'. + +set remote interrupt-on-connect [on | off] +show remote interrupt-on-connect + When interrupt-on-connect is ON, gdb sends interrupt-sequence to + remote target when gdb connects to it. This is needed when you debug + Linux kernel. + +set remotebreak [on | off] +show remotebreak +Deprecated. Use "set/show remote interrupt-sequence" instead. + catch syscall [NAME(S) | NUMBER(S)] Catch system calls. Arguments, which should be names of system calls or their numbers, mean catch only those syscalls. Without Index: gdb/remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.372 diff -u -r1.372 remote.c --- gdb/remote.c 10 Sep 2009 22:47:56 -0000 1.372 +++ gdb/remote.c 1 Oct 2009 04:49:52 -0000 @@ -546,14 +546,76 @@ this can go away. */ static int wait_forever_enabled_p = 1; +/* Allow the user to specify what sequence to send to the remote + when he requests a program interruption: Although ^C is usually + what remote systems expect (this is the default, here), it is + sometimes preferable to send a break. On other systems such + as the Linux kernel, a break followed by g, which is Magic SysRq g + is required in order to interrupt the execution. */ +const char interrupt_sequence_control_c[] = "Ctrl-C"; +const char interrupt_sequence_break[] = "BREAK"; +const char interrupt_sequence_sysrq_g[] = "SysRq-g"; +static const char *interrupt_sequence_modes[] = + { + interrupt_sequence_control_c, + interrupt_sequence_break, + interrupt_sequence_sysrq_g, + NULL + }; +static const char *interrupt_sequence_mode = interrupt_sequence_control_c; -/* This variable chooses whether to send a ^C or a break when the user - requests program interruption. Although ^C is usually what remote - systems expect, and that is the default here, sometimes a break is - preferable instead. */ +static void +show_interrupt_sequence (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value) +{ + if (interrupt_sequence_mode == interrupt_sequence_control_c) + fprintf_filtered (file, + _("Send the ASCII ETX character (Ctrl-c) " + "to the remote target to interrupt the " + "execution of the program.\n")); + else if (interrupt_sequence_mode == interrupt_sequence_break) + fprintf_filtered (file, + _("send a break signal to the remote target " + "to interrupt the execution of the program.\n")); + else if (interrupt_sequence_mode == interrupt_sequence_sysrq_g) + fprintf_filtered (file, + _("Send a break signal and 'g' a.k.a. SysRq-g and Magic SysRq to " + "the remote target to interrupt the execution " + "of Linux kernel.\n")); + else + internal_error (__FILE__, __LINE__, + _("Invalid value for interrupt_sequence_mode: %s."), + interrupt_sequence_mode); +} +/* This boolean variable specifies whether interrupt_sequence is sent + to remote target when gdb starts. This is mostly needed when you debug + Linux kernel. Linux kernel expects BREAK g which is Magic SysRq for + connecting gdb. */ +static int interrupt_on_connect = 0; + +/* This variable is used to implement the "set/show remotebreak" commands. + Since these commands are now deprecated in favor of "set/show remote + interrupt-sequence", it no longer has any effect on the code. */ static int remote_break; +static void +set_remotebreak (char *args, int from_tty, struct cmd_list_element *c) +{ + if (remote_break) + interrupt_sequence_mode = interrupt_sequence_break; + else + interrupt_sequence_mode = interrupt_sequence_control_c; +} + +static void +show_remotebreak (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value) +{ +} + /* Descriptor for I/O to remote machine. Initialize it to NULL so that remote_open knows that we don't have a file open when the program starts. */ @@ -2585,6 +2647,25 @@ int extended_p; }; +/* Send interrupt_sequence to remote target. */ +static void +send_interrupt_sequence () +{ + if (interrupt_sequence_mode == interrupt_sequence_control_c) + serial_write (remote_desc, "\x03", 1); + else if (interrupt_sequence_mode == interrupt_sequence_break) + serial_send_break (remote_desc); + else if (interrupt_sequence_mode == interrupt_sequence_sysrq_g) + { + serial_send_break (remote_desc); + serial_write (remote_desc, "g", 1); + } + else + internal_error (__FILE__, __LINE__, + _("Invalid value for interrupt_sequence_mode: %s."), + interrupt_sequence_mode); +} + static void remote_start_remote (struct ui_out *uiout, void *opaque) { @@ -2598,6 +2679,9 @@ /* Ack any packet which the remote side has already sent. */ serial_write (remote_desc, "+", 1); + if (interrupt_on_connect) + send_interrupt_sequence (); + /* The first packet we send to the target is the optional "supported packets" request. If the target can answer this, it will tell us which later probes to skip. */ @@ -4021,12 +4105,8 @@ if (rs->cached_wait_status) return; - /* Send a break or a ^C, depending on user preference. */ - - if (remote_break) - serial_send_break (remote_desc); - else - serial_write (remote_desc, "\003", 1); + /* Send interrupt_sequence to remote target. */ + send_interrupt_sequence (); } /* This is the generic stop called via the target vector. When a target @@ -8993,6 +9073,10 @@ _initialize_remote (void) { struct remote_state *rs; + struct cmd_list_element *cmd; + /* I can't use the same string for lookup_cmd(). Cause segment fault. */ + static char *_set_remotebreak_ = "remotebreak"; + static char *_show_remotebreak_ = "remotebreak"; /* architecture specific data */ remote_gdbarch_data_handle = @@ -9056,12 +9140,33 @@ terminating `#' character and checksum."), &maintenancelist); - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ -Set whether to send break if interrupted."), _("\ -Show whether to send break if interrupted."), _("\ + add_setshow_boolean_cmd ("remotebreak", class_obscure, &remote_break, _("\ +Use \"set remote interrupt-sequence [control-c|break]\" instead."), _("\ +Use \"show remote interrupt-sequence\" instead."), _("\ If set, a break, instead of a cntrl-c, is sent to the remote target."), - NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is %s. */ + set_remotebreak, show_remotebreak, &setlist, &showlist); + cmd = lookup_cmd (&_set_remotebreak_, setlist, "", -1, 1); + deprecate_cmd (cmd, "set remote interrupt-sequence"); + cmd = lookup_cmd (&_show_remotebreak_, showlist, "", -1, 1); + deprecate_cmd (cmd, "show remote interrupt-sequence"); + + add_setshow_enum_cmd ("interrupt-sequence", class_support, + interrupt_sequence_modes, &interrupt_sequence_mode, _("\ +Set interrupt sequence to remote target."), _("\ +Show interrupt sequence to remote target."), _("\ +Valid value is \"Ctrl-C\", \"BREAK\" or \"SysRq-g\". The default is \"Ctrl-C\"."), + NULL, show_interrupt_sequence, + &remote_set_cmdlist, + &remote_show_cmdlist); + + add_setshow_boolean_cmd ("interrupt-on-connect", class_support, + &interrupt_on_connect, _("\ +Set whether interrupt-sequence is sent to remote target when gdb connects to."), _(" \ +Show whether interrupt-sequence is sent to remote target when gdb connects to."), _(" \ +If set, interrupt sequence is sent to remote target."), + NULL, NULL, + &remote_set_cmdlist, &remote_show_cmdlist); /* Install commands for configuring memory read/write packets. */ Index: gdb/doc/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/doc/ChangeLog,v retrieving revision 1.958 diff -u -r1.958 ChangeLog --- gdb/doc/ChangeLog 26 Sep 2009 16:47:13 -0000 1.958 +++ gdb/doc/ChangeLog 1 Oct 2009 04:49:55 -0000 @@ -1,3 +1,8 @@ +2009-09-30 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * gdb.texinfo (Remote Configuration): Add "set/show remote interrupt-sequence" and + "set/show remote interrupt-on-connect" command. + 2009-09-26 Pierre Muller <muller@ics.u-strasbg.fr> * gdb.texinfo (Cygwin Native): Mention support for Ctrl-BREAK. Index: gdb/doc/gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.629 diff -u -r1.629 gdb.texinfo --- gdb/doc/gdb.texinfo 26 Sep 2009 16:47:13 -0000 1.629 +++ gdb/doc/gdb.texinfo 1 Oct 2009 04:50:07 -0000 @@ -15011,6 +15011,33 @@ target system. If it is not set, the target will use a default filename (e.g.@: the last program run). +@item set remote interrupt-sequence +@cindex interrupt remote programs +@cindex select Ctrl-C, BREAK or SysRq-g +Allow the user to select one of @samp{Ctrl-C}, a @code{BREAK} or +@samp{SysRq-g} as the +sequence to the remote target in order to interrupt the execution. +@samp{Ctrl-C} is a default. Some system prefers @code{BREAK} which +is high level of serial line for some certain time. +Linux kernel prefers @samp{SysRq-g}, a.k.a Magic SysRq g. +It is @code{BREAK} signal followed by character @code{g}. + +@item show interrupt-sequence +Show which of @samp{Ctrl-C}, @code{BREAK} or @code{BREAK} followed by @code{g} +is sent by @value{GDBN} to interrupt the remote program. +@code{BREAK} followed by @code{g} is also known as Magic SysRq. + +@item set remote interrupt-on-connect +@cindex send interrupt-sequence on start +Specify whether interrupt-sequence is sent +to remote target when @value{GDBN} connects to it. This is mostly needed when you debug +Linux kernel. Linux kernel expects @code{BREAK} followed by @code{g} which is Magic SysRq +in order to connect @value{GDBN}. + +@item show interrupt-on-connect +Show whether interrupt-sequence is sent +to remote target when @value{GDBN} connects to it. + @kindex set tcp @kindex show tcp @item set tcp auto-retry on @@ -29817,9 +29844,9 @@ @cindex interrupts (remote protocol) When a program on the remote target is running, @value{GDBN} may -attempt to interrupt it by sending a @samp{Ctrl-C} or a @code{BREAK}, -control of which is specified via @value{GDBN}'s @samp{remotebreak} -setting (@pxref{set remotebreak}). +attempt to interrupt it by sending a @samp{Ctrl-C}, @code{BREAK} or +a @code{BREAK} followed by @code{g}, +control of which is specified via @value{GDBN}'s @samp{interrupt-sequence}. The precise meaning of @code{BREAK} is defined by the transport mechanism and may, in fact, be undefined. @value{GDBN} does not @@ -29836,6 +29863,11 @@ (@pxref{X packet}), used for binary downloads, may include an unescaped @code{0x03} as part of its packet. +@code{BREAK} followed by @code{g} is also known as Magic SysRq and is +@code{BREAK} and @code{g}. +When Linux kernel receives this sequence from serial port, +it stops execution and connects to gdb. + Stubs are not required to recognize these interrupt mechanisms and the precise meaning associated with receipt of the interrupt is implementation defined. If the target supports debugging of multiple ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-10-01 4:51 ` Caz Yokoyama @ 2009-10-01 20:04 ` Eli Zaretskii 0 siblings, 0 replies; 55+ messages in thread From: Eli Zaretskii @ 2009-10-01 20:04 UTC (permalink / raw) To: Caz Yokoyama; +Cc: brobecker, pedro, gdb-patches > From: Caz Yokoyama <cazyokoyama@gmail.com> > Cc: <brobecker@adacore.com>, > <pedro@codesourcery.com>, > <gdb-patches@sourceware.org> > Date: Wed, 30 Sep 2009 21:51:23 -0700 > > How about this? OK. Thanks. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-10-01 3:48 ` Caz Yokoyama 2009-10-01 4:08 ` Eli Zaretskii @ 2009-10-01 16:33 ` Joel Brobecker 2009-10-01 17:18 ` Caz Yokoyama 2009-10-01 20:13 ` Caz Yokoyama 1 sibling, 2 replies; 55+ messages in thread From: Joel Brobecker @ 2009-10-01 16:33 UTC (permalink / raw) To: Caz Yokoyama; +Cc: 'Eli Zaretskii', pedro, gdb-patches Regarding testing, since you are modifying remote.c, you'll need to run the testsuite using gdbserver. The testsuite needs to be run before and after the patch, in order to compare the results. Normally, there should be no regression. Directions on how to do that are explained at http://sourceware.org/gdb/wiki/TestingGDB (see Testing gdbserver in a native configuration). Please indicate when you submit patches that you ran the testsuite, and that you found no regression. > + * remote.c (interrupt_sequence_control_c) > + (interrupt_sequence_break, interrupt_sequence_sysrq_g) > + (interrupt_sequence_modes): New constants. > + (interrupt_sequence_mode, interrupt_on_connect): New variable. > + (show_interrupt_sequence): New function. > + (set_remotebreak, show_remotebreak): New function. > + (send_interrupt_sequence: New function. > + (remote_start_remote): Call send_interrupt_sequence if interrupt_on_connect. > + (remote_stop_as): Call send_interrupt_sequence. > + (_initialize_remote): Add interrupt-sequence and interrupt-on-connect, > + modify remotebreak to call set_remotebreak and show_remotebreak. Just a few formatting nits left: The ChangeLog entries needs to be indented using tabs. You're mixing spaces and tabs. You're missing a closing parenthesis after send_interrupt_sequence and the line just after is too long (maximum is 79 or 80 characters). > +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g] You changed the user interface again, this is really fustrating. Personally, I don't care anymore what names we use for these options and I can see why you prefer them, but since we're changing them again, please ask Daniel Jacobowitz and Pedro Alves, who are the major maintainers and regular users of this code, whether they are OK with your choices. In the future, I would really appreciate if we agreed on the user interface first, without considering code while doing that, and then stay with what we've agreed on. Otherwise, things keep changing every time I look at a patch, and we both waste valuable time. That being said, we're getting there. > +/* This boolean variable specifies whether interrupt_sequence is sent > + to remote target when gdb starts. This is mostly needed when you debug > + Linux kernel. Linux kernel expects BREAK g which is Magic SysRq for > + connecting gdb. */ Formatting: 2 spaces after each of the 2 periods. > @@ -8993,6 +9073,10 @@ > _initialize_remote (void) > { > struct remote_state *rs; > + struct cmd_list_element *cmd; > + /* I can't use the same string for lookup_cmd(). Cause segment fault. */ > + static char *_set_remotebreak_ = "remotebreak"; > + static char *_show_remotebreak_ = "remotebreak"; Try this instead: char *cmd_name; cmd_name = "remotebreak"; cmd = lookup_cmd (&cmd_name, setlist, "", -1, 1); deprecate_cmd (cmd, "set remote interrupt-sequence"); cmd_name = "remotebreak"; cmd = lookup_cmd (&cmd_name, showlist, "", -1, 1); deprecate_cmd (cmd, "show remote interrupt-sequence"); The reason why you're getting the SEGV is because lookup_cmd updates the pointer your passing to point after the command name it has matched. > - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ > -Set whether to send break if interrupted."), _("\ > -Show whether to send break if interrupted."), _("\ > + add_setshow_boolean_cmd ("remotebreak", class_obscure, &remote_break, _("\ > +Deprecated. Use \"set remote interrupt-sequence [control-c|break]\" instead."), _("\ > +Deprecated. Use \"show remote interrupt-sequence\" instead."), _("\ Please undo this part of the change. You do NOT need to update the command documentation for "set/show remotebreak", since this is already taken care -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-10-01 16:33 ` Joel Brobecker @ 2009-10-01 17:18 ` Caz Yokoyama 2009-10-01 19:37 ` Joel Brobecker 2009-10-01 20:19 ` Eli Zaretskii 2009-10-01 20:13 ` Caz Yokoyama 1 sibling, 2 replies; 55+ messages in thread From: Caz Yokoyama @ 2009-10-01 17:18 UTC (permalink / raw) To: 'Joel Brobecker'; +Cc: 'Eli Zaretskii', pedro, gdb-patches Hello Joel, >> +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g] >You changed the user interface again, this is really frustrating. Sorry for frustrating you. The reason I changed is the following words by Eli. >Please use the same conventions for these keys as in the portion you are replacing. >For example, BREAK should be in caps and control-c should be spelled Ctrl-C. When interrupt sequence is controlled by remotebreak, the user does not need to enter strings. On the other hand, s/he has to specify sequence name on "set remote interrupt-sequence". In addition, the sequence name has to be same on document and actual command. Therefore, I changed according to Eli. Let me know what you want. -caz -----Original Message----- From: Joel Brobecker [mailto:brobecker@adacore.com] Sent: Thursday, October 01, 2009 9:34 AM To: Caz Yokoyama Cc: 'Eli Zaretskii'; pedro@codesourcery.com; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light Regarding testing, since you are modifying remote.c, you'll need to run the testsuite using gdbserver. The testsuite needs to be run before and after the patch, in order to compare the results. Normally, there should be no regression. Directions on how to do that are explained at http://sourceware.org/gdb/wiki/TestingGDB (see Testing gdbserver in a native configuration). Please indicate when you submit patches that you ran the testsuite, and that you found no regression. > + * remote.c (interrupt_sequence_control_c) > + (interrupt_sequence_break, interrupt_sequence_sysrq_g) > + (interrupt_sequence_modes): New constants. > + (interrupt_sequence_mode, interrupt_on_connect): New variable. > + (show_interrupt_sequence): New function. > + (set_remotebreak, show_remotebreak): New function. > + (send_interrupt_sequence: New function. > + (remote_start_remote): Call send_interrupt_sequence if interrupt_on_connect. > + (remote_stop_as): Call send_interrupt_sequence. > + (_initialize_remote): Add interrupt-sequence and interrupt-on-connect, > + modify remotebreak to call set_remotebreak and show_remotebreak. Just a few formatting nits left: The ChangeLog entries needs to be indented using tabs. You're mixing spaces and tabs. You're missing a closing parenthesis after send_interrupt_sequence and the line just after is too long (maximum is 79 or 80 characters). > +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g] You changed the user interface again, this is really fustrating. Personally, I don't care anymore what names we use for these options and I can see why you prefer them, but since we're changing them again, please ask Daniel Jacobowitz and Pedro Alves, who are the major maintainers and regular users of this code, whether they are OK with your choices. In the future, I would really appreciate if we agreed on the user interface first, without considering code while doing that, and then stay with what we've agreed on. Otherwise, things keep changing every time I look at a patch, and we both waste valuable time. That being said, we're getting there. > +/* This boolean variable specifies whether interrupt_sequence is sent > + to remote target when gdb starts. This is mostly needed when you debug > + Linux kernel. Linux kernel expects BREAK g which is Magic SysRq for > + connecting gdb. */ Formatting: 2 spaces after each of the 2 periods. > @@ -8993,6 +9073,10 @@ > _initialize_remote (void) > { > struct remote_state *rs; > + struct cmd_list_element *cmd; > + /* I can't use the same string for lookup_cmd(). Cause segment fault. */ > + static char *_set_remotebreak_ = "remotebreak"; > + static char *_show_remotebreak_ = "remotebreak"; Try this instead: char *cmd_name; cmd_name = "remotebreak"; cmd = lookup_cmd (&cmd_name, setlist, "", -1, 1); deprecate_cmd (cmd, "set remote interrupt-sequence"); cmd_name = "remotebreak"; cmd = lookup_cmd (&cmd_name, showlist, "", -1, 1); deprecate_cmd (cmd, "show remote interrupt-sequence"); The reason why you're getting the SEGV is because lookup_cmd updates the pointer your passing to point after the command name it has matched. > - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ > -Set whether to send break if interrupted."), _("\ > -Show whether to send break if interrupted."), _("\ > + add_setshow_boolean_cmd ("remotebreak", class_obscure, &remote_break, _("\ > +Deprecated. Use \"set remote interrupt-sequence [control-c|break]\" instead."), _("\ > +Deprecated. Use \"show remote interrupt-sequence\" instead."), _("\ Please undo this part of the change. You do NOT need to update the command documentation for "set/show remotebreak", since this is already taken care -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-10-01 17:18 ` Caz Yokoyama @ 2009-10-01 19:37 ` Joel Brobecker 2009-10-01 19:53 ` Caz Yokoyama 2009-10-01 20:25 ` Eli Zaretskii 2009-10-01 20:19 ` Eli Zaretskii 1 sibling, 2 replies; 55+ messages in thread From: Joel Brobecker @ 2009-10-01 19:37 UTC (permalink / raw) To: Caz Yokoyama; +Cc: 'Eli Zaretskii', pedro, gdb-patches > >> +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g] > >You changed the user interface again, this is really frustrating. > Sorry for frustrating you. The reason I changed is the following words by > Eli. OK - sorry if I snapped a little. I couldn't understand this even after re-reviewing the previous emails. I think you misunderstood what Eli said, but I will let him confirm (and re-explain) or deny that. As I said, either way is fine by me at this point, I just want the functionality to be there, and the naming is not hugely important after all. I suggested break-g over SysRq-g because perhaps SysRq could be implemented through a different character (?). > >Please use the same conventions for these keys as in the portion you are > replacing. >For example, BREAK should be in caps and control-c should be > spelled Ctrl-C. > > When interrupt sequence is controlled by remotebreak, the user does not need > to enter strings. On the other hand, s/he has to specify sequence name on > "set remote interrupt-sequence". In addition, the sequence name has to be > same on document and actual command. Therefore, I changed according to Eli. > Let me know what you want. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-10-01 19:37 ` Joel Brobecker @ 2009-10-01 19:53 ` Caz Yokoyama 2009-10-01 20:25 ` Eli Zaretskii 1 sibling, 0 replies; 55+ messages in thread From: Caz Yokoyama @ 2009-10-01 19:53 UTC (permalink / raw) To: 'Joel Brobecker', 'Caz Yokoyama' Cc: 'Eli Zaretskii', pedro, gdb-patches > after all. I suggested break-g over SysRq-g because perhaps SysRq >could be implemented through a different character (?). I agree. BREAK-g is OK for you?. Eli may prefer also. -caz -----Original Message----- From: Joel Brobecker [mailto:brobecker@adacore.com] Sent: Thursday, October 01, 2009 12:37 PM To: Caz Yokoyama Cc: 'Eli Zaretskii'; pedro@codesourcery.com; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light > >> +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g] > >You changed the user interface again, this is really frustrating. > Sorry for frustrating you. The reason I changed is the following words by > Eli. OK - sorry if I snapped a little. I couldn't understand this even after re-reviewing the previous emails. I think you misunderstood what Eli said, but I will let him confirm (and re-explain) or deny that. As I said, either way is fine by me at this point, I just want the functionality to be there, and the naming is not hugely important after all. I suggested break-g over SysRq-g because perhaps SysRq could be implemented through a different character (?). > >Please use the same conventions for these keys as in the portion you are > replacing. >For example, BREAK should be in caps and control-c should be > spelled Ctrl-C. > > When interrupt sequence is controlled by remotebreak, the user does not need > to enter strings. On the other hand, s/he has to specify sequence name on > "set remote interrupt-sequence". In addition, the sequence name has to be > same on document and actual command. Therefore, I changed according to Eli. > Let me know what you want. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-10-01 19:37 ` Joel Brobecker 2009-10-01 19:53 ` Caz Yokoyama @ 2009-10-01 20:25 ` Eli Zaretskii 1 sibling, 0 replies; 55+ messages in thread From: Eli Zaretskii @ 2009-10-01 20:25 UTC (permalink / raw) To: Joel Brobecker; +Cc: cazyokoyama, pedro, gdb-patches > Date: Thu, 1 Oct 2009 12:36:42 -0700 > From: Joel Brobecker <brobecker@adacore.com> > Cc: 'Eli Zaretskii' <eliz@gnu.org>, pedro@codesourcery.com, gdb-patches@sourceware.org > > > >> +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g] > > >You changed the user interface again, this is really frustrating. > > Sorry for frustrating you. The reason I changed is the following words by > > Eli. > > OK - sorry if I snapped a little. I couldn't understand this even after > re-reviewing the previous emails. I think you misunderstood what Eli > said, but I will let him confirm (and re-explain) or deny that. As I wrote, I had no intention to ask for any changes in the UI. I was asking for standard _naming_ of these keys in the manual text. However, what strings the user types on the GDB command line is another matter. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-10-01 17:18 ` Caz Yokoyama 2009-10-01 19:37 ` Joel Brobecker @ 2009-10-01 20:19 ` Eli Zaretskii 2009-10-01 20:29 ` Caz Yokoyama 1 sibling, 1 reply; 55+ messages in thread From: Eli Zaretskii @ 2009-10-01 20:19 UTC (permalink / raw) To: Caz Yokoyama; +Cc: brobecker, pedro, gdb-patches > From: Caz Yokoyama <cazyokoyama@gmail.com> > Cc: "'Eli Zaretskii'" <eliz@gnu.org>, <pedro@codesourcery.com>, <gdb-patches@sourceware.org> > Date: Thu, 1 Oct 2009 10:18:28 -0700 > > >> +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g] > >You changed the user interface again, this is really frustrating. > Sorry for frustrating you. The reason I changed is the following words by > Eli. > > >Please use the same conventions for these keys as in the portion you are > replacing. >For example, BREAK should be in caps and control-c should be > spelled Ctrl-C. I'm sorry, it seems I didn't make myself clear. What I meant by the above is that these should be spelled like that in the manual. I didn't mean to suggest that the interface should be changed, just that when you are speaking about these key sequences, spell them as elsewhere in the manual. ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-10-01 20:19 ` Eli Zaretskii @ 2009-10-01 20:29 ` Caz Yokoyama 2009-10-01 20:46 ` Joel Brobecker 0 siblings, 1 reply; 55+ messages in thread From: Caz Yokoyama @ 2009-10-01 20:29 UTC (permalink / raw) To: 'Eli Zaretskii'; +Cc: brobecker, pedro, gdb-patches Hello Eli, Actually I support your spellings. Ctrl-C is much popular than control-c, BREAK is popular than break for break signal. SysRq-g should be BREAK-g as Joel said. -caz -----Original Message----- From: Eli Zaretskii [mailto:eliz@gnu.org] Sent: Thursday, October 01, 2009 1:21 PM To: Caz Yokoyama Cc: brobecker@adacore.com; pedro@codesourcery.com; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light > From: Caz Yokoyama <cazyokoyama@gmail.com> > Cc: "'Eli Zaretskii'" <eliz@gnu.org>, <pedro@codesourcery.com>, <gdb-patches@sourceware.org> > Date: Thu, 1 Oct 2009 10:18:28 -0700 > > >> +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g] > >You changed the user interface again, this is really frustrating. > Sorry for frustrating you. The reason I changed is the following words by > Eli. > > >Please use the same conventions for these keys as in the portion you are > replacing. >For example, BREAK should be in caps and control-c should be > spelled Ctrl-C. I'm sorry, it seems I didn't make myself clear. What I meant by the above is that these should be spelled like that in the manual. I didn't mean to suggest that the interface should be changed, just that when you are speaking about these key sequences, spell them as elsewhere in the manual. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-10-01 20:29 ` Caz Yokoyama @ 2009-10-01 20:46 ` Joel Brobecker 2009-10-01 21:10 ` Daniel Jacobowitz 0 siblings, 1 reply; 55+ messages in thread From: Joel Brobecker @ 2009-10-01 20:46 UTC (permalink / raw) To: Caz Yokoyama; +Cc: 'Eli Zaretskii', pedro, gdb-patches > Actually I support your spellings. Ctrl-C is much popular than control-c, > BREAK is popular than break for break signal. SysRq-g should be BREAK-g as > Joel said. Your arguments make sense and I am fine with your choices. But we generally use lower-case names for the various GDB settings, so do double-check with Daniel J and Pedro that they are also fine with these choices. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-10-01 20:46 ` Joel Brobecker @ 2009-10-01 21:10 ` Daniel Jacobowitz 2009-10-01 21:58 ` Caz Yokoyama 2009-10-01 22:13 ` Pedro Alves 0 siblings, 2 replies; 55+ messages in thread From: Daniel Jacobowitz @ 2009-10-01 21:10 UTC (permalink / raw) To: Joel Brobecker; +Cc: Caz Yokoyama, 'Eli Zaretskii', pedro, gdb-patches On Thu, Oct 01, 2009 at 01:46:24PM -0700, Joel Brobecker wrote: > > Actually I support your spellings. Ctrl-C is much popular than control-c, > > BREAK is popular than break for break signal. SysRq-g should be BREAK-g as > > Joel said. > > Your arguments make sense and I am fine with your choices. But we generally > use lower-case names for the various GDB settings, so do double-check > with Daniel J and Pedro that they are also fine with these choices. I have no opinion (and think we've spent more time on these names than they required - let's just do it). -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-10-01 21:10 ` Daniel Jacobowitz @ 2009-10-01 21:58 ` Caz Yokoyama 2009-10-01 22:13 ` Pedro Alves 1 sibling, 0 replies; 55+ messages in thread From: Caz Yokoyama @ 2009-10-01 21:58 UTC (permalink / raw) To: 'Daniel Jacobowitz', 'Joel Brobecker' Cc: 'Eli Zaretskii', pedro, gdb-patches Will do. -caz -----Original Message----- From: Daniel Jacobowitz [mailto:drow@false.org] Sent: Thursday, October 01, 2009 2:10 PM To: Joel Brobecker Cc: Caz Yokoyama; 'Eli Zaretskii'; pedro@codesourcery.com; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light On Thu, Oct 01, 2009 at 01:46:24PM -0700, Joel Brobecker wrote: > > Actually I support your spellings. Ctrl-C is much popular than control-c, > > BREAK is popular than break for break signal. SysRq-g should be BREAK-g as > > Joel said. > > Your arguments make sense and I am fine with your choices. But we generally > use lower-case names for the various GDB settings, so do double-check > with Daniel J and Pedro that they are also fine with these choices. I have no opinion (and think we've spent more time on these names than they required - let's just do it). -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-10-01 21:10 ` Daniel Jacobowitz 2009-10-01 21:58 ` Caz Yokoyama @ 2009-10-01 22:13 ` Pedro Alves 2009-10-01 23:04 ` Caz Yokoyama 1 sibling, 1 reply; 55+ messages in thread From: Pedro Alves @ 2009-10-01 22:13 UTC (permalink / raw) To: Daniel Jacobowitz Cc: Joel Brobecker, Caz Yokoyama, 'Eli Zaretskii', gdb-patches On Thursday 01 October 2009 22:10:15, Daniel Jacobowitz wrote: > On Thu, Oct 01, 2009 at 01:46:24PM -0700, Joel Brobecker wrote: > > > Actually I support your spellings. Ctrl-C is much popular than control-c, > > > BREAK is popular than break for break signal. SysRq-g should be BREAK-g as > > > Joel said. > > > > Your arguments make sense and I am fine with your choices. But we generally > > use lower-case names for the various GDB settings, so do double-check > > with Daniel J and Pedro that they are also fine with these choices. > > I have no opinion (and think we've spent more time on these names than > they required - let's just do it). Ditto. -- Pedro Alves ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-10-01 22:13 ` Pedro Alves @ 2009-10-01 23:04 ` Caz Yokoyama 2009-10-01 23:32 ` Joel Brobecker 0 siblings, 1 reply; 55+ messages in thread From: Caz Yokoyama @ 2009-10-01 23:04 UTC (permalink / raw) To: 'Joel Brobecker' Cc: 'Eli Zaretskii', gdb-patches, 'Daniel Jacobowitz', 'Pedro Alves' [-- Attachment #1: Type: text/plain, Size: 1277 bytes --] Here is the updated patch. - Use Ctrl-C, BREAK and BREAK-g - Use tab only in gdb/ChangeLog. - Add 2 spaces after period. - cmd_name is initialized on each lookup_cmd(). - add_setshow_boolean_cmd ("remotebreak", ...) has no change except for calling set_remotebreak and show_remotebreak - Tested. No regression. -caz -----Original Message----- From: Pedro Alves [mailto:pedro@codesourcery.com] Sent: Thursday, October 01, 2009 3:14 PM To: Daniel Jacobowitz Cc: Joel Brobecker; Caz Yokoyama; 'Eli Zaretskii'; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light On Thursday 01 October 2009 22:10:15, Daniel Jacobowitz wrote: > On Thu, Oct 01, 2009 at 01:46:24PM -0700, Joel Brobecker wrote: > > > Actually I support your spellings. Ctrl-C is much popular than control-c, > > > BREAK is popular than break for break signal. SysRq-g should be BREAK-g as > > > Joel said. > > > > Your arguments make sense and I am fine with your choices. But we generally > > use lower-case names for the various GDB settings, so do double-check > > with Daniel J and Pedro that they are also fine with these choices. > > I have no opinion (and think we've spent more time on these names than > they required - let's just do it). Ditto. -- Pedro Alves [-- Attachment #2: remotebreak.patch --] [-- Type: application/octet-stream, Size: 12922 bytes --] Index: gdb/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.10924 diff -u -r1.10924 ChangeLog --- gdb/ChangeLog 1 Oct 2009 20:09:20 -0000 1.10924 +++ gdb/ChangeLog 1 Oct 2009 22:41:03 -0000 @@ -1,3 +1,18 @@ +2009-10-01 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * remote.c (interrupt_sequence_control_c) + (interrupt_sequence_break, interrupt_sequence_sysrq_g) + (interrupt_sequence_modes): New constants. + (interrupt_sequence_mode, interrupt_on_connect): New variable. + (show_interrupt_sequence): New function. + (set_remotebreak, show_remotebreak): New function. + (send_interrupt_sequence): New function. + (remote_start_remote): Call send_interrupt_sequence if + interrupt_on_connect is true. + (remote_stop_as): Call send_interrupt_sequence. + (_initialize_remote): Add interrupt-sequence and interrupt-on-connect, + modify remotebreak to call set_remotebreak and show_remotebreak. + 2009-10-01 Phil Muldoon <pmuldoon@redhat.com> * infcall.c (call_function_by_hand): Add a new cleanup branch for Index: gdb/NEWS =================================================================== RCS file: /cvs/src/src/gdb/NEWS,v retrieving revision 1.331 diff -u -r1.331 NEWS --- gdb/NEWS 15 Sep 2009 03:30:04 -0000 1.331 +++ gdb/NEWS 1 Oct 2009 22:41:05 -0000 @@ -234,6 +234,24 @@ * New commands (for set/show, see "New options" below) +set remote interrupt-sequence [Ctrl-C | BREAK | BREAK-g] +show remote interrupt-sequence + Allow the user to select one of ^C, a BREAK signal or BREAK-g + as the sequence to the remote target in order to interrupt the execution. + Ctrl-C is a default. Some system prefers BREAK which is high level of + serial line for some certain time. Linux kernel prefers BREAK-g, a.k.a + Magic SysRq g. It is BREAK signal and character 'g'. + +set remote interrupt-on-connect [on | off] +show remote interrupt-on-connect + When interrupt-on-connect is ON, gdb sends interrupt-sequence to + remote target when gdb connects to it. This is needed when you debug + Linux kernel. + +set remotebreak [on | off] +show remotebreak +Deprecated. Use "set/show remote interrupt-sequence" instead. + catch syscall [NAME(S) | NUMBER(S)] Catch system calls. Arguments, which should be names of system calls or their numbers, mean catch only those syscalls. Without Index: gdb/remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.372 diff -u -r1.372 remote.c --- gdb/remote.c 10 Sep 2009 22:47:56 -0000 1.372 +++ gdb/remote.c 1 Oct 2009 22:41:08 -0000 @@ -546,14 +546,76 @@ this can go away. */ static int wait_forever_enabled_p = 1; +/* Allow the user to specify what sequence to send to the remote + when he requests a program interruption: Although ^C is usually + what remote systems expect (this is the default, here), it is + sometimes preferable to send a break. On other systems such + as the Linux kernel, a break followed by g, which is Magic SysRq g + is required in order to interrupt the execution. */ +const char interrupt_sequence_control_c[] = "Ctrl-C"; +const char interrupt_sequence_break[] = "BREAK"; +const char interrupt_sequence_sysrq_g[] = "BREAK-g"; +static const char *interrupt_sequence_modes[] = + { + interrupt_sequence_control_c, + interrupt_sequence_break, + interrupt_sequence_sysrq_g, + NULL + }; +static const char *interrupt_sequence_mode = interrupt_sequence_control_c; -/* This variable chooses whether to send a ^C or a break when the user - requests program interruption. Although ^C is usually what remote - systems expect, and that is the default here, sometimes a break is - preferable instead. */ +static void +show_interrupt_sequence (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value) +{ + if (interrupt_sequence_mode == interrupt_sequence_control_c) + fprintf_filtered (file, + _("Send the ASCII ETX character (Ctrl-c) " + "to the remote target to interrupt the " + "execution of the program.\n")); + else if (interrupt_sequence_mode == interrupt_sequence_break) + fprintf_filtered (file, + _("send a break signal to the remote target " + "to interrupt the execution of the program.\n")); + else if (interrupt_sequence_mode == interrupt_sequence_sysrq_g) + fprintf_filtered (file, + _("Send a break signal and 'g' a.k.a. Magic SysRq g to " + "the remote target to interrupt the execution " + "of Linux kernel.\n")); + else + internal_error (__FILE__, __LINE__, + _("Invalid value for interrupt_sequence_mode: %s."), + interrupt_sequence_mode); +} +/* This boolean variable specifies whether interrupt_sequence is sent + to remote target when gdb connect to it. + This is mostly needed when you debug Linux kernel. + Linux kernel expects BREAK g which is Magic SysRq g for connecting gdb. */ +static int interrupt_on_connect = 0; + +/* This variable is used to implement the "set/show remotebreak" commands. + Since these commands are now deprecated in favor of "set/show remote + interrupt-sequence", it no longer has any effect on the code. */ static int remote_break; +static void +set_remotebreak (char *args, int from_tty, struct cmd_list_element *c) +{ + if (remote_break) + interrupt_sequence_mode = interrupt_sequence_break; + else + interrupt_sequence_mode = interrupt_sequence_control_c; +} + +static void +show_remotebreak (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value) +{ +} + /* Descriptor for I/O to remote machine. Initialize it to NULL so that remote_open knows that we don't have a file open when the program starts. */ @@ -2585,6 +2647,25 @@ int extended_p; }; +/* Send interrupt_sequence to remote target. */ +static void +send_interrupt_sequence () +{ + if (interrupt_sequence_mode == interrupt_sequence_control_c) + serial_write (remote_desc, "\x03", 1); + else if (interrupt_sequence_mode == interrupt_sequence_break) + serial_send_break (remote_desc); + else if (interrupt_sequence_mode == interrupt_sequence_sysrq_g) + { + serial_send_break (remote_desc); + serial_write (remote_desc, "g", 1); + } + else + internal_error (__FILE__, __LINE__, + _("Invalid value for interrupt_sequence_mode: %s."), + interrupt_sequence_mode); +} + static void remote_start_remote (struct ui_out *uiout, void *opaque) { @@ -2598,6 +2679,9 @@ /* Ack any packet which the remote side has already sent. */ serial_write (remote_desc, "+", 1); + if (interrupt_on_connect) + send_interrupt_sequence (); + /* The first packet we send to the target is the optional "supported packets" request. If the target can answer this, it will tell us which later probes to skip. */ @@ -4021,12 +4105,8 @@ if (rs->cached_wait_status) return; - /* Send a break or a ^C, depending on user preference. */ - - if (remote_break) - serial_send_break (remote_desc); - else - serial_write (remote_desc, "\003", 1); + /* Send interrupt_sequence to remote target. */ + send_interrupt_sequence (); } /* This is the generic stop called via the target vector. When a target @@ -8993,6 +9073,8 @@ _initialize_remote (void) { struct remote_state *rs; + struct cmd_list_element *cmd; + static char *cmd_name; /* architecture specific data */ remote_gdbarch_data_handle = @@ -9060,8 +9142,31 @@ Set whether to send break if interrupted."), _("\ Show whether to send break if interrupted."), _("\ If set, a break, instead of a cntrl-c, is sent to the remote target."), - NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is %s. */ + set_remotebreak, show_remotebreak, &setlist, &showlist); + cmd_name = "remotebreak"; + cmd = lookup_cmd (&cmd_name, setlist, "", -1, 1); + deprecate_cmd (cmd, "set remote interrupt-sequence"); + cmd_name = "remotebreak"; /* needed because lookup_cmd updates the pointer */ + cmd = lookup_cmd (&cmd_name, showlist, "", -1, 1); + deprecate_cmd (cmd, "show remote interrupt-sequence"); + + add_setshow_enum_cmd ("interrupt-sequence", class_support, + interrupt_sequence_modes, &interrupt_sequence_mode, _("\ +Set interrupt sequence to remote target."), _("\ +Show interrupt sequence to remote target."), _("\ +Valid value is \"Ctrl-C\", \"BREAK\" or \"BREAK-g\". The default is \"Ctrl-C\"."), + NULL, show_interrupt_sequence, + &remote_set_cmdlist, + &remote_show_cmdlist); + + add_setshow_boolean_cmd ("interrupt-on-connect", class_support, + &interrupt_on_connect, _("\ +Set whether interrupt-sequence is sent to remote target when gdb connects to."), _(" \ +Show whether interrupt-sequence is sent to remote target when gdb connects to."), _(" \ +If set, interrupt sequence is sent to remote target."), + NULL, NULL, + &remote_set_cmdlist, &remote_show_cmdlist); /* Install commands for configuring memory read/write packets. */ Index: gdb/doc/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/doc/ChangeLog,v retrieving revision 1.958 diff -u -r1.958 ChangeLog --- gdb/doc/ChangeLog 26 Sep 2009 16:47:13 -0000 1.958 +++ gdb/doc/ChangeLog 1 Oct 2009 22:41:11 -0000 @@ -1,3 +1,8 @@ +2009-10-01 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * gdb.texinfo (Remote Configuration): Add "set/show remote + interrupt-sequence" and "set/show remote interrupt-on-connect" command. + 2009-09-26 Pierre Muller <muller@ics.u-strasbg.fr> * gdb.texinfo (Cygwin Native): Mention support for Ctrl-BREAK. Index: gdb/doc/gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.629 diff -u -r1.629 gdb.texinfo --- gdb/doc/gdb.texinfo 26 Sep 2009 16:47:13 -0000 1.629 +++ gdb/doc/gdb.texinfo 1 Oct 2009 22:41:24 -0000 @@ -15011,6 +15011,34 @@ target system. If it is not set, the target will use a default filename (e.g.@: the last program run). +@item set remote interrupt-sequence +@cindex interrupt remote programs +@cindex select Ctrl-C, BREAK or BREAK-g +Allow the user to select one of @samp{Ctrl-C}, a @code{BREAK} or +@samp{BREAK-g} as the +sequence to the remote target in order to interrupt the execution. +@samp{Ctrl-C} is a default. Some system prefers @code{BREAK} which +is high level of serial line for some certain time. +Linux kernel prefers @samp{BREAK-g}, a.k.a Magic SysRq g. +It is @code{BREAK} signal followed by character @code{g}. + +@item show interrupt-sequence +Show which of @samp{Ctrl-C}, @code{BREAK} or @code{BREAK-g} +is sent by @value{GDBN} to interrupt the remote program. +@code{BREAK-g} is BREAK signal followed by @code{g} and +also known as Magic SysRq g. + +@item set remote interrupt-on-connect +@cindex send interrupt-sequence on start +Specify whether interrupt-sequence is sent to remote target when +@value{GDBN} connects to it. This is mostly needed when you debug +Linux kernel. Linux kernel expects @code{BREAK} followed by @code{g} +which is known as Magic SysRq g in order to connect @value{GDBN}. + +@item show interrupt-on-connect +Show whether interrupt-sequence is sent +to remote target when @value{GDBN} connects to it. + @kindex set tcp @kindex show tcp @item set tcp auto-retry on @@ -29817,9 +29845,9 @@ @cindex interrupts (remote protocol) When a program on the remote target is running, @value{GDBN} may -attempt to interrupt it by sending a @samp{Ctrl-C} or a @code{BREAK}, -control of which is specified via @value{GDBN}'s @samp{remotebreak} -setting (@pxref{set remotebreak}). +attempt to interrupt it by sending a @samp{Ctrl-C}, @code{BREAK} or +a @code{BREAK} followed by @code{g}, +control of which is specified via @value{GDBN}'s @samp{interrupt-sequence}. The precise meaning of @code{BREAK} is defined by the transport mechanism and may, in fact, be undefined. @value{GDBN} does not @@ -29836,6 +29864,10 @@ (@pxref{X packet}), used for binary downloads, may include an unescaped @code{0x03} as part of its packet. +@code{BREAK} followed by @code{g} is also known as Magic SysRq g. +When Linux kernel receives this sequence from serial port, +it stops execution and connects to gdb. + Stubs are not required to recognize these interrupt mechanisms and the precise meaning associated with receipt of the interrupt is implementation defined. If the target supports debugging of multiple ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-10-01 23:04 ` Caz Yokoyama @ 2009-10-01 23:32 ` Joel Brobecker 2009-10-02 1:18 ` Caz Yokoyama ` (2 more replies) 0 siblings, 3 replies; 55+ messages in thread From: Joel Brobecker @ 2009-10-01 23:32 UTC (permalink / raw) To: Caz Yokoyama Cc: 'Eli Zaretskii', gdb-patches, 'Daniel Jacobowitz', 'Pedro Alves' > +2009-10-01 Kazuyoshi Caz Yokoyama <caz@caztech.com> > + > + * remote.c (interrupt_sequence_control_c) > + (interrupt_sequence_break, interrupt_sequence_sysrq_g) > + (interrupt_sequence_modes): New constants. > + (interrupt_sequence_mode, interrupt_on_connect): New variable. > + (show_interrupt_sequence): New function. > + (set_remotebreak, show_remotebreak): New function. > + (send_interrupt_sequence): New function. > + (remote_start_remote): Call send_interrupt_sequence if > + interrupt_on_connect is true. > + (remote_stop_as): Call send_interrupt_sequence. > + (_initialize_remote): Add interrupt-sequence and interrupt-on-connect, > + modify remotebreak to call set_remotebreak and show_remotebreak. Very nice and clean! Just a few nits as shown below, but they are minor and can be mechanically fixed. So the code part of the patch is pre-approved, after you address the last comments below (it means that you have permission to commit the patch, but please make sure to send a copy of the patch that you end up checking in). I think Eli already approved the latest version of the documentation part, but he'll probably want to have a last quick look. And of course, now that I talk about checking in your patch, I am now only realizing that you do not seem to have an assignment filed with the FSF. This is a requirement for us to accept your patch. Perhaps you have an assignment on file through your employer? I couldn't find you in their records using either your name or email domain. Let me know if you'd like me to get you started with the paperwork. It takes a few weeks, so start ASAP if needed. > +const char interrupt_sequence_sysrq_g[] = "BREAK-g"; You forgot to rename this constant to interrupt_sequence_break_g, to match the actual litteral value. > +/* This boolean variable specifies whether interrupt_sequence is sent > + to remote target when gdb connect to it. > + This is mostly needed when you debug Linux kernel. > + Linux kernel expects BREAK g which is Magic SysRq g for connecting gdb. */ I've noticed a few English mistakes. I started pointed them out, but in the end, it's probably simpler if I give you the correct version: /* This boolean variable specifies whether interrupt_sequence is sent to the remote target when gdb connects to it. This is mostly needed when you debug theLinux kernel: The Linux kernel expects BREAK g which is Magic SysRq g for connecting gdb. */ > + struct cmd_list_element *cmd; > + static char *cmd_name; This should not be static. That way, it gets allocated on the stack and then released after the function returns. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-10-01 23:32 ` Joel Brobecker @ 2009-10-02 1:18 ` Caz Yokoyama 2009-10-02 22:14 ` Joel Brobecker 2009-10-02 8:55 ` Eli Zaretskii 2009-10-28 15:05 ` Joel Brobecker 2 siblings, 1 reply; 55+ messages in thread From: Caz Yokoyama @ 2009-10-02 1:18 UTC (permalink / raw) To: 'Joel Brobecker' Cc: 'Eli Zaretskii', gdb-patches, 'Daniel Jacobowitz', 'Pedro Alves' [-- Attachment #1: Type: text/plain, Size: 3240 bytes --] Hello Joel, Please start the paperwork for filing an assignment with the FSF. I don't have a employer. This is a volunteer work while on job hunting. Please find the updated patch in attachment. - interrupt_sequence_sysrq_g -> interrupt_sequence_break_g - Linux kernel -> The Linux kernel - Tested. No regression. -caz -----Original Message----- From: Joel Brobecker [mailto:brobecker@adacore.com] Sent: Thursday, October 01, 2009 4:33 PM To: Caz Yokoyama Cc: 'Eli Zaretskii'; gdb-patches@sourceware.org; 'Daniel Jacobowitz'; 'Pedro Alves' Subject: Re: symbolic debug of loadable modules with kgdb light > +2009-10-01 Kazuyoshi Caz Yokoyama <caz@caztech.com> > + > + * remote.c (interrupt_sequence_control_c) > + (interrupt_sequence_break, interrupt_sequence_sysrq_g) > + (interrupt_sequence_modes): New constants. > + (interrupt_sequence_mode, interrupt_on_connect): New variable. > + (show_interrupt_sequence): New function. > + (set_remotebreak, show_remotebreak): New function. > + (send_interrupt_sequence): New function. > + (remote_start_remote): Call send_interrupt_sequence if > + interrupt_on_connect is true. > + (remote_stop_as): Call send_interrupt_sequence. > + (_initialize_remote): Add interrupt-sequence and interrupt-on-connect, > + modify remotebreak to call set_remotebreak and show_remotebreak. Very nice and clean! Just a few nits as shown below, but they are minor and can be mechanically fixed. So the code part of the patch is pre-approved, after you address the last comments below (it means that you have permission to commit the patch, but please make sure to send a copy of the patch that you end up checking in). I think Eli already approved the latest version of the documentation part, but he'll probably want to have a last quick look. And of course, now that I talk about checking in your patch, I am now only realizing that you do not seem to have an assignment filed with the FSF. This is a requirement for us to accept your patch. Perhaps you have an assignment on file through your employer? I couldn't find you in their records using either your name or email domain. Let me know if you'd like me to get you started with the paperwork. It takes a few weeks, so start ASAP if needed. > +const char interrupt_sequence_sysrq_g[] = "BREAK-g"; You forgot to rename this constant to interrupt_sequence_break_g, to match the actual litteral value. > +/* This boolean variable specifies whether interrupt_sequence is sent > + to remote target when gdb connect to it. > + This is mostly needed when you debug Linux kernel. > + Linux kernel expects BREAK g which is Magic SysRq g for connecting gdb. */ I've noticed a few English mistakes. I started pointed them out, but in the end, it's probably simpler if I give you the correct version: /* This boolean variable specifies whether interrupt_sequence is sent to the remote target when gdb connects to it. This is mostly needed when you debug theLinux kernel: The Linux kernel expects BREAK g which is Magic SysRq g for connecting gdb. */ > + struct cmd_list_element *cmd; > + static char *cmd_name; This should not be static. That way, it gets allocated on the stack and then released after the function returns. -- Joel [-- Attachment #2: remotebreak.patch --] [-- Type: application/octet-stream, Size: 12928 bytes --] Index: gdb/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.10924 diff -u -r1.10924 ChangeLog --- gdb/ChangeLog 1 Oct 2009 20:09:20 -0000 1.10924 +++ gdb/ChangeLog 2 Oct 2009 00:27:20 -0000 @@ -1,3 +1,18 @@ +2009-10-01 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * remote.c (interrupt_sequence_control_c) + (interrupt_sequence_break, interrupt_sequence_break_g) + (interrupt_sequence_modes): New constants. + (interrupt_sequence_mode, interrupt_on_connect): New variable. + (show_interrupt_sequence): New function. + (set_remotebreak, show_remotebreak): New function. + (send_interrupt_sequence): New function. + (remote_start_remote): Call send_interrupt_sequence if + interrupt_on_connect is true. + (remote_stop_as): Call send_interrupt_sequence. + (_initialize_remote): Add interrupt-sequence and interrupt-on-connect, + modify remotebreak to call set_remotebreak and show_remotebreak. + 2009-10-01 Phil Muldoon <pmuldoon@redhat.com> * infcall.c (call_function_by_hand): Add a new cleanup branch for Index: gdb/NEWS =================================================================== RCS file: /cvs/src/src/gdb/NEWS,v retrieving revision 1.331 diff -u -r1.331 NEWS --- gdb/NEWS 15 Sep 2009 03:30:04 -0000 1.331 +++ gdb/NEWS 2 Oct 2009 00:27:22 -0000 @@ -234,6 +234,24 @@ * New commands (for set/show, see "New options" below) +set remote interrupt-sequence [Ctrl-C | BREAK | BREAK-g] +show remote interrupt-sequence + Allow the user to select one of ^C, a BREAK signal or BREAK-g + as the sequence to the remote target in order to interrupt the execution. + Ctrl-C is a default. Some system prefers BREAK which is high level of + serial line for some certain time. Linux kernel prefers BREAK-g, a.k.a + Magic SysRq g. It is BREAK signal and character 'g'. + +set remote interrupt-on-connect [on | off] +show remote interrupt-on-connect + When interrupt-on-connect is ON, gdb sends interrupt-sequence to + remote target when gdb connects to it. This is needed when you debug + Linux kernel. + +set remotebreak [on | off] +show remotebreak +Deprecated. Use "set/show remote interrupt-sequence" instead. + catch syscall [NAME(S) | NUMBER(S)] Catch system calls. Arguments, which should be names of system calls or their numbers, mean catch only those syscalls. Without Index: gdb/remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.372 diff -u -r1.372 remote.c --- gdb/remote.c 10 Sep 2009 22:47:56 -0000 1.372 +++ gdb/remote.c 2 Oct 2009 00:27:25 -0000 @@ -546,14 +546,76 @@ this can go away. */ static int wait_forever_enabled_p = 1; +/* Allow the user to specify what sequence to send to the remote + when he requests a program interruption: Although ^C is usually + what remote systems expect (this is the default, here), it is + sometimes preferable to send a break. On other systems such + as the Linux kernel, a break followed by g, which is Magic SysRq g + is required in order to interrupt the execution. */ +const char interrupt_sequence_control_c[] = "Ctrl-C"; +const char interrupt_sequence_break[] = "BREAK"; +const char interrupt_sequence_break_g[] = "BREAK-g"; +static const char *interrupt_sequence_modes[] = + { + interrupt_sequence_control_c, + interrupt_sequence_break, + interrupt_sequence_break_g, + NULL + }; +static const char *interrupt_sequence_mode = interrupt_sequence_control_c; -/* This variable chooses whether to send a ^C or a break when the user - requests program interruption. Although ^C is usually what remote - systems expect, and that is the default here, sometimes a break is - preferable instead. */ +static void +show_interrupt_sequence (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value) +{ + if (interrupt_sequence_mode == interrupt_sequence_control_c) + fprintf_filtered (file, + _("Send the ASCII ETX character (Ctrl-c) " + "to the remote target to interrupt the " + "execution of the program.\n")); + else if (interrupt_sequence_mode == interrupt_sequence_break) + fprintf_filtered (file, + _("send a break signal to the remote target " + "to interrupt the execution of the program.\n")); + else if (interrupt_sequence_mode == interrupt_sequence_break_g) + fprintf_filtered (file, + _("Send a break signal and 'g' a.k.a. Magic SysRq g to " + "the remote target to interrupt the execution " + "of Linux kernel.\n")); + else + internal_error (__FILE__, __LINE__, + _("Invalid value for interrupt_sequence_mode: %s."), + interrupt_sequence_mode); +} +/* This boolean variable specifies whether interrupt_sequence is sent + to the remote target when gdb connects to it. + This is mostly needed when you debug the Linux kernel: The Linux kernel + expects BREAK g which is Magic SysRq g for connecting gdb. */ +static int interrupt_on_connect = 0; + +/* This variable is used to implement the "set/show remotebreak" commands. + Since these commands are now deprecated in favor of "set/show remote + interrupt-sequence", it no longer has any effect on the code. */ static int remote_break; +static void +set_remotebreak (char *args, int from_tty, struct cmd_list_element *c) +{ + if (remote_break) + interrupt_sequence_mode = interrupt_sequence_break; + else + interrupt_sequence_mode = interrupt_sequence_control_c; +} + +static void +show_remotebreak (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value) +{ +} + /* Descriptor for I/O to remote machine. Initialize it to NULL so that remote_open knows that we don't have a file open when the program starts. */ @@ -2585,6 +2647,25 @@ int extended_p; }; +/* Send interrupt_sequence to remote target. */ +static void +send_interrupt_sequence () +{ + if (interrupt_sequence_mode == interrupt_sequence_control_c) + serial_write (remote_desc, "\x03", 1); + else if (interrupt_sequence_mode == interrupt_sequence_break) + serial_send_break (remote_desc); + else if (interrupt_sequence_mode == interrupt_sequence_break_g) + { + serial_send_break (remote_desc); + serial_write (remote_desc, "g", 1); + } + else + internal_error (__FILE__, __LINE__, + _("Invalid value for interrupt_sequence_mode: %s."), + interrupt_sequence_mode); +} + static void remote_start_remote (struct ui_out *uiout, void *opaque) { @@ -2598,6 +2679,9 @@ /* Ack any packet which the remote side has already sent. */ serial_write (remote_desc, "+", 1); + if (interrupt_on_connect) + send_interrupt_sequence (); + /* The first packet we send to the target is the optional "supported packets" request. If the target can answer this, it will tell us which later probes to skip. */ @@ -4021,12 +4105,8 @@ if (rs->cached_wait_status) return; - /* Send a break or a ^C, depending on user preference. */ - - if (remote_break) - serial_send_break (remote_desc); - else - serial_write (remote_desc, "\003", 1); + /* Send interrupt_sequence to remote target. */ + send_interrupt_sequence (); } /* This is the generic stop called via the target vector. When a target @@ -8993,6 +9073,8 @@ _initialize_remote (void) { struct remote_state *rs; + struct cmd_list_element *cmd; + char *cmd_name; /* architecture specific data */ remote_gdbarch_data_handle = @@ -9060,8 +9142,31 @@ Set whether to send break if interrupted."), _("\ Show whether to send break if interrupted."), _("\ If set, a break, instead of a cntrl-c, is sent to the remote target."), - NULL, NULL, /* FIXME: i18n: Whether to send break if interrupted is %s. */ + set_remotebreak, show_remotebreak, &setlist, &showlist); + cmd_name = "remotebreak"; + cmd = lookup_cmd (&cmd_name, setlist, "", -1, 1); + deprecate_cmd (cmd, "set remote interrupt-sequence"); + cmd_name = "remotebreak"; /* needed because lookup_cmd updates the pointer */ + cmd = lookup_cmd (&cmd_name, showlist, "", -1, 1); + deprecate_cmd (cmd, "show remote interrupt-sequence"); + + add_setshow_enum_cmd ("interrupt-sequence", class_support, + interrupt_sequence_modes, &interrupt_sequence_mode, _("\ +Set interrupt sequence to remote target."), _("\ +Show interrupt sequence to remote target."), _("\ +Valid value is \"Ctrl-C\", \"BREAK\" or \"BREAK-g\". The default is \"Ctrl-C\"."), + NULL, show_interrupt_sequence, + &remote_set_cmdlist, + &remote_show_cmdlist); + + add_setshow_boolean_cmd ("interrupt-on-connect", class_support, + &interrupt_on_connect, _("\ +Set whether interrupt-sequence is sent to remote target when gdb connects to."), _(" \ +Show whether interrupt-sequence is sent to remote target when gdb connects to."), _(" \ +If set, interrupt sequence is sent to remote target."), + NULL, NULL, + &remote_set_cmdlist, &remote_show_cmdlist); /* Install commands for configuring memory read/write packets. */ Index: gdb/doc/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/doc/ChangeLog,v retrieving revision 1.958 diff -u -r1.958 ChangeLog --- gdb/doc/ChangeLog 26 Sep 2009 16:47:13 -0000 1.958 +++ gdb/doc/ChangeLog 2 Oct 2009 00:27:28 -0000 @@ -1,3 +1,8 @@ +2009-10-01 Kazuyoshi Caz Yokoyama <caz@caztech.com> + + * gdb.texinfo (Remote Configuration): Add "set/show remote + interrupt-sequence" and "set/show remote interrupt-on-connect" command. + 2009-09-26 Pierre Muller <muller@ics.u-strasbg.fr> * gdb.texinfo (Cygwin Native): Mention support for Ctrl-BREAK. Index: gdb/doc/gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.629 diff -u -r1.629 gdb.texinfo --- gdb/doc/gdb.texinfo 26 Sep 2009 16:47:13 -0000 1.629 +++ gdb/doc/gdb.texinfo 2 Oct 2009 00:27:40 -0000 @@ -15011,6 +15011,34 @@ target system. If it is not set, the target will use a default filename (e.g.@: the last program run). +@item set remote interrupt-sequence +@cindex interrupt remote programs +@cindex select Ctrl-C, BREAK or BREAK-g +Allow the user to select one of @samp{Ctrl-C}, a @code{BREAK} or +@samp{BREAK-g} as the +sequence to the remote target in order to interrupt the execution. +@samp{Ctrl-C} is a default. Some system prefers @code{BREAK} which +is high level of serial line for some certain time. +Linux kernel prefers @samp{BREAK-g}, a.k.a Magic SysRq g. +It is @code{BREAK} signal followed by character @code{g}. + +@item show interrupt-sequence +Show which of @samp{Ctrl-C}, @code{BREAK} or @code{BREAK-g} +is sent by @value{GDBN} to interrupt the remote program. +@code{BREAK-g} is BREAK signal followed by @code{g} and +also known as Magic SysRq g. + +@item set remote interrupt-on-connect +@cindex send interrupt-sequence on start +Specify whether interrupt-sequence is sent to remote target when +@value{GDBN} connects to it. This is mostly needed when you debug +Linux kernel. Linux kernel expects @code{BREAK} followed by @code{g} +which is known as Magic SysRq g in order to connect @value{GDBN}. + +@item show interrupt-on-connect +Show whether interrupt-sequence is sent +to remote target when @value{GDBN} connects to it. + @kindex set tcp @kindex show tcp @item set tcp auto-retry on @@ -29817,9 +29845,9 @@ @cindex interrupts (remote protocol) When a program on the remote target is running, @value{GDBN} may -attempt to interrupt it by sending a @samp{Ctrl-C} or a @code{BREAK}, -control of which is specified via @value{GDBN}'s @samp{remotebreak} -setting (@pxref{set remotebreak}). +attempt to interrupt it by sending a @samp{Ctrl-C}, @code{BREAK} or +a @code{BREAK} followed by @code{g}, +control of which is specified via @value{GDBN}'s @samp{interrupt-sequence}. The precise meaning of @code{BREAK} is defined by the transport mechanism and may, in fact, be undefined. @value{GDBN} does not @@ -29836,6 +29864,10 @@ (@pxref{X packet}), used for binary downloads, may include an unescaped @code{0x03} as part of its packet. +@code{BREAK} followed by @code{g} is also known as Magic SysRq g. +When Linux kernel receives this sequence from serial port, +it stops execution and connects to gdb. + Stubs are not required to recognize these interrupt mechanisms and the precise meaning associated with receipt of the interrupt is implementation defined. If the target supports debugging of multiple ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-10-02 1:18 ` Caz Yokoyama @ 2009-10-02 22:14 ` Joel Brobecker 0 siblings, 0 replies; 55+ messages in thread From: Joel Brobecker @ 2009-10-02 22:14 UTC (permalink / raw) To: Caz Yokoyama; +Cc: gdb-patches Caz, > > +2009-10-01 Kazuyoshi Caz Yokoyama <caz@caztech.com> > > + > > + * remote.c (interrupt_sequence_control_c) > > + (interrupt_sequence_break, interrupt_sequence_sysrq_g) > > + (interrupt_sequence_modes): New constants. > > + (interrupt_sequence_mode, interrupt_on_connect): New variable. > > + (show_interrupt_sequence): New function. > > + (set_remotebreak, show_remotebreak): New function. > > + (send_interrupt_sequence): New function. > > + (remote_start_remote): Call send_interrupt_sequence if > > + interrupt_on_connect is true. > > + (remote_stop_as): Call send_interrupt_sequence. > > + (_initialize_remote): Add interrupt-sequence and interrupt-on-connect, > > + modify remotebreak to call set_remotebreak and show_remotebreak. Congratulations. This patch is approved. I will hang on to it in my local git repository until the paperwork with the FSF is complete. Let me know when your assignment is on file, and I will commit this change in for you. If you think you might contribute other changes in the future, you are now also eligible for receiving write-after-approval access to the GDB repository. Let me know if you'd be interested in that. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-10-01 23:32 ` Joel Brobecker 2009-10-02 1:18 ` Caz Yokoyama @ 2009-10-02 8:55 ` Eli Zaretskii 2009-10-28 15:05 ` Joel Brobecker 2 siblings, 0 replies; 55+ messages in thread From: Eli Zaretskii @ 2009-10-02 8:55 UTC (permalink / raw) To: Joel Brobecker; +Cc: cazyokoyama, gdb-patches, drow, pedro > Date: Thu, 1 Oct 2009 16:32:45 -0700 > From: Joel Brobecker <brobecker@adacore.com> > Cc: 'Eli Zaretskii' <eliz@gnu.org>, gdb-patches@sourceware.org, > 'Daniel Jacobowitz' <drow@false.org>, > 'Pedro Alves' <pedro@codesourcery.com> > > I think Eli already approved the latest version of the documentation > part, but he'll probably want to have a last quick look. I had, and it's fine with me. ^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: symbolic debug of loadable modules with kgdb light 2009-10-01 23:32 ` Joel Brobecker 2009-10-02 1:18 ` Caz Yokoyama 2009-10-02 8:55 ` Eli Zaretskii @ 2009-10-28 15:05 ` Joel Brobecker 2 siblings, 0 replies; 55+ messages in thread From: Joel Brobecker @ 2009-10-28 15:05 UTC (permalink / raw) To: Caz Yokoyama Cc: 'Eli Zaretskii', gdb-patches, 'Daniel Jacobowitz', 'Pedro Alves' > > +2009-10-01 Kazuyoshi Caz Yokoyama <caz@caztech.com> > > + > > + * remote.c (interrupt_sequence_control_c) [etc] Just to let everyone know that Caz's assigment request came through and that I just checked in his patch. So kernel developers should now be able to do debugger with stock GDB. -- Joel ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-10-01 16:33 ` Joel Brobecker 2009-10-01 17:18 ` Caz Yokoyama @ 2009-10-01 20:13 ` Caz Yokoyama 1 sibling, 0 replies; 55+ messages in thread From: Caz Yokoyama @ 2009-10-01 20:13 UTC (permalink / raw) To: 'Joel Brobecker'; +Cc: 'Eli Zaretskii', pedro, gdb-patches [-- Attachment #1: Type: text/plain, Size: 4532 bytes --] Here is the test result. There is no difference between with and without the modification in gdb/remote.c One thing I aware is that make returns "Error 1" and "Error 2". This is the expected outcome, isn't this? .... make[2]: *** [check-single] Error 1 make[2]: Leaving directory `/home/caz/lightfleet/kgdb/gdb-KgdbLight/gdb/testsuite' make[1]: *** [check] Error 2 make[1]: Leaving directory `/home/caz/lightfleet/kgdb/gdb-KgdbLight/gdb' make: *** [check-gdb] Error 2 -caz -----Original Message----- From: Joel Brobecker [mailto:brobecker@adacore.com] Sent: Thursday, October 01, 2009 9:34 AM To: Caz Yokoyama Cc: 'Eli Zaretskii'; pedro@codesourcery.com; gdb-patches@sourceware.org Subject: Re: symbolic debug of loadable modules with kgdb light Regarding testing, since you are modifying remote.c, you'll need to run the testsuite using gdbserver. The testsuite needs to be run before and after the patch, in order to compare the results. Normally, there should be no regression. Directions on how to do that are explained at http://sourceware.org/gdb/wiki/TestingGDB (see Testing gdbserver in a native configuration). Please indicate when you submit patches that you ran the testsuite, and that you found no regression. > + * remote.c (interrupt_sequence_control_c) > + (interrupt_sequence_break, interrupt_sequence_sysrq_g) > + (interrupt_sequence_modes): New constants. > + (interrupt_sequence_mode, interrupt_on_connect): New variable. > + (show_interrupt_sequence): New function. > + (set_remotebreak, show_remotebreak): New function. > + (send_interrupt_sequence: New function. > + (remote_start_remote): Call send_interrupt_sequence if interrupt_on_connect. > + (remote_stop_as): Call send_interrupt_sequence. > + (_initialize_remote): Add interrupt-sequence and interrupt-on-connect, > + modify remotebreak to call set_remotebreak and show_remotebreak. Just a few formatting nits left: The ChangeLog entries needs to be indented using tabs. You're mixing spaces and tabs. You're missing a closing parenthesis after send_interrupt_sequence and the line just after is too long (maximum is 79 or 80 characters). > +set remote interrupt-sequence [Ctrl-C | BREAK | SysRq-g] You changed the user interface again, this is really fustrating. Personally, I don't care anymore what names we use for these options and I can see why you prefer them, but since we're changing them again, please ask Daniel Jacobowitz and Pedro Alves, who are the major maintainers and regular users of this code, whether they are OK with your choices. In the future, I would really appreciate if we agreed on the user interface first, without considering code while doing that, and then stay with what we've agreed on. Otherwise, things keep changing every time I look at a patch, and we both waste valuable time. That being said, we're getting there. > +/* This boolean variable specifies whether interrupt_sequence is sent > + to remote target when gdb starts. This is mostly needed when you debug > + Linux kernel. Linux kernel expects BREAK g which is Magic SysRq for > + connecting gdb. */ Formatting: 2 spaces after each of the 2 periods. > @@ -8993,6 +9073,10 @@ > _initialize_remote (void) > { > struct remote_state *rs; > + struct cmd_list_element *cmd; > + /* I can't use the same string for lookup_cmd(). Cause segment fault. */ > + static char *_set_remotebreak_ = "remotebreak"; > + static char *_show_remotebreak_ = "remotebreak"; Try this instead: char *cmd_name; cmd_name = "remotebreak"; cmd = lookup_cmd (&cmd_name, setlist, "", -1, 1); deprecate_cmd (cmd, "set remote interrupt-sequence"); cmd_name = "remotebreak"; cmd = lookup_cmd (&cmd_name, showlist, "", -1, 1); deprecate_cmd (cmd, "show remote interrupt-sequence"); The reason why you're getting the SEGV is because lookup_cmd updates the pointer your passing to point after the command name it has matched. > - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ > -Set whether to send break if interrupted."), _("\ > -Show whether to send break if interrupted."), _("\ > + add_setshow_boolean_cmd ("remotebreak", class_obscure, &remote_break, _("\ > +Deprecated. Use \"set remote interrupt-sequence [control-c|break]\" instead."), _("\ > +Deprecated. Use \"show remote interrupt-sequence\" instead."), _("\ Please undo this part of the change. You do NOT need to update the command documentation for "set/show remotebreak", since this is already taken care -- Joel [-- Attachment #2: interrupt-sequence.diff --] [-- Type: application/octet-stream, Size: 104 bytes --] 5c5 < Test Run By caz on Thu Oct 1 12:54:36 2009 --- > Test Run By caz on Thu Oct 1 12:35:41 2009 [-- Attachment #3: interrupt-sequence.log --] [-- Type: application/octet-stream, Size: 25202 bytes --] make[1]: Entering directory `/home/caz/lightfleet/kgdb/gdb-KgdbLight/gdb' make[2]: Entering directory `/home/caz/lightfleet/kgdb/gdb-KgdbLight/gdb/testsuite' Nothing to be done for all... rootme=`pwd`; export rootme; srcdir=. ; export srcdir ; EXPECT=`if [ -f ${rootme}/../../expect/expect ] ; then echo ${rootme}/../../expect/expect ; else echo expect ; fi` ; export EXPECT ; EXEEXT= ; export EXEEXT ; LD_LIBRARY_PATH=$rootme/../../expect:$rootme/../../libstdc++:$rootme/../../tk/unix:$rootme/../../tcl/unix:$rootme/../../bfd:$rootme/../../opcodes:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; if [ -f ${rootme}/../../expect/expect ] ; then TCL_LIBRARY=${srcdir}/../../tcl/library ; export TCL_LIBRARY ; fi ; runtest --target_board native-gdbserver Test Run By caz on Thu Oct 1 12:35:41 2009 Native configuration is x86_64-unknown-linux-gnu === gdb tests === Schedule of variations: native-gdbserver Running target native-gdbserver Using /home/caz/lightfleet/kgdb/testing/boards/native-gdbserver.exp as board description file for target. Using ./config/gdbserver.exp as tool-and-target-specific interface file. Running ./gdb.ada/array_bounds.exp ... Running ./gdb.ada/array_return.exp ... Running ./gdb.ada/array_subscript_addr.exp ... Running ./gdb.ada/arrayidx.exp ... Running ./gdb.ada/arrayparam.exp ... Running ./gdb.ada/arrayptr.exp ... Running ./gdb.ada/assign_1.exp ... Running ./gdb.ada/atomic_enum.exp ... Running ./gdb.ada/boolean_expr.exp ... Running ./gdb.ada/catch_ex.exp ... Running ./gdb.ada/char_param.exp ... Running ./gdb.ada/complete.exp ... Running ./gdb.ada/exec_changed.exp ... Running ./gdb.ada/exprs.exp ... Running ./gdb.ada/fixed_cmp.exp ... Running ./gdb.ada/fixed_points.exp ... Running ./gdb.ada/formatted_ref.exp ... Running ./gdb.ada/frame_args.exp ... Running ./gdb.ada/fun_addr.exp ... Running ./gdb.ada/fun_in_declare.exp ... Running ./gdb.ada/funcall_param.exp ... Running ./gdb.ada/homonym.exp ... Running ./gdb.ada/int_deref.exp ... Running ./gdb.ada/interface.exp ... Running ./gdb.ada/lang_switch.exp ... Running ./gdb.ada/mod_from_name.exp ... Running ./gdb.ada/nested.exp ... Running ./gdb.ada/null_array.exp ... Running ./gdb.ada/null_record.exp ... Running ./gdb.ada/packed_array.exp ... Running ./gdb.ada/packed_tagged.exp ... Running ./gdb.ada/print_chars.exp ... Running ./gdb.ada/print_pc.exp ... Running ./gdb.ada/ptype_arith_binop.exp ... Running ./gdb.ada/ptype_field.exp ... Running ./gdb.ada/ref_param.exp ... Running ./gdb.ada/ref_tick_size.exp ... Running ./gdb.ada/start.exp ... Running ./gdb.ada/str_ref_cmp.exp ... Running ./gdb.ada/sym_print_name.exp ... Running ./gdb.ada/taft_type.exp ... Running ./gdb.ada/tagged.exp ... Running ./gdb.ada/tasks.exp ... Running ./gdb.ada/tick_last_segv.exp ... Running ./gdb.ada/type_coercion.exp ... Running ./gdb.ada/uninitialized_vars.exp ... Running ./gdb.ada/variant_record_packed_array.exp ... Running ./gdb.ada/watch_arg.exp ... Running ./gdb.arch/alpha-step.exp ... Running ./gdb.arch/altivec-abi.exp ... Running ./gdb.arch/altivec-regs.exp ... Running ./gdb.arch/amd64-disp-step.exp ... Running ./gdb.arch/amd64-i386-address.exp ... Running ./gdb.arch/e500-abi.exp ... Running ./gdb.arch/e500-prologue.exp ... Running ./gdb.arch/e500-regs.exp ... Running ./gdb.arch/gdb1291.exp ... Running ./gdb.arch/gdb1431.exp ... Running ./gdb.arch/gdb1558.exp ... Running ./gdb.arch/i386-bp_permanent.exp ... Running ./gdb.arch/i386-disp-step.exp ... Running ./gdb.arch/i386-gnu-cfi.exp ... Running ./gdb.arch/i386-permbkpt.exp ... Running ./gdb.arch/i386-prologue.exp ... Running ./gdb.arch/i386-signal.exp ... Running ./gdb.arch/i386-size-overlap.exp ... Running ./gdb.arch/i386-size.exp ... Running ./gdb.arch/i386-sse.exp ... Running ./gdb.arch/i386-unwind.exp ... Running ./gdb.arch/ia64-breakpoint-shadow.exp ... Running ./gdb.arch/iwmmxt-regs.exp ... Running ./gdb.arch/pa-nullify.exp ... Running ./gdb.arch/powerpc-aix-prologue.exp ... Running ./gdb.arch/powerpc-d128-regs.exp ... Running ./gdb.arch/powerpc-prologue.exp ... Running ./gdb.arch/ppc-dfp.exp ... Running ./gdb.arch/ppc-fp.exp ... Running ./gdb.arch/ppc64-atomic-inst.exp ... Running ./gdb.arch/spu-info.exp ... Running ./gdb.arch/thumb-prologue.exp ... Running ./gdb.arch/vsx-regs.exp ... Running ./gdb.asm/asm-source.exp ... Running ./gdb.base/a2-run.exp ... Running ./gdb.base/advance.exp ... Running ./gdb.base/all-bin.exp ... Running ./gdb.base/annota1.exp ... Running ./gdb.base/annota3.exp ... Running ./gdb.base/args.exp ... Running ./gdb.base/arithmet.exp ... Running ./gdb.base/arrayidx.exp ... Running ./gdb.base/assign.exp ... Running ./gdb.base/async.exp ... Running ./gdb.base/attach.exp ... Running ./gdb.base/auxv.exp ... Running ./gdb.base/bang.exp ... Running ./gdb.base/bfp-test.exp ... Running ./gdb.base/bigcore.exp ... Running ./gdb.base/bitfields.exp ... Running ./gdb.base/bitfields2.exp ... Running ./gdb.base/bitops.exp ... Running ./gdb.base/break-always.exp ... Running ./gdb.base/break.exp ... Running ./gdb.base/breakpoint-shadow.exp ... Running ./gdb.base/call-ar-st.exp ... Running ./gdb.base/call-rt-st.exp ... Running ./gdb.base/call-sc.exp ... Running ./gdb.base/call-signal-resume.exp ... Running ./gdb.base/call-strs.exp ... Running ./gdb.base/callexit.exp ... Running ./gdb.base/callfuncs.exp ... Running ./gdb.base/catch-syscall.exp ... Running ./gdb.base/charset.exp ... Running ./gdb.base/checkpoint.exp ... Running ./gdb.base/chng-syms.exp ... Running ./gdb.base/code-expr.exp ... Running ./gdb.base/commands.exp ... Running ./gdb.base/completion.exp ... Running ./gdb.base/complex.exp ... Running ./gdb.base/cond-expr.exp ... Running ./gdb.base/condbreak.exp ... Running ./gdb.base/consecutive.exp ... Running ./gdb.base/constvars.exp ... Running ./gdb.base/corefile.exp ... Running ./gdb.base/cursal.exp ... Running ./gdb.base/cvexpr.exp ... Running ./gdb.base/dbx.exp ... Running ./gdb.base/default.exp ... WARNING: Skipping backtrace and break tests because of GDB stub. Running ./gdb.base/define.exp ... Running ./gdb.base/del.exp ... Running ./gdb.base/detach.exp ... Running ./gdb.base/dfp-exprs.exp ... Running ./gdb.base/dfp-test.exp ... Running ./gdb.base/display.exp ... Running ./gdb.base/dump.exp ... Running ./gdb.base/echo.exp ... Running ./gdb.base/ena-dis-br.exp ... Running ./gdb.base/ending-run.exp ... Running ./gdb.base/environ.exp ... Running ./gdb.base/eval-skip.exp ... Running ./gdb.base/exe-lock.exp ... Running ./gdb.base/expand-psymtabs.exp ... Running ./gdb.base/exprs.exp ... Running ./gdb.base/fileio.exp ... Running ./gdb.base/find.exp ... Running ./gdb.base/finish.exp ... Running ./gdb.base/fixsection.exp ... Running ./gdb.base/float.exp ... Running ./gdb.base/foll-exec.exp ... Running ./gdb.base/foll-fork.exp ... Running ./gdb.base/foll-vfork.exp ... Running ./gdb.base/frame-args.exp ... Running ./gdb.base/freebpcmd.exp ... Running ./gdb.base/fullname.exp ... Running ./gdb.base/funcargs.exp ... Running ./gdb.base/gcore-buffer-overflow.exp ... Running ./gdb.base/gcore.exp ... Running ./gdb.base/gdb1056.exp ... Running ./gdb.base/gdb1090.exp ... Running ./gdb.base/gdb1250.exp ... Running ./gdb.base/gdb1555.exp ... Running ./gdb.base/gdb1821.exp ... Running ./gdb.base/gdbvars.exp ... Running ./gdb.base/hashline1.exp ... Running ./gdb.base/hashline2.exp ... Running ./gdb.base/hashline3.exp ... Running ./gdb.base/help.exp ... Running ./gdb.base/hook-stop-continue.exp ... Running ./gdb.base/hook-stop-frame.exp ... Running ./gdb.base/huge.exp ... Running ./gdb.base/ifelse.exp ... Running ./gdb.base/included.exp ... Running ./gdb.base/infnan.exp ... Running ./gdb.base/info-proc.exp ... Running ./gdb.base/info-target.exp ... Running ./gdb.base/interp.exp ... Running ./gdb.base/interrupt.exp ... Running ./gdb.base/jump.exp ... Running ./gdb.base/langs.exp ... Running ./gdb.base/lineinc.exp ... Running ./gdb.base/list.exp ... Running ./gdb.base/logical.exp ... Running ./gdb.base/long_long.exp ... Running ./gdb.base/longjmp.exp ... FAIL: gdb.base/longjmp.exp: next over longjmp(1) FAIL: gdb.base/longjmp.exp: next over call_longjmp (2) FAIL: gdb.base/longjmp.exp: next over patt3 Running ./gdb.base/macscp.exp ... FAIL: gdb.base/macscp.exp: info macro FROM_COMMANDLINE Running ./gdb.base/maint.exp ... Running ./gdb.base/mips_pro.exp ... Running ./gdb.base/miscexprs.exp ... Running ./gdb.base/multi-forks.exp ... Running ./gdb.base/nodebug.exp ... Running ./gdb.base/nofield.exp ... Running ./gdb.base/opaque.exp ... Running ./gdb.base/overlays.exp ... Running ./gdb.base/page.exp ... Running ./gdb.base/pc-fp.exp ... Running ./gdb.base/pending.exp ... Running ./gdb.base/pie-support.exp ... Running ./gdb.base/pointers.exp ... Running ./gdb.base/prelink.exp ... Running ./gdb.base/printcmds.exp ... Running ./gdb.base/prologue.exp ... Running ./gdb.base/psymtab.exp ... Running ./gdb.base/ptr-typedef.exp ... Running ./gdb.base/ptype.exp ... Running ./gdb.base/radix.exp ... Running ./gdb.base/randomize.exp ... Running ./gdb.base/readline.exp ... Running ./gdb.base/recurse.exp ... Running ./gdb.base/regs.exp ... Running ./gdb.base/relational.exp ... Running ./gdb.base/relativedebug.exp ... Running ./gdb.base/relocate.exp ... Running ./gdb.base/remote.exp ... Running ./gdb.base/remotetimeout.exp ... Running ./gdb.base/reread.exp ... Running ./gdb.base/restore.exp ... Running ./gdb.base/return-nodebug.exp ... Running ./gdb.base/return.exp ... Running ./gdb.base/return2.exp ... Running ./gdb.base/savedregs.exp ... Running ./gdb.base/scope.exp ... Running ./gdb.base/sect-cmd.exp ... Running ./gdb.base/sep.exp ... Running ./gdb.base/sepdebug.exp ... Running ./gdb.base/sepsymtab.exp ... Running ./gdb.base/set-lang-auto.exp ... Running ./gdb.base/setshow.exp ... Running ./gdb.base/setvar.exp ... Running ./gdb.base/shlib-call.exp ... Running ./gdb.base/shreloc.exp ... Running ./gdb.base/sigall.exp ... Running ./gdb.base/sigaltstack.exp ... Running ./gdb.base/sigbpt.exp ... Running ./gdb.base/sigchld.exp ... Running ./gdb.base/siginfo-addr.exp ... Running ./gdb.base/siginfo-obj.exp ... Running ./gdb.base/siginfo.exp ... Running ./gdb.base/signals.exp ... Running ./gdb.base/signull.exp ... Running ./gdb.base/sigrepeat.exp ... Running ./gdb.base/sigstep.exp ... Running ./gdb.base/sizeof.exp ... Running ./gdb.base/so-impl-ld.exp ... Running ./gdb.base/so-indr-cl.exp ... Running ./gdb.base/solib-disc.exp ... Running ./gdb.base/solib-display.exp ... Running ./gdb.base/solib-overlap.exp ... Running ./gdb.base/solib-symbol.exp ... Running ./gdb.base/solib-weak.exp ... Running ./gdb.base/solib.exp ... Running ./gdb.base/source.exp ... Running ./gdb.base/stack-checking.exp ... Running ./gdb.base/start.exp ... Running ./gdb.base/step-break.exp ... Running ./gdb.base/step-bt.exp ... Running ./gdb.base/step-line.exp ... Running ./gdb.base/step-test.exp ... Running ./gdb.base/store.exp ... Running ./gdb.base/structs.exp ... Running ./gdb.base/structs2.exp ... Running ./gdb.base/structs3.exp ... Running ./gdb.base/subst.exp ... Running ./gdb.base/term.exp ... Running ./gdb.base/trace-commands.exp ... Running ./gdb.base/twice.exp ... Running ./gdb.base/type-opaque.exp ... Running ./gdb.base/unload.exp ... Running ./gdb.base/until.exp ... Running ./gdb.base/unwindonsignal.exp ... Running ./gdb.base/value-double-free.exp ... Running ./gdb.base/varargs.exp ... Running ./gdb.base/volatile.exp ... Running ./gdb.base/watch_thread_num.exp ... Running ./gdb.base/watchpoint-hw.exp ... Running ./gdb.base/watchpoint-solib.exp ... Running ./gdb.base/watchpoint.exp ... Running ./gdb.base/watchpoints.exp ... Running ./gdb.base/whatis-exp.exp ... Running ./gdb.base/whatis.exp ... Running ./gdb.cell/arch.exp ... Running ./gdb.cell/break.exp ... Running ./gdb.cell/bt.exp ... Running ./gdb.cell/core.exp ... Running ./gdb.cell/data.exp ... Running ./gdb.cell/ea-cache.exp ... Running ./gdb.cell/ea-standalone.exp ... Running ./gdb.cell/ea-test.exp ... Running ./gdb.cell/f-regs.exp ... Running ./gdb.cell/gcore.exp ... Running ./gdb.cell/mem-access.exp ... Running ./gdb.cell/ptype.exp ... Running ./gdb.cell/registers.exp ... Running ./gdb.cell/sizeof.exp ... Running ./gdb.cell/solib-symbol.exp ... Running ./gdb.cell/solib.exp ... Running ./gdb.cp/abstract-origin.exp ... Running ./gdb.cp/ambiguous.exp ... Running ./gdb.cp/annota2.exp ... Running ./gdb.cp/annota3.exp ... Running ./gdb.cp/anon-union.exp ... Running ./gdb.cp/arg-reference.exp ... FAIL: gdb.cp/arg-reference.exp: No false reference Running ./gdb.cp/bool.exp ... Running ./gdb.cp/breakpoint.exp ... Running ./gdb.cp/bs15503.exp ... Running ./gdb.cp/call-c.exp ... Running ./gdb.cp/casts.exp ... Running ./gdb.cp/class2.exp ... Running ./gdb.cp/classes.exp ... FAIL: gdb.cp/classes.exp: print ctor of typedef class Running ./gdb.cp/cp-relocate.exp ... Running ./gdb.cp/cpcompletion.exp ... Running ./gdb.cp/cplusfuncs.exp ... Running ./gdb.cp/ctti.exp ... Running ./gdb.cp/demangle.exp ... Running ./gdb.cp/derivation.exp ... Running ./gdb.cp/exception.exp ... FAIL: gdb.cp/exception.exp: continue to second throw Running ./gdb.cp/expand-sals.exp ... Running ./gdb.cp/formatted-ref.exp ... Running ./gdb.cp/gdb1355.exp ... Running ./gdb.cp/gdb2384.exp ... Running ./gdb.cp/gdb2495.exp ... Running ./gdb.cp/hang.exp ... Running ./gdb.cp/inherit.exp ... FAIL: gdb.cp/inherit.exp: ptype tagless struct FAIL: gdb.cp/inherit.exp: print type of anonymous union // unrecognized line type 1: class_with_anon_union::._0; Running ./gdb.cp/local.exp ... Running ./gdb.cp/m-data.exp ... Running ./gdb.cp/m-static.exp ... Running ./gdb.cp/maint.exp ... Running ./gdb.cp/mb-ctor.exp ... Running ./gdb.cp/mb-inline.exp ... Running ./gdb.cp/mb-templates.exp ... Running ./gdb.cp/member-ptr.exp ... Running ./gdb.cp/method.exp ... Running ./gdb.cp/method2.exp ... Running ./gdb.cp/misc.exp ... Running ./gdb.cp/namespace-nested-import.exp ... Running ./gdb.cp/namespace-using.exp ... Running ./gdb.cp/namespace.exp ... FAIL: gdb.cp/namespace.exp: print 'F::cXf' FAIL: gdb.cp/namespace.exp: print F::cXf FAIL: gdb.cp/namespace.exp: print F::cXfX FAIL: gdb.cp/namespace.exp: print 'G::Xg' FAIL: gdb.cp/namespace.exp: print G::Xg FAIL: gdb.cp/namespace.exp: print G::XgX FAIL: gdb.cp/namespace.exp: print cXOtherFile FAIL: gdb.cp/namespace.exp: print XOtherFile Running ./gdb.cp/overload.exp ... Running ./gdb.cp/ovldbreak.exp ... Running ./gdb.cp/pass-by-ref.exp ... Running ./gdb.cp/pr-1023.exp ... Running ./gdb.cp/pr-1210.exp ... Running ./gdb.cp/pr-574.exp ... Running ./gdb.cp/pr9631.exp ... Running ./gdb.cp/printmethod.exp ... Running ./gdb.cp/psmang.exp ... Running ./gdb.cp/punctuator.exp ... Running ./gdb.cp/ref-params.exp ... Running ./gdb.cp/ref-types.exp ... Running ./gdb.cp/rtti.exp ... Running ./gdb.cp/templates.exp ... Running ./gdb.cp/try_catch.exp ... Running ./gdb.cp/userdef.exp ... Running ./gdb.cp/virtfunc.exp ... Running ./gdb.disasm/am33.exp ... Running ./gdb.disasm/h8300s.exp ... Running ./gdb.disasm/hppa.exp ... Running ./gdb.disasm/mn10300.exp ... Running ./gdb.disasm/sh3.exp ... Running ./gdb.disasm/t01_mov.exp ... Running ./gdb.disasm/t02_mova.exp ... Running ./gdb.disasm/t03_add.exp ... Running ./gdb.disasm/t04_sub.exp ... Running ./gdb.disasm/t05_cmp.exp ... Running ./gdb.disasm/t06_ari2.exp ... Running ./gdb.disasm/t07_ari3.exp ... Running ./gdb.disasm/t08_or.exp ... Running ./gdb.disasm/t09_xor.exp ... Running ./gdb.disasm/t10_and.exp ... Running ./gdb.disasm/t11_logs.exp ... Running ./gdb.disasm/t12_bit.exp ... Running ./gdb.disasm/t13_otr.exp ... Running ./gdb.dwarf2/callframecfa.exp ... Running ./gdb.dwarf2/dup-psym.exp ... Running ./gdb.dwarf2/dw2-basic.exp ... Running ./gdb.dwarf2/dw2-compressed.exp ... Running ./gdb.dwarf2/dw2-cu-size.exp ... Running ./gdb.dwarf2/dw2-inheritance.exp ... Running ./gdb.dwarf2/dw2-intercu.exp ... Running ./gdb.dwarf2/dw2-intermix.exp ... Running ./gdb.dwarf2/dw2-noloc.exp ... Running ./gdb.dwarf2/dw2-producer.exp ... Running ./gdb.dwarf2/dw2-ranges.exp ... Running ./gdb.dwarf2/dw2-ref-missing-frame.exp ... Running ./gdb.dwarf2/dw2-restore.exp ... Running ./gdb.dwarf2/dw2-strp.exp ... Running ./gdb.dwarf2/dw2-unresolved.exp ... Running ./gdb.dwarf2/mac-fileno.exp ... Running ./gdb.dwarf2/valop.exp ... Running ./gdb.fortran/array-element.exp ... Running ./gdb.fortran/complex.exp ... Running ./gdb.fortran/derived-type.exp ... Running ./gdb.fortran/exprs.exp ... Running ./gdb.fortran/module.exp ... Running ./gdb.fortran/subarray.exp ... Running ./gdb.fortran/types.exp ... Running ./gdb.gdb/complaints.exp ... Running ./gdb.gdb/observer.exp ... Running ./gdb.gdb/selftest.exp ... Running ./gdb.gdb/xfullpath.exp ... Running ./gdb.hp/gdb.aCC/exception.exp ... Running ./gdb.hp/gdb.aCC/optimize.exp ... Running ./gdb.hp/gdb.aCC/watch-cmd.exp ... Running ./gdb.hp/gdb.base-hp/callfwmall.exp ... Running ./gdb.hp/gdb.base-hp/dollar.exp ... Running ./gdb.hp/gdb.base-hp/hwwatchbus.exp ... Running ./gdb.hp/gdb.base-hp/pxdb.exp ... Running ./gdb.hp/gdb.base-hp/reg-pa64.exp ... Running ./gdb.hp/gdb.base-hp/reg.exp ... Running ./gdb.hp/gdb.base-hp/sized-enum.exp ... Running ./gdb.hp/gdb.base-hp/so-thresh.exp ... Running ./gdb.hp/gdb.compat/xdb1.exp ... Running ./gdb.hp/gdb.compat/xdb2.exp ... Running ./gdb.hp/gdb.compat/xdb3.exp ... Running ./gdb.hp/gdb.defects/bs14602.exp ... Running ./gdb.hp/gdb.defects/solib-d.exp ... Running ./gdb.hp/gdb.objdbg/objdbg01.exp ... Running ./gdb.hp/gdb.objdbg/objdbg02.exp ... Running ./gdb.hp/gdb.objdbg/objdbg03.exp ... Running ./gdb.hp/gdb.objdbg/objdbg04.exp ... Running ./gdb.java/jmain.exp ... Running ./gdb.java/jmisc.exp ... Running ./gdb.java/jprint.exp ... Running ./gdb.java/jv-exp.exp ... Running ./gdb.java/jv-print.exp ... Running ./gdb.mi/gdb2549.exp ... Running ./gdb.mi/gdb669.exp ... Running ./gdb.mi/gdb680.exp ... Running ./gdb.mi/gdb701.exp ... Running ./gdb.mi/gdb792.exp ... Running ./gdb.mi/mi-async.exp ... Running ./gdb.mi/mi-basics.exp ... Running ./gdb.mi/mi-break.exp ... Running ./gdb.mi/mi-cli.exp ... Running ./gdb.mi/mi-console.exp ... Running ./gdb.mi/mi-disassemble.exp ... Running ./gdb.mi/mi-eval.exp ... Running ./gdb.mi/mi-file-transfer.exp ... Running ./gdb.mi/mi-file.exp ... Running ./gdb.mi/mi-hack-cli.exp ... Running ./gdb.mi/mi-nonstop-exit.exp ... Running ./gdb.mi/mi-nonstop.exp ... Running ./gdb.mi/mi-nsintrall.exp ... Running ./gdb.mi/mi-nsmoribund.exp ... Running ./gdb.mi/mi-nsthrexec.exp ... Running ./gdb.mi/mi-pending.exp ... Running ./gdb.mi/mi-pthreads.exp ... Running ./gdb.mi/mi-read-memory.exp ... Running ./gdb.mi/mi-regs.exp ... Running ./gdb.mi/mi-return.exp ... Running ./gdb.mi/mi-simplerun.exp ... Running ./gdb.mi/mi-stack.exp ... Running ./gdb.mi/mi-stepi.exp ... Running ./gdb.mi/mi-syn-frame.exp ... Running ./gdb.mi/mi-until.exp ... Running ./gdb.mi/mi-var-block.exp ... Running ./gdb.mi/mi-var-child-f.exp ... Running ./gdb.mi/mi-var-child.exp ... Running ./gdb.mi/mi-var-cmd.exp ... FAIL: gdb.mi/mi-var-cmd.exp: in-and-out-of-scope: in scope now Running ./gdb.mi/mi-var-cp.exp ... Running ./gdb.mi/mi-var-display.exp ... Running ./gdb.mi/mi-var-invalidate.exp ... Running ./gdb.mi/mi-watch.exp ... Running ./gdb.mi/mi2-basics.exp ... Running ./gdb.mi/mi2-break.exp ... Running ./gdb.mi/mi2-cli.exp ... Running ./gdb.mi/mi2-console.exp ... Running ./gdb.mi/mi2-disassemble.exp ... Running ./gdb.mi/mi2-eval.exp ... Running ./gdb.mi/mi2-file.exp ... Running ./gdb.mi/mi2-hack-cli.exp ... Running ./gdb.mi/mi2-pthreads.exp ... Running ./gdb.mi/mi2-read-memory.exp ... Running ./gdb.mi/mi2-regs.exp ... Running ./gdb.mi/mi2-return.exp ... Running ./gdb.mi/mi2-simplerun.exp ... Running ./gdb.mi/mi2-stack.exp ... Running ./gdb.mi/mi2-stepi.exp ... Running ./gdb.mi/mi2-syn-frame.exp ... Running ./gdb.mi/mi2-until.exp ... Running ./gdb.mi/mi2-var-block.exp ... Running ./gdb.mi/mi2-var-child.exp ... Running ./gdb.mi/mi2-var-cmd.exp ... Running ./gdb.mi/mi2-var-display.exp ... Running ./gdb.mi/mi2-watch.exp ... Running ./gdb.modula2/unbounded-array.exp ... Running ./gdb.objc/basicclass.exp ... Running ./gdb.objc/nondebug.exp ... Running ./gdb.objc/objcdecode.exp ... Running ./gdb.opt/clobbered-registers-O2.exp ... Running ./gdb.opt/inline-bt.exp ... Running ./gdb.opt/inline-cmds.exp ... Running ./gdb.opt/inline-locals.exp ... Running ./gdb.pascal/floats.exp ... Running ./gdb.pascal/hello.exp ... Running ./gdb.pascal/integers.exp ... Running ./gdb.pascal/types.exp ... Running ./gdb.python/py-cmd.exp ... Running ./gdb.python/py-frame.exp ... Running ./gdb.python/py-function.exp ... Running ./gdb.python/py-mi.exp ... Running ./gdb.python/py-prettyprint.exp ... Running ./gdb.python/py-template.exp ... Running ./gdb.python/py-value.exp ... Running ./gdb.python/python.exp ... Running ./gdb.reverse/break-reverse.exp ... Running ./gdb.reverse/consecutive-reverse.exp ... Running ./gdb.reverse/finish-reverse.exp ... Running ./gdb.reverse/i386-reverse.exp ... Running ./gdb.reverse/machinestate.exp ... Running ./gdb.reverse/sigall-reverse.exp ... Running ./gdb.reverse/solib-reverse.exp ... Running ./gdb.reverse/step-reverse.exp ... Running ./gdb.reverse/until-reverse.exp ... Running ./gdb.reverse/watch-reverse.exp ... Running ./gdb.server/ext-attach.exp ... Running ./gdb.server/ext-run.exp ... Running ./gdb.server/file-transfer.exp ... Running ./gdb.server/server-mon.exp ... Running ./gdb.server/server-run.exp ... Running ./gdb.stabs/exclfwd.exp ... Running ./gdb.stabs/weird.exp ... Running ./gdb.threads/attach-into-signal.exp ... Running ./gdb.threads/attach-stopped.exp ... Running ./gdb.threads/attachstop-mt.exp ... Running ./gdb.threads/bp_in_thread.exp ... Running ./gdb.threads/current-lwp-dead.exp ... Running ./gdb.threads/execl.exp ... FAIL: gdb.threads/execl.exp: continue across exec Running ./gdb.threads/fork-child-threads.exp ... FAIL: gdb.threads/fork-child-threads.exp: next over fork FAIL: gdb.threads/fork-child-threads.exp: get to the spawned thread FAIL: gdb.threads/fork-child-threads.exp: two threads found Running ./gdb.threads/fork-thread-pending.exp ... Running ./gdb.threads/gcore-thread.exp ... Running ./gdb.threads/hand-call-in-threads.exp ... Running ./gdb.threads/interrupted-hand-call.exp ... Running ./gdb.threads/killed.exp ... Running ./gdb.threads/linux-dp.exp ... Running ./gdb.threads/manythreads.exp ... Running ./gdb.threads/multi-create.exp ... Running ./gdb.threads/pending-step.exp ... Running ./gdb.threads/print-threads.exp ... Running ./gdb.threads/pthread_cond_wait.exp ... Running ./gdb.threads/pthreads.exp ... Running ./gdb.threads/schedlock.exp ... Running ./gdb.threads/sigthread.exp ... Running ./gdb.threads/staticthreads.exp ... Running ./gdb.threads/step.exp ... Running ./gdb.threads/step2.exp ... Running ./gdb.threads/switch-threads.exp ... Running ./gdb.threads/thread-execl.exp ... Running ./gdb.threads/thread-specific.exp ... Running ./gdb.threads/thread-unwindonsignal.exp ... Running ./gdb.threads/thread_check.exp ... Running ./gdb.threads/thread_events.exp ... Running ./gdb.threads/threadapply.exp ... Running ./gdb.threads/threxit-hop-specific.exp ... Running ./gdb.threads/tls-nodebug.exp ... Running ./gdb.threads/tls-shared.exp ... Running ./gdb.threads/tls.exp ... Running ./gdb.threads/watchthreads.exp ... Running ./gdb.threads/watchthreads2.exp ... Running ./gdb.trace/actions.exp ... Running ./gdb.trace/backtrace.exp ... Running ./gdb.trace/circ.exp ... Running ./gdb.trace/collection.exp ... Running ./gdb.trace/deltrace.exp ... Running ./gdb.trace/infotrace.exp ... Running ./gdb.trace/limits.exp ... Running ./gdb.trace/packetlen.exp ... Running ./gdb.trace/passc-dyn.exp ... Running ./gdb.trace/passcount.exp ... Running ./gdb.trace/report.exp ... Running ./gdb.trace/save-trace.exp ... Running ./gdb.trace/tfind.exp ... Running ./gdb.trace/tracecmd.exp ... Running ./gdb.trace/while-dyn.exp ... Running ./gdb.trace/while-stepping.exp ... Running ./gdb.xml/tdesc-arch.exp ... Running ./gdb.xml/tdesc-errors.exp ... Running ./gdb.xml/tdesc-regs.exp ... Running ./gdb.xml/tdesc-xinclude.exp ... === gdb Summary === # of expected passes 12757 # of unexpected failures 22 # of expected failures 43 # of known failures 51 # of untested testcases 13 # of unsupported tests 73 /home/caz/lightfleet/kgdb/gdb-KgdbLight/gdb/testsuite/../../gdb/gdb version 7.0.50.20091001-cvs -nw -nx make[2]: *** [check-single] Error 1 make[2]: Leaving directory `/home/caz/lightfleet/kgdb/gdb-KgdbLight/gdb/testsuite' make[1]: *** [check] Error 2 make[1]: Leaving directory `/home/caz/lightfleet/kgdb/gdb-KgdbLight/gdb' make: *** [check-gdb] Error 2 ^ permalink raw reply [flat|nested] 55+ messages in thread
* RE: symbolic debug of loadable modules with kgdb light 2009-05-15 21:23 ` Pedro Alves 2009-05-15 21:34 ` Daniel Jacobowitz @ 2009-05-15 21:34 ` Caz Yokoyama 1 sibling, 0 replies; 55+ messages in thread From: Caz Yokoyama @ 2009-05-15 21:34 UTC (permalink / raw) To: 'Pedro Alves', gdb-patches; +Cc: tromey, 'Joel Brobecker' Hello Pedro, SysRq expects 1) Ctrl+AltSysRq and "g" from console, or 2) BREAK and "g" from serial port. I am using 2). -caz -----Original Message----- From: Pedro Alves [mailto:pedro@codesourcery.com] Sent: Friday, May 15, 2009 2:24 PM To: gdb-patches@sourceware.org Cc: Caz Yokoyama; tromey@redhat.com; 'Joel Brobecker' Subject: Re: symbolic debug of loadable modules with kgdb light Sounds like you need to fix kgdb instead. Why would it need a 'g' on connection? On Friday 15 May 2009 22:15:31, Caz Yokoyama wrote: > Hello Tom, > Here is the patch for 2) which enables "break-in Linux kernel 2.6.26 and > later which kgdb is enabled. When linux-kgdb is set (i.e. not 0), gdb sends > BREAK and g when gdb is started and when ^C is typed on gdb. > > gdb/main.c - define linux_kgdb > gdb/remote.c - sends BREAK and g when gdb is started and when ^C is tyed on > gdb. > > All these modification comes from me. > > Index: gdb/main.c > =================================================================== > RCS file: /cvs/src/src/gdb/main.c,v > retrieving revision 1.76 > diff -p -r1.76 main.c > *** gdb/main.c 27 Apr 2009 10:24:08 -0000 1.76 > --- gdb/main.c 14 May 2009 17:00:05 -0000 > *************** char *gdb_sysroot = 0; > *** 67,72 **** > --- 67,75 ---- > /* GDB datadir, used to store data files. */ > char *gdb_datadir = 0; > > + /* Whether debugging Linux kernel by using its kgdb */ int linux_kgdb > + = 0; > + > struct ui_file *gdb_stdout; > struct ui_file *gdb_stderr; > struct ui_file *gdb_stdlog; > Index: gdb/remote.c > =================================================================== > RCS file: /cvs/src/src/gdb/remote.c,v > retrieving revision 1.354 > diff -p -r1.354 remote.c > *** gdb/remote.c 16 Apr 2009 19:31:03 -0000 1.354 > --- gdb/remote.c 14 May 2009 17:00:08 -0000 > *************** static struct cmd_list_element *remote_c > *** 239,244 **** > --- 239,246 ---- > static struct cmd_list_element *remote_set_cmdlist; > static struct cmd_list_element *remote_show_cmdlist; > > + extern int linux_kgdb; > + > /* Description of the remote protocol state for the currently > connected target. This is per-target state, and independent of the > selected architecture. */ > *************** remote_start_remote (struct ui_out *uiou > *** 2606,2611 **** > --- 2608,2618 ---- > /* Ack any packet which the remote side has already sent. */ > serial_write (remote_desc, "+", 1); > > + if (linux_kgdb) { > + serial_send_break(remote_desc); > + serial_write(remote_desc, "g", 1); > + } > + > /* The first packet we send to the target is the optional "supported > packets" request. If the target can answer this, it will tell us > which later probes to skip. */ > *************** remote_stop_as (ptid_t ptid) > *** 4020,4029 **** > > /* Send a break or a ^C, depending on user preference. */ > > ! if (remote_break) > serial_send_break (remote_desc); > ! else > ! serial_write (remote_desc, "\003", 1); > } > > /* This is the generic stop called via the target vector. When a target > --- 4027,4041 ---- > > /* Send a break or a ^C, depending on user preference. */ > > ! if (linux_kgdb) { > serial_send_break (remote_desc); > ! serial_write (remote_desc, "g", 1); > ! } else { > ! if (remote_break) > ! serial_send_break (remote_desc); > ! else > ! serial_write (remote_desc, "\003", 1); > ! } > } > > /* This is the generic stop called via the target vector. When a target > *************** If set, a break, instead of a cntrl-c, i > *** 9063,9068 **** > --- 9075,9087 ---- > NULL, NULL, /* FIXME: i18n: Whether to send break > if interrupted is %s. */ > &setlist, &showlist); > > + add_setshow_boolean_cmd ("linux-kgdb", no_class, &linux_kgdb, _("\ > + Set whether Linux kernel is debugged by using kgdb."), _("\ Show > + whether Linux kernel is debugged by using kgdb."), _("\ If set, send a > + break and g to the remote target to break-in."), > + NULL, NULL, > + &setlist, &showlist); > + > /* Install commands for configuring memory read/write packets. */ > > add_cmd ("remotewritesize", no_class, set_memory_write_packet_size, _("\ > > I am working for a patch for 1). > -caz > > -----Original Message----- > From: Caz Yokoyama [mailto:caz@caztech.com] > Sent: Saturday, April 25, 2009 5:36 PM > To: 'tromey@redhat.com' > Cc: 'Joel Brobecker'; 'gdb-patches@sourceware.org' > Subject: RE: symbolic debug of loadable modules with kgdb light > > Correction > kgdb light expects BREAK and then ^C. > --------- > kgdb light expects BREAK and then g. > -caz > > -----Original Message----- > From: Caz Yokoyama [mailto:caz@caztech.com] > Sent: Friday, April 24, 2009 9:48 AM > To: 'tromey@redhat.com' > Cc: 'Joel Brobecker'; 'gdb-patches@sourceware.org' > Subject: RE: symbolic debug of loadable modules with kgdb light > > Hello Tom, > Thank you for pay attention for my patch. > Have you read following discussion about this? There are 2 points my patch > add to, 1) symbolic debug of loadable modules with kgdb light, 2) break-in > by ^C remotely. For 1), Ruby support is integrating into gdb. By using that, > it access /proc file system and incorporate a symbol table for a loadable > module. Someone told me approach by Ruby is more attractive. So, my > understanding of this is my modification is useless because of Ruby support. > BTW, I had kept my modification against cvs source of gdb instead of 6.8. > > For 2), gdb emits BREAK or ^C depending when ^C is typed. On the other hand, > kgdb light expects BREAK and then ^C. I introduce debugkernel. When > debugkernel is true, BREAK and then ^C is emitted to target. Someone said > more elegant scheme is needed instead of debugkernel. So, I lost interest. > BTW, this is all of my code and less than 10 lines of code modification. > -caz > > -----Original Message----- > From: Tom Tromey [mailto:tromey@redhat.com] > Sent: Friday, April 24, 2009 8:32 AM > To: Caz Yokoyama > Cc: 'Joel Brobecker'; gdb-patches@sourceware.org > Subject: Re: symbolic debug of loadable modules with kgdb light > > >>>>> "Caz" == Caz Yokoyama <cazyokoyama@gmail.com> writes: > > Caz> I have attached the patch against gdb-6.8. > > Thanks. > > Caz> - This patch is based on > Caz> http://kgdb.cvs.sourceforge.net/viewvc/kgdb/gdb/. I removed > Caz> garbage as mush as possible. But it still has the code which I > Caz> don't know what it is. I don't remove copyright notice which is > Caz> there. > > Do you have copyright assignment papers on file with the FSF? If not, > let me know and I can get you started on the process. This is a > requirement for getting any code into gdb. > > Did you write this entire patch yourself? I just want to make sure. > If not, we'll need to get papers from any contributor who wrote more > than 10 lines of code in the patch. > > Caz> - I haven't run testsuite because I could not find how to do that while > I > Caz> run make in testsuite directory. > > "make check". You need dejagnu installed. And you actually have to > run a baseline check without your patch applied, then compare the > results. > > Caz> - I believe that the code follows coding standard. Let me know if > Caz> not. > > I noticed a number of formatting nits. These are no big deal. > > More importantly, the patch makes a bunch of apparently > kernel-debugging-specific changes to generic code. I did not try to > read it very closely, but basically all of these will need to be cleaned > up. Some of the hunks we definitely do not want; e.g., moving > struct value into value.h. > > Tom > > -- Pedro Alves ^ permalink raw reply [flat|nested] 55+ messages in thread
end of thread, other threads:[~2009-10-28 15:05 UTC | newest]
Thread overview: 55+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-09 15:51 symbolic debug of loadable modules with kgdb light Caz Yokoyama
2009-04-24 15:33 ` Tom Tromey
2009-04-24 16:49 ` Caz Yokoyama
2009-04-26 0:39 ` Caz Yokoyama
2009-05-15 21:14 ` Caz Yokoyama
2009-05-15 21:23 ` Pedro Alves
2009-05-15 21:34 ` Daniel Jacobowitz
2009-05-15 21:41 ` Caz Yokoyama
2009-05-15 22:13 ` Michael Snyder
2009-05-15 22:25 ` Caz Yokoyama
2009-08-07 7:17 ` Caz Yokoyama
2009-08-07 9:22 ` Eli Zaretskii
2009-08-07 20:42 ` Caz Yokoyama
2009-09-23 0:48 ` Joel Brobecker
2009-09-23 1:39 ` Daniel Jacobowitz
2009-09-23 4:16 ` Caz Yokoyama
2009-09-23 11:36 ` Caz Yokoyama
2009-09-24 16:40 ` Caz Yokoyama
2009-09-24 22:42 ` Caz Yokoyama
2009-09-25 16:06 ` Joel Brobecker
2009-09-26 3:43 ` Caz Yokoyama
[not found] ` <535d47e30909260627n662135a1hf6d1a0bb33368b3a@mail.gmail.com>
2009-09-29 1:58 ` Joel Brobecker
2009-09-29 3:23 ` Caz Yokoyama
2009-09-29 4:22 ` Joel Brobecker
2009-09-29 4:58 ` Caz Yokoyama
2009-09-29 5:19 ` Joel Brobecker
2009-09-29 16:12 ` Caz Yokoyama
2009-09-29 16:39 ` Joel Brobecker
2009-09-30 4:45 ` Caz Yokoyama
2009-09-30 17:28 ` Joel Brobecker
2009-09-30 19:16 ` Eli Zaretskii
2009-09-30 20:12 ` Joel Brobecker
2009-10-01 3:48 ` Caz Yokoyama
2009-10-01 4:08 ` Eli Zaretskii
2009-10-01 4:51 ` Caz Yokoyama
2009-10-01 20:04 ` Eli Zaretskii
2009-10-01 16:33 ` Joel Brobecker
2009-10-01 17:18 ` Caz Yokoyama
2009-10-01 19:37 ` Joel Brobecker
2009-10-01 19:53 ` Caz Yokoyama
2009-10-01 20:25 ` Eli Zaretskii
2009-10-01 20:19 ` Eli Zaretskii
2009-10-01 20:29 ` Caz Yokoyama
2009-10-01 20:46 ` Joel Brobecker
2009-10-01 21:10 ` Daniel Jacobowitz
2009-10-01 21:58 ` Caz Yokoyama
2009-10-01 22:13 ` Pedro Alves
2009-10-01 23:04 ` Caz Yokoyama
2009-10-01 23:32 ` Joel Brobecker
2009-10-02 1:18 ` Caz Yokoyama
2009-10-02 22:14 ` Joel Brobecker
2009-10-02 8:55 ` Eli Zaretskii
2009-10-28 15:05 ` Joel Brobecker
2009-10-01 20:13 ` Caz Yokoyama
2009-05-15 21:34 ` Caz Yokoyama
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox