From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27964 invoked by alias); 9 Jan 2009 15:51:51 -0000 Received: (qmail 27956 invoked by uid 22791); 9 Jan 2009 15:51:50 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_00,MIME_QP_LONG_LINE,SARE_MSGID_LONG,SPF_PASS X-Spam-Check-By: sourceware.org Received: from rv-out-0708.google.com (HELO rv-out-0708.google.com) (209.85.198.244) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Jan 2009 15:51:32 +0000 Received: by rv-out-0708.google.com with SMTP id b17so9144290rvf.48 for ; Fri, 09 Jan 2009 07:51:30 -0800 (PST) Received: by 10.114.255.1 with SMTP id c1mr16954318wai.4.1231516289859; Fri, 09 Jan 2009 07:51:29 -0800 (PST) Received: from xpjpn (pool-71-111-133-125.ptldor.dsl-w.verizon.net [71.111.133.125]) by mx.google.com with ESMTPS id y25sm31019231pod.24.2009.01.09.07.51.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 09 Jan 2009 07:51:29 -0800 (PST) To: "'Joel Brobecker'" Cc: Subject: symbolic debug of loadable modules with kgdb light Date: Fri, 09 Jan 2009 15:51:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0196_01C9722F.06B319C0" From: Caz Yokoyama Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-01/txt/msg00199.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_0196_01C9722F.06B319C0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Content-length: 1113 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 ------=_NextPart_000_0196_01C9722F.06B319C0 Content-Type: application/octet-stream; name="gdb-6.8-KgdbLight.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="gdb-6.8-KgdbLight.patch" Content-length: 57602 Index: gdb/remote.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/remote.c (revision 4)=0A= +++ gdb/remote.c (working copy)=0A= @@ -3,6 +3,7 @@=0A= Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 199= 7,=0A= 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008=0A= Free Software Foundation, Inc.=0A= + Copyright (C) 2009 Caz Yokoyama, caz at caztech dot com.=0A= =20=0A= This file is part of GDB.=0A= =20=0A= @@ -2595,6 +2596,7 @@=0A= remote_open_1 (char *name, int from_tty, struct target_ops *target,=0A= int extended_p, int async_p)=0A= {=0A= + extern int debugvmlinux;=0A= struct remote_state *rs =3D get_remote_state ();=0A= if (name =3D=3D 0)=0A= error (_("To open a remote debug connection, you need to specify what\= n"=0A= @@ -2685,6 +2687,11 @@=0A= use_threadinfo_query =3D 1;=0A= use_threadextra_query =3D 1;=0A= =20=0A= + if (debugvmlinux) {=0A= + serial_send_break(remote_desc);=0A= + serial_write(remote_desc, "g", 1);=0A= + }=0A= +=0A= /* The first packet we send to the target is the optional "supported=0A= packets" request. If the target can answer this, it will tell us=0A= which later probes to skip. */=0A= @@ -3261,14 +3268,21 @@=0A= static void=0A= remote_stop (void)=0A= {=0A= + extern int debugkernel;=0A= +=0A= /* Send a break or a ^C, depending on user preference. */=0A= if (remote_debug)=0A= fprintf_unfiltered (gdb_stdlog, "remote_stop called\n");=0A= =20=0A= - if (remote_break)=0A= + if (debugkernel) {=0A= serial_send_break (remote_desc);=0A= - else=0A= - serial_write (remote_desc, "\003", 1);=0A= + serial_write (remote_desc, "g", 1);=0A= + } else {=0A= + if (remote_break)=0A= + serial_send_break (remote_desc);=0A= + else=0A= + serial_write (remote_desc, "\003", 1);=0A= + }=0A= }=0A= =20=0A= /* Ask the user what to do when an interrupt is received. */=0A= Index: gdb/dwarf2read.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/dwarf2read.c (revision 4)=0A= +++ gdb/dwarf2read.c (working copy)=0A= @@ -2,6 +2,7 @@=0A= =20=0A= Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 200= 3,=0A= 2004, 2005, 2006, 2007, 2008 Free Software Foundation, In= c.=0A= + Copyright (C) 2009 Caz Yokoyama, caz at caztech dot com.=0A= =20=0A= Adapted by Gary Funck (gary@intrepid.com), Intrepid Technology,=0A= Inc. with support from Florida State University (under contract=0A= @@ -1701,6 +1702,7 @@=0A= struct objfile *objfile =3D cu->objfile;=0A= bfd *abfd =3D objfile->obfd;=0A= struct partial_die_info *pdi;=0A= + extern int debugvmlinux;=0A= =20=0A= /* Now, march along the PDI's, descending into ones which have=0A= interesting children but skipping the children of the other ones,=0A= @@ -1775,6 +1777,13 @@=0A= /* If the die has a sibling, skip to the sibling. */=0A= =20=0A= pdi =3D pdi->die_sibling;=0A= +=0A= + if (debugvmlinux) {=0A= + if (pdi !=3D NULL && pdi->highpc >=3D 0xffffffffff000000) {=0A= + if (pdi->die_sibling !=3D NULL)=0A= + pdi =3D pdi->die_sibling;=0A= + }=0A= + }=0A= }=0A= }=0A= =20=0A= Index: gdb/ChangeLog-2009=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/ChangeLog-2009 (revision 0)=0A= +++ gdb/ChangeLog-2009 (revision 12)=0A= @@ -0,0 +1,7 @@=0A= +2009-01-09 Caz Yokoyama =0A= +=0A= + * remote.c send Magic SysRq, i.e. BREAK g when for kgdb light.=0A= + * dwarf2read.c work around for doubtfull high address in 2.6.27.8 kernel= =0A= + * main.c set whether debugging kernel=0A= + * amd64-linux-tdep.c add x86_64 linux kernel OS abi=0A= + * solib-svr4.c read symbol tables of loadable modules.=0A= Index: gdb/main.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/main.c (revision 4)=0A= +++ gdb/main.c (working copy)=0A= @@ -3,6 +3,7 @@=0A= Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 199= 5,=0A= 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008= =0A= Free Software Foundation, Inc.=0A= + Copyright (C) 2009 Caz Yokoyama, caz at caztech dot com.=0A= =20=0A= This file is part of GDB.=0A= =20=0A= @@ -62,6 +63,10 @@=0A= /* System root path, used to find libraries etc. */=0A= char *gdb_sysroot =3D 0;=0A= =20=0A= +/* Whether debugging a kernel */=0A= +int debugkernel =3D 0;=0A= +int debugvmlinux =3D 0; /* debugging vmlinx? */=0A= +=0A= struct ui_file *gdb_stdout;=0A= struct ui_file *gdb_stderr;=0A= struct ui_file *gdb_stdlog;=0A= @@ -131,6 +136,7 @@=0A= char *pid_or_core_arg =3D NULL;=0A= char *cdarg =3D NULL;=0A= char *ttyarg =3D NULL;=0A= + char *filename, *dir;=0A= =20=0A= /* These are static so that we can take their address in an initializer.= */=0A= static int print_help;=0A= @@ -679,6 +685,17 @@=0A= quit_pre_print =3D error_pre_print;=0A= warning_pre_print =3D _("\nwarning: ");=0A= =20=0A= + if (symarg !=3D NULL) {=0A= + for (filename =3D symarg;=0A= + (dir =3D strchr(filename, '/')) !=3D NULL;=0A= + filename =3D dir + 1) ;=0A= + /* only require the given characters to match, so that longer filename= s=0A= + will still match */=0A= + if (strncmp(filename, LINUX_KERNEL_NAME_STEM,=0A= + strlen(LINUX_KERNEL_NAME_STEM)) =3D=3D 0)=0A= + debugvmlinux =3D 1;=0A= + }=0A= +=0A= /* Read and execute $HOME/.gdbinit file, if it exists. This is done=0A= *before* all the command line arguments are processed; it sets=0A= global parameters, which are independent of what file you are=0A= Index: gdb/solib-svr4.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/solib-svr4.c (revision 4)=0A= +++ gdb/solib-svr4.c (working copy)=0A= @@ -2,6 +2,7 @@=0A= =20=0A= Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 200= 0,=0A= 2001, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.= =0A= + Copyright (C) 2009 Caz Yokoyama, caz at caztech dot com.=0A= =20=0A= This file is part of GDB.=0A= =20=0A= @@ -45,6 +46,7 @@=0A= =20=0A= static struct link_map_offsets *svr4_fetch_link_map_offsets (void);=0A= static int svr4_have_link_map_offsets (void);=0A= +static struct so_list *kernel_current_sos (void);=0A= =20=0A= /* Link map info to include in an allocated so_list entry */=0A= =20=0A= @@ -90,6 +92,7 @@=0A= #ifdef SOLIB_BKPT_NAME=0A= SOLIB_BKPT_NAME, /* Prefer configured name if it exists. */=0A= #endif=0A= + "module_event",=0A= "_start",=0A= "__start",=0A= "main",=0A= @@ -103,6 +106,113 @@=0A= NULL=0A= };=0A= =20=0A= +/* Macro to extract an address from a solib structure. When GDB is=0A= + configured for some 32-bit targets (e.g. Solaris 2.7 sparc), BFD is=0A= + configured to handle 64-bit targets, so CORE_ADDR is 64 bits. We=0A= + have to extract only the significant bits of addresses to get the=0A= + right address when accessing the core file BFD.=0A= +=0A= + Assume that the address is unsigned. */=0A= +=0A= +#define SOLIB_EXTRACT_ADDRESS(MEMBER) \=0A= + extract_unsigned_integer (&(MEMBER), sizeof (MEMBER))=0A= +=0A= +=0A= +/* Kernel debugging structures */=0A= +extern int debugkernel;=0A= +=0A= +struct list_head {=0A= + CORE_ADDR next;=0A= + CORE_ADDR prev;=0A= +};=0A= +=0A= +#define MODULE_NAME_LEN (64 - sizeof(CORE_ADDR))=0A= +=0A= +#define MAX_SECTNAME 31=0A= +=0A= +struct mod_section {=0A= + CORE_ADDR address;=0A= + char name[MAX_SECTNAME + 1];=0A= +};=0A= +=0A= +/* taken from kernel source code */=0A= +typedef unsigned int __kernel_mode_t;=0A= +typedef __kernel_mode_t mode_t;=0A= +=0A= +struct module;=0A= +=0A= +struct attribute {=0A= + const char *name;=0A= + struct module *owner;=0A= + mode_t mode;=0A= +};=0A= +=0A= +struct attribute_group {=0A= + const char *name;=0A= + struct attribute **attrs;=0A= +};=0A= +=0A= +struct module_attribute {=0A= + struct attribute attr;=0A= + ssize_t (*show)(struct module_attribute *, struct module *, char *);=0A= + ssize_t (*store)(struct module_attribute *, struct module *,=0A= + const char *, size_t count);=0A= + void (*setup)(struct module *, const char *);=0A= + int (*test)(struct module *);=0A= + void (*free)(struct module *);=0A= +};=0A= +=0A= +#define MODULE_SECT_NAME_LEN 32=0A= +struct module_sect_attr=0A= +{=0A= + struct module_attribute mattr;=0A= + char name[MODULE_SECT_NAME_LEN];=0A= + unsigned long address;=0A= +};=0A= +=0A= +struct module_sect_attrs=0A= +{=0A= + struct attribute_group grp;=0A= + struct module_sect_attr attrs[0];=0A= +};=0A= +#define NUM_SECTIONS 1 // number of sections=0A= +=0A= +struct attribute_group_2_6_27 {=0A= + const char *name;=0A= + mode_t (*is_visible)();=0A= + struct attribute **attrs;=0A= +};=0A= +=0A= +struct module_sect_attr_2_6_27=0A= +{=0A= + struct module_attribute mattr;=0A= + char *name;=0A= + unsigned long address;=0A= +};=0A= +=0A= +struct module_sect_attrs_2_6_27=0A= +{=0A= + struct attribute_group_2_6_27 grp;=0A= + unsigned int nsections;=0A= + struct module_sect_attr_2_6_27 attrs[0];=0A= +};=0A= +=0A= +struct module=0A= +{=0A= + CORE_ADDR unused_state;=0A= + struct list_head list;=0A= + char name[MODULE_NAME_LEN];=0A= +};=0A= +=0A= +struct kern_lm_info {=0A= + unsigned int nsections;=0A= + struct module_sect_attr module_sect_attr[0];=0A= +};=0A= +=0A= +#define OFFSET(structure, field) ((CORE_ADDR)(&((struct structure *)0)->fi= eld))=0A= +=0A= +/* local data declarations */=0A= +=0A= /* link map access functions */=0A= =20=0A= static CORE_ADDR=0A= @@ -714,10 +824,18 @@=0A= struct so_list **link_ptr =3D &head;=0A= CORE_ADDR ldsomap =3D 0;=0A= =20=0A= + if (debugkernel)=0A= + {=0A= + return kernel_current_sos();=0A= + }=0A= +=0A= /* Always locate the debug struct, in case it has moved. */=0A= debug_base =3D 0;=0A= locate_base ();=0A= =20=0A= + /* Make sure we've looked up the inferior's dynamic linker's base=0A= + structure. */=0A= +=0A= /* If we can't find the dynamic linker's base structure, this=0A= must not be a dynamically linked executable. Hmm. */=0A= if (! debug_base)=0A= @@ -1411,6 +1529,11 @@=0A= if (!enable_break ())=0A= return;=0A= =20=0A= + if (debugkernel)=0A= + {=0A= + solib_add (NULL, 0, NULL, 1);=0A= + }=0A= +=0A= #if defined(_SCO_DS)=0A= /* SCO needs the loop below, other systems should be using the=0A= special shared library breakpoints and the shared library breakpoint= =0A= @@ -1481,10 +1604,32 @@=0A= svr4_relocate_section_addresses (struct so_list *so,=0A= struct section_table *sec)=0A= {=0A= - sec->addr =3D svr4_truncate_ptr (sec->addr + LM_ADDR_CHECK (so,=0A= - sec->bfd));=0A= - sec->endaddr =3D svr4_truncate_ptr (sec->endaddr + LM_ADDR_CHECK (so,=0A= - sec->bfd));=0A= + if (debugkernel)=0A= + {=0A= + int i;=0A= + struct kern_lm_info *kern_lm_info =3D=0A= + (struct kern_lm_info *)so->lm_info->lm;=0A= + for (i =3D 0; i < kern_lm_info->nsections; i++)=0A= + {=0A= + if (!strcmp(kern_lm_info->module_sect_attr[i].name,=0A= + sec->the_bfd_section->name))=0A= + {=0A= + CORE_ADDR sect_addr =3D extract_typed_address(=0A= + (gdb_byte *)&kern_lm_info->module_sect_attr[i].address,=0A= + builtin_type_void_data_ptr);=0A= + sec->addr =3D sec->addr + sect_addr;=0A= + sec->endaddr =3D sec->endaddr + sect_addr;=0A= + break;=0A= + }=0A= + }=0A= + }=0A= + else=0A= + {=0A= + sec->addr =3D svr4_truncate_ptr (sec->addr + LM_ADDR_CHECK (so= ,=0A= + sec->bfd));=0A= + sec->endaddr =3D svr4_truncate_ptr (sec->endaddr + LM_ADDR_CHECK (so= ,=0A= + sec->bfd));=0A= + }=0A= }=0A= =0C=0A= =20=0A= @@ -1670,4 +1815,152 @@=0A= svr4_so_ops.in_dynsym_resolve_code =3D svr4_in_dynsym_resolve_code;=0A= svr4_so_ops.lookup_lib_global_symbol =3D elf_lookup_lib_symbol;=0A= svr4_so_ops.same =3D svr4_same;=0A= +=0A= + /* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */=0A= + current_target_so_ops =3D &svr4_so_ops;=0A= }=0A= +=0A= +/* Scans the list of modules in a kernel and finds out section addresses f= or=0A= + * those symbols */=0A= +static struct so_list *kernel_current_sos(void)=0A= +{=0A= + enum kversion {v2_6_18, v2_6_27};=0A= + short n;=0A= + struct expression *expr;=0A= + struct value *val;=0A= + unsigned int offset_sect_attrs;=0A= + enum kversion kv;=0A= + struct symbol *modules;=0A= + CORE_ADDR modlistaddr;=0A= + CORE_ADDR modnameaddr;=0A= + struct so_list *head =3D 0;=0A= + struct so_list **link_ptr =3D &head;=0A= +=0A= + expr =3D parse_expression("&((struct module *)0)->sect_attrs");=0A= + val =3D evaluate_expression(expr);=0A= + offset_sect_attrs =3D val->aligner.force_longest_align;=0A= + expr =3D parse_expression("&((struct module_sect_attrs *)0)->attrs[1]");= =0A= + val =3D evaluate_expression(expr);=0A= + if (val->aligner.force_longest_align =3D=3D (int)&((struct module_sect_a= ttrs *)0)->attrs[1]) {=0A= + kv =3D v2_6_18;=0A= + } else if (val->aligner.force_longest_align =3D=3D=0A= + (int)&((struct module_sect_attrs_2_6_27 *)0)->attrs[1]) {=0A= + kv =3D v2_6_27;=0A= + } else {=0A= + warning("struct module_sect_attrs is not the one of v2_6_18 nor v2_6_2= 7");=0A= + goto nolist;=0A= + }=0A= +=0A= + modules =3D lookup_symbol("modules", NULL, VAR_DOMAIN, NULL, NULL);=0A= + if (modules =3D=3D NULL)=0A= + goto nolist;=0A= +=0A= + /* Pointer to first module */=0A= + modlistaddr =3D read_memory_typed_address(SYMBOL_VALUE_ADDRESS(modules),= =0A= + builtin_type_void_data_ptr);=0A= + while (modlistaddr !=3D SYMBOL_VALUE_ADDRESS(modules)) {=0A= + struct so_list *new =3D (struct so_list *) xmalloc (sizeof (struct so_lis= t));=0A= + struct cleanup *old_chain =3D make_cleanup (xfree, new);=0A= + char *buffer;=0A= + int errcode;=0A= + CORE_ADDR mod_struct_addr;=0A= + CORE_ADDR mod_addr_sections;=0A= + struct kern_lm_info *kern_lm_info;=0A= + unsigned int nsections;=0A= + struct module_sect_attr_2_6_27 *attr_2_6_27;=0A= +=0A= + memset (new, 0, sizeof (*new));=0A= +=0A= + mod_struct_addr =3D modlistaddr - OFFSET(module, list);=0A= +=0A= + /* Read module name */=0A= + target_read_string(mod_struct_addr + OFFSET(module, name), &buffer,=0A= + MODULE_NAME_LEN, &errcode);=0A= + if (errcode || !strlen(buffer))=0A= + {=0A= + warning("Couldn't read module name");=0A= + do_cleanups (old_chain);=0A= + goto next_mod;=0A= + }=0A= + strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);=0A= + new->so_name[SO_NAME_MAX_PATH_SIZE - 1] =3D '\0';=0A= + strcpy (new->so_original_name, new->so_name);=0A= + new->next =3D 0;=0A= +=0A= + new->lm_info =3D xmalloc(sizeof (struct lm_info));=0A= + make_cleanup(xfree, new->lm_info);=0A= +=0A= + mod_addr_sections =3D read_memory_typed_address(mod_struct_addr + offset_= sect_attrs,=0A= + builtin_type_void_data_ptr);=0A= + switch (kv) {=0A= + case v2_6_18:=0A= + new->lm_info->lm =3D xmalloc(sizeof(struct kern_lm_info) +=0A= + sizeof(struct module_sect_attr) *=0A= + NUM_SECTIONS);=0A= + make_cleanup(xfree, new->lm_info->lm);=0A= + kern_lm_info =3D (struct kern_lm_info *)new->lm_info->lm;=0A= + kern_lm_info->nsections =3D NUM_SECTIONS;=0A= + if (target_read_memory(mod_addr_sections + OFFSET(module_sect_attrs, at= trs),=0A= + (char *)kern_lm_info->module_sect_attr,=0A= + sizeof(struct module_sect_attr) * NUM_SECTIONS) !=3D 0) {=0A= + warning("can't read module_sects in module %s", new->so_name);=0A= + do_cleanups(old_chain);=0A= + goto next_mod;=0A= + }=0A= + if (strcmp(kern_lm_info->module_sect_attr[0].name, ".text") !=3D 0) {= =0A= + warning("The first section is not .text: %s", kern_lm_info->module_se= ct_attr[0].name);=0A= + do_cleanups(old_chain);=0A= + goto next_mod;=0A= + }=0A= + break;=0A= + case v2_6_27:=0A= + nsections =3D read_memory_unsigned_integer(mod_addr_sections +=0A= + OFFSET(module_sect_attrs_2_6_27, nsections),=0A= + sizeof(nsections));=0A= + new->lm_info->lm =3D xmalloc(sizeof(struct kern_lm_info) +=0A= + sizeof(struct module_sect_attr) *=0A= + nsections);=0A= + make_cleanup(xfree, new->lm_info->lm);=0A= + kern_lm_info =3D (struct kern_lm_info *)new->lm_info->lm;=0A= + attr_2_6_27 =3D (struct module_sect_attr_2_6_27 *)malloc(=0A= + sizeof(*attr_2_6_27) *=0A= + nsections);=0A= + memset(attr_2_6_27, 0, sizeof(*attr_2_6_27) * nsections);=0A= + if (target_read_memory(mod_addr_sections + OFFSET(module_sect_attrs_2_6= _27, attrs),=0A= + (char *)attr_2_6_27,=0A= + sizeof(*attr_2_6_27) * nsections) !=3D 0) {=0A= + warning("can't read attr_attr_2_6_27 in module %s for v2_6_27", new->= so_name);=0A= + do_cleanups(old_chain);=0A= + goto next_mod;=0A= + }=0A= + for (n =3D 0; n < nsections; n++) {=0A= + if (target_read_memory((CORE_ADDR)attr_2_6_27[n].name,=0A= + kern_lm_info->module_sect_attr[n].name,=0A= + MODULE_SECT_NAME_LEN) !=3D 0) {=0A= + warning("can't read attr_attr_2_6_27 in module %s for v2_6_27", new= ->so_name);=0A= + do_cleanups(old_chain);=0A= + goto next_mod;=0A= + }=0A= + kern_lm_info->module_sect_attr[n].name[MODULE_SECT_NAME_LEN - 1] =3D = '\0';=0A= + kern_lm_info->module_sect_attr[n].address =3D attr_2_6_27[n].address;= =0A= + }=0A= + kern_lm_info->nsections =3D nsections;=0A= + free(attr_2_6_27);=0A= + break;=0A= + }=0A= + *link_ptr =3D new;=0A= + link_ptr =3D &new->next;=0A= + if (strlen(new->so_name) <=3D SO_NAME_MAX_PATH_SIZE - 2) {=0A= + strcat(new->so_name, ".ko");=0A= + }=0A= + xfree(buffer);=0A= + discard_cleanups(old_chain);=0A= +=0A= + next_mod:=0A= + modlistaddr =3D read_memory_typed_address(modlistaddr, builtin_type_void_= data_ptr);=0A= + }=0A= + return head;=0A= +=0A= + nolist:=0A= + return NULL;=0A= +}=0A= Index: gdb/ada-lang.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/ada-lang.c (revision 4)=0A= +++ gdb/ada-lang.c (working copy)=0A= @@ -3834,7 +3834,7 @@=0A= /* The following is taken from the structure-return code in=0A= call_function_by_hand. FIXME: Therefore, some refactoring seems=20=0A= indicated. */=0A= - if (gdbarch_inner_than (current_gdbarch, 1, 2))=0A= + if (gdbarch_inner_than(current_gdbarch, 1, 2, 0, 0))=0A= {=0A= /* Stack grows downward. Align SP and VALUE_ADDRESS (val) after=0A= reserving sufficient space. */=0A= Index: gdb/value.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/value.c (revision 4)=0A= +++ gdb/value.c (working copy)=0A= @@ -40,142 +40,6 @@=0A= =20=0A= void _initialize_values (void);=0A= =20=0A= -struct value=0A= -{=0A= - /* Type of value; either not an lval, or one of the various=0A= - different possible kinds of lval. */=0A= - enum lval_type lval;=0A= -=0A= - /* Is it modifiable? Only relevant if lval !=3D not_lval. */=0A= - int modifiable;=0A= -=0A= - /* Location of value (if lval). */=0A= - union=0A= - {=0A= - /* If lval =3D=3D lval_memory, this is the address in the inferior.=0A= - If lval =3D=3D lval_register, this is the byte offset into the=0A= - registers structure. */=0A= - CORE_ADDR address;=0A= -=0A= - /* Pointer to internal variable. */=0A= - struct internalvar *internalvar;=0A= - } location;=0A= -=0A= - /* Describes offset of a value within lval of a structure in bytes.=0A= - If lval =3D=3D lval_memory, this is an offset to the address. If=0A= - lval =3D=3D lval_register, this is a further offset from=0A= - location.address within the registers structure. Note also the=0A= - member embedded_offset below. */=0A= - int offset;=0A= -=0A= - /* Only used for bitfields; number of bits contained in them. */=0A= - int bitsize;=0A= -=0A= - /* Only used for bitfields; position of start of field. For=0A= - gdbarch_bits_big_endian=3D0 targets, it is the position of the LSB. = For=0A= - gdbarch_bits_big_endian=3D1 targets, it is the position of the MSB. *= /=0A= - int bitpos;=0A= -=0A= - /* Frame register value is relative to. This will be described in=0A= - the lval enum above as "lval_register". */=0A= - struct frame_id frame_id;=0A= -=0A= - /* Type of the value. */=0A= - struct type *type;=0A= -=0A= - /* If a value represents a C++ object, then the `type' field gives=0A= - the object's compile-time type. If the object actually belongs=0A= - to some class derived from `type', perhaps with other base=0A= - classes and additional members, then `type' is just a subobject=0A= - of the real thing, and the full object is probably larger than=0A= - `type' would suggest.=0A= -=0A= - If `type' is a dynamic class (i.e. one with a vtable), then GDB=0A= - can actually determine the object's run-time type by looking at=0A= - the run-time type information in the vtable. When this=0A= - information is available, we may elect to read in the entire=0A= - object, for several reasons:=0A= -=0A= - - When printing the value, the user would probably rather see the=0A= - full object, not just the limited portion apparent from the=0A= - compile-time type.=0A= -=0A= - - If `type' has virtual base classes, then even printing `type'=0A= - alone may require reaching outside the `type' portion of the=0A= - object to wherever the virtual base class has been stored.=0A= -=0A= - When we store the entire object, `enclosing_type' is the run-time=0A= - type -- the complete object -- and `embedded_offset' is the=0A= - offset of `type' within that larger type, in bytes. The=0A= - value_contents() macro takes `embedded_offset' into account, so=0A= - most GDB code continues to see the `type' portion of the value,=0A= - just as the inferior would.=0A= -=0A= - If `type' is a pointer to an object, then `enclosing_type' is a=0A= - pointer to the object's run-time type, and `pointed_to_offset' is=0A= - the offset in bytes from the full object to the pointed-to object=0A= - -- that is, the value `embedded_offset' would have if we followed=0A= - the pointer and fetched the complete object. (I don't really see=0A= - the point. Why not just determine the run-time type when you=0A= - indirect, and avoid the special case? The contents don't matter=0A= - until you indirect anyway.)=0A= -=0A= - If we're not doing anything fancy, `enclosing_type' is equal to=0A= - `type', and `embedded_offset' is zero, so everything works=0A= - normally. */=0A= - struct type *enclosing_type;=0A= - int embedded_offset;=0A= - int pointed_to_offset;=0A= -=0A= - /* Values are stored in a chain, so that they can be deleted easily=0A= - over calls to the inferior. Values assigned to internal=0A= - variables or put into the value history are taken off this=0A= - list. */=0A= - struct value *next;=0A= -=0A= - /* Register number if the value is from a register. */=0A= - short regnum;=0A= -=0A= - /* If zero, contents of this value are in the contents field. If=0A= - nonzero, contents are in inferior memory at address in the=0A= - location.address field plus the offset field (and the lval field=0A= - should be lval_memory).=0A= -=0A= - WARNING: This field is used by the code which handles watchpoints=0A= - (see breakpoint.c) to decide whether a particular value can be=0A= - watched by hardware watchpoints. If the lazy flag is set for=0A= - some member of a value chain, it is assumed that this member of=0A= - the chain doesn't need to be watched as part of watching the=0A= - value itself. This is how GDB avoids watching the entire struct=0A= - or array when the user wants to watch a single struct member or=0A= - array element. If you ever change the way lazy flag is set and=0A= - reset, be sure to consider this use as well! */=0A= - char lazy;=0A= -=0A= - /* If nonzero, this is the value of a variable which does not=0A= - actually exist in the program. */=0A= - char optimized_out;=0A= -=0A= - /* If value is a variable, is it initialized or not. */=0A= - int initialized;=0A= -=0A= - /* Actual contents of the value. For use of this value; setting it=0A= - uses the stuff above. Not valid if lazy is nonzero. Target=0A= - byte-order. We force it to be aligned properly for any possible=0A= - value. Note that a value therefore extends beyond what is=0A= - declared here. */=0A= - union=0A= - {=0A= - gdb_byte contents[1];=0A= - DOUBLEST force_doublest_align;=0A= - LONGEST force_longest_align;=0A= - CORE_ADDR force_core_addr_align;=0A= - void *force_pointer_align;=0A= - } aligner;=0A= - /* Do not add any new members here -- contents above will trash=0A= - them. */=0A= -};=0A= -=0A= /* Prototypes for local functions. */=0A= =20=0A= static void show_values (char *, int);=0A= Index: gdb/value.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/value.h (revision 4)=0A= +++ gdb/value.h (working copy)=0A= @@ -554,4 +554,140 @@=0A= =20=0A= extern struct value *value_of_local (const char *name, int complain);=0A= =20=0A= +struct value=0A= +{=0A= + /* Type of value; either not an lval, or one of the various=0A= + different possible kinds of lval. */=0A= + enum lval_type lval;=0A= +=0A= + /* Is it modifiable? Only relevant if lval !=3D not_lval. */=0A= + int modifiable;=0A= +=0A= + /* Location of value (if lval). */=0A= + union=0A= + {=0A= + /* If lval =3D=3D lval_memory, this is the address in the inferior.=0A= + If lval =3D=3D lval_register, this is the byte offset into the=0A= + registers structure. */=0A= + CORE_ADDR address;=0A= +=0A= + /* Pointer to internal variable. */=0A= + struct internalvar *internalvar;=0A= + } location;=0A= +=0A= + /* Describes offset of a value within lval of a structure in bytes.=0A= + If lval =3D=3D lval_memory, this is an offset to the address. If=0A= + lval =3D=3D lval_register, this is a further offset from=0A= + location.address within the registers structure. Note also the=0A= + member embedded_offset below. */=0A= + int offset;=0A= +=0A= + /* Only used for bitfields; number of bits contained in them. */=0A= + int bitsize;=0A= +=0A= + /* Only used for bitfields; position of start of field. For=0A= + gdbarch_bits_big_endian=3D0 targets, it is the position of the LSB. = For=0A= + gdbarch_bits_big_endian=3D1 targets, it is the position of the MSB. *= /=0A= + int bitpos;=0A= +=0A= + /* Frame register value is relative to. This will be described in=0A= + the lval enum above as "lval_register". */=0A= + struct frame_id frame_id;=0A= +=0A= + /* Type of the value. */=0A= + struct type *type;=0A= +=0A= + /* If a value represents a C++ object, then the `type' field gives=0A= + the object's compile-time type. If the object actually belongs=0A= + to some class derived from `type', perhaps with other base=0A= + classes and additional members, then `type' is just a subobject=0A= + of the real thing, and the full object is probably larger than=0A= + `type' would suggest.=0A= +=0A= + If `type' is a dynamic class (i.e. one with a vtable), then GDB=0A= + can actually determine the object's run-time type by looking at=0A= + the run-time type information in the vtable. When this=0A= + information is available, we may elect to read in the entire=0A= + object, for several reasons:=0A= +=0A= + - When printing the value, the user would probably rather see the=0A= + full object, not just the limited portion apparent from the=0A= + compile-time type.=0A= +=0A= + - If `type' has virtual base classes, then even printing `type'=0A= + alone may require reaching outside the `type' portion of the=0A= + object to wherever the virtual base class has been stored.=0A= +=0A= + When we store the entire object, `enclosing_type' is the run-time=0A= + type -- the complete object -- and `embedded_offset' is the=0A= + offset of `type' within that larger type, in bytes. The=0A= + value_contents() macro takes `embedded_offset' into account, so=0A= + most GDB code continues to see the `type' portion of the value,=0A= + just as the inferior would.=0A= +=0A= + If `type' is a pointer to an object, then `enclosing_type' is a=0A= + pointer to the object's run-time type, and `pointed_to_offset' is=0A= + the offset in bytes from the full object to the pointed-to object=0A= + -- that is, the value `embedded_offset' would have if we followed=0A= + the pointer and fetched the complete object. (I don't really see=0A= + the point. Why not just determine the run-time type when you=0A= + indirect, and avoid the special case? The contents don't matter=0A= + until you indirect anyway.)=0A= +=0A= + If we're not doing anything fancy, `enclosing_type' is equal to=0A= + `type', and `embedded_offset' is zero, so everything works=0A= + normally. */=0A= + struct type *enclosing_type;=0A= + int embedded_offset;=0A= + int pointed_to_offset;=0A= +=0A= + /* Values are stored in a chain, so that they can be deleted easily=0A= + over calls to the inferior. Values assigned to internal=0A= + variables or put into the value history are taken off this=0A= + list. */=0A= + struct value *next;=0A= +=0A= + /* Register number if the value is from a register. */=0A= + short regnum;=0A= +=0A= + /* If zero, contents of this value are in the contents field. If=0A= + nonzero, contents are in inferior memory at address in the=0A= + location.address field plus the offset field (and the lval field=0A= + should be lval_memory).=0A= +=0A= + WARNING: This field is used by the code which handles watchpoints=0A= + (see breakpoint.c) to decide whether a particular value can be=0A= + watched by hardware watchpoints. If the lazy flag is set for=0A= + some member of a value chain, it is assumed that this member of=0A= + the chain doesn't need to be watched as part of watching the=0A= + value itself. This is how GDB avoids watching the entire struct=0A= + or array when the user wants to watch a single struct member or=0A= + array element. If you ever change the way lazy flag is set and=0A= + reset, be sure to consider this use as well! */=0A= + char lazy;=0A= +=0A= + /* If nonzero, this is the value of a variable which does not=0A= + actually exist in the program. */=0A= + char optimized_out;=0A= +=0A= + /* If value is a variable, is it initialized or not. */=0A= + int initialized;=0A= +=0A= + /* Actual contents of the value. For use of this value; setting it=0A= + uses the stuff above. Not valid if lazy is nonzero. Target=0A= + byte-order. We force it to be aligned properly for any possible=0A= + value. Note that a value therefore extends beyond what is=0A= + declared here. */=0A= + union=0A= + {=0A= + gdb_byte contents[1];=0A= + DOUBLEST force_doublest_align;=0A= + LONGEST force_longest_align;=0A= + CORE_ADDR force_core_addr_align;=0A= + void *force_pointer_align;=0A= + } aligner;=0A= + /* Do not add any new members here -- contents above will trash=0A= + them. */=0A= +};=0A= +=0A= #endif /* !defined (VALUE_H) */=0A= Index: gdb/infcall.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/infcall.c (revision 4)=0A= +++ gdb/infcall.c (working copy)=0A= @@ -283,7 +283,7 @@=0A= sp =3D gdbarch_frame_align (gdbarch, sp);=0A= /* Allocate space for, and then position the breakpoint on the=0A= stack. */=0A= - if (gdbarch_inner_than (gdbarch, 1, 2))=0A= + if (gdbarch_inner_than (gdbarch, 1, 2, 0, 0))=0A= {=0A= CORE_ADDR bppc =3D sp;=0A= gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen);=0A= @@ -407,7 +407,7 @@=0A= address. AMD64 called that region the "red zone". Skip at=0A= least the "red zone" size before allocating any space on=0A= the stack. */=0A= - if (gdbarch_inner_than (gdbarch, 1, 2))=0A= + if (gdbarch_inner_than (gdbarch, 1, 2, 0, 0))=0A= sp -=3D gdbarch_frame_red_zone_size (gdbarch);=0A= else=0A= sp +=3D gdbarch_frame_red_zone_size (gdbarch);=0A= @@ -435,16 +435,16 @@=0A= to pay :-). */=0A= if (sp =3D=3D old_sp)=0A= {=0A= - if (gdbarch_inner_than (gdbarch, 1, 2))=0A= + if (gdbarch_inner_than (gdbarch, 1, 2, 0, 0))=0A= /* Stack grows down. */=0A= sp =3D gdbarch_frame_align (gdbarch, old_sp - 1);=0A= else=0A= /* Stack grows up. */=0A= sp =3D gdbarch_frame_align (gdbarch, old_sp + 1);=0A= }=0A= - gdb_assert ((gdbarch_inner_than (gdbarch, 1, 2)=0A= + gdb_assert ((gdbarch_inner_than (gdbarch, 1, 2, 0, 0)=0A= && sp <=3D old_sp)=0A= - || (gdbarch_inner_than (gdbarch, 2, 1)=0A= + || (gdbarch_inner_than (gdbarch, 2, 1, 0, 0)=0A= && sp >=3D old_sp));=0A= }=0A= else=0A= @@ -505,7 +505,7 @@=0A= case ON_STACK:=0A= /* "dummy_addr" is here just to keep old targets happy. New=0A= targets return that same information via "sp" and "bp_addr". */=0A= - if (gdbarch_inner_than (gdbarch, 1, 2))=0A= + if (gdbarch_inner_than (gdbarch, 1, 2, 0, 0))=0A= {=0A= sp =3D push_dummy_code (gdbarch, sp, funaddr,=0A= args, nargs, target_values_type,=0A= @@ -598,7 +598,7 @@=0A= if (struct_return || lang_struct_return)=0A= {=0A= int len =3D TYPE_LENGTH (values_type);=0A= - if (gdbarch_inner_than (gdbarch, 1, 2))=0A= + if (gdbarch_inner_than (gdbarch, 1, 2, 0, 0))=0A= {=0A= /* Stack grows downward. Align STRUCT_ADDR and SP after=0A= making space for the return value. */=0A= Index: gdb/gdbarch.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/gdbarch.c (revision 4)=0A= +++ gdb/gdbarch.c (working copy)=0A= @@ -542,8 +542,7 @@=0A= /* Skip verify of return_value, has predicate */=0A= if (gdbarch->skip_prologue =3D=3D 0)=0A= fprintf_unfiltered (log, "\n\tskip_prologue");=0A= - if (gdbarch->inner_than =3D=3D 0)=0A= - fprintf_unfiltered (log, "\n\tinner_than");=0A= + /* Skip verify of inner_than */=0A= if (gdbarch->breakpoint_from_pc =3D=3D 0)=0A= fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");=0A= /* Skip verify of adjust_breakpoint_address, has predicate */=0A= @@ -781,6 +780,10 @@=0A= "gdbarch_dump: in_solib_return_trampoline =3D <0x%lx= >\n",=0A= (long) gdbarch->in_solib_return_trampoline);=0A= fprintf_unfiltered (file,=0A= + "gdbarch_dump: %s # %s\n",=0A= + "INNER_THAN(lhs, rhs)",=0A= + XSTRING (INNER_THAN (lhs, rhs, 0, 0)));=0A= + fprintf_unfiltered (file,=0A= "gdbarch_dump: inner_than =3D <0x%lx>\n",=0A= (long) gdbarch->inner_than);=0A= fprintf_unfiltered (file,=0A= @@ -2075,13 +2078,14 @@=0A= }=0A= =20=0A= int=0A= -gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)= =0A= +gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhsf, CORE_ADDR rhs= f,=0A= + CORE_ADDR lhsc, CORE_ADDR rhsc)=0A= {=0A= gdb_assert (gdbarch !=3D NULL);=0A= gdb_assert (gdbarch->inner_than !=3D NULL);=0A= if (gdbarch_debug >=3D 2)=0A= fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");=0A= - return gdbarch->inner_than (lhs, rhs);=0A= + return gdbarch->inner_than (lhsf, rhsf, lhsc, rhsc);=0A= }=0A= =20=0A= void=0A= Index: gdb/gdbarch.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/gdbarch.h (revision 4)=0A= +++ gdb/gdbarch.h (working copy)=0A= @@ -374,8 +374,10 @@=0A= extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR= ip);=0A= extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_sk= ip_prologue_ftype *skip_prologue);=0A= =20=0A= -typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs);=0A= -extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, COR= E_ADDR rhs);=0A= +typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhsf, CORE_ADDR rhsf,=0A= + CORE_ADDR lhsc, CORE_ADDR rhsc);=0A= +extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhsf,=0A= + CORE_ADDR rhsf, CORE_ADDR lhsc, CORE_ADDR rhsc);=0A= extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner= _than_ftype *inner_than);=0A= =20=0A= typedef const gdb_byte * (gdbarch_breakpoint_from_pc_ftype) (struct gdbarc= h *gdbarch, CORE_ADDR *pcptr, int *lenptr);=0A= Index: gdb/amd64-linux-tdep.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/amd64-linux-tdep.c (revision 4)=0A= +++ gdb/amd64-linux-tdep.c (working copy)=0A= @@ -3,6 +3,7 @@=0A= Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008=0A= Free Software Foundation, Inc.=0A= Contributed by Jiri Smid, SuSE Labs.=0A= + Copyright 2004 LinSysSoft Technologies Pvt. Ltd.=0A= =20=0A= This file is part of GDB.=0A= =20=0A= @@ -288,6 +289,23 @@=0A= set_gdbarch_fetch_tls_load_module_address (gdbarch,=0A= svr4_fetch_objfile_link_map);= =0A= }=0A= +=0A= +static void=0A= +amd64_linux_kernel_init_abi (struct gdbarch_info info, struct gdbarch *gdb= arch)=0A= +{=0A= + struct gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch);=0A= +=0A= + /* We can use the register offsets used for linux applications. Only=0A= + * first 18 elements of the array will be used for kernel. Offsets of th= ose=0A= + * are identical for applications and kernel. */=0A= + tdep->gregset_reg_offset =3D amd64_linux_gregset_reg_offset;=0A= + tdep->gregset_num_regs =3D AMD64_NUM_GREGS;=0A= + tdep->sizeof_gregset =3D AMD64_NUM_GREGS * 8;=0A= +=0A= + amd64_init_abi (info, gdbarch);=0A= +=0A= +}=0A= +=0A= =0C=0A= =20=0A= /* Provide a prototype to silence -Wmissing-prototypes. */=0A= @@ -298,4 +316,6 @@=0A= {=0A= gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,=0A= GDB_OSABI_LINUX, amd64_linux_init_abi);=0A= + gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,=0A= + GDB_OSABI_LINUX_KERNEL, amd64_linux_kernel_init_abi);=0A= }=0A= Index: gdb/symfile.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/symfile.c (revision 4)=0A= +++ gdb/symfile.c (working copy)=0A= @@ -971,6 +971,10 @@=0A= void=0A= new_symfile_objfile (struct objfile *objfile, int mainline, int verbo)=0A= {=0A= + char *filename;=0A= + struct symbol *sym;=0A= + char *dir;=0A= + extern int debugkernel;=0A= =20=0A= /* If this is the main symbol file we have to clean up all users of the= =0A= old main symbol file. Otherwise it is sufficient to fixup all the=0A= @@ -980,6 +984,17 @@=0A= /* OK, make it the "real" symbol file. */=0A= symfile_objfile =3D objfile;=0A= =20=0A= + debugkernel =3D 0;=0A= + filename =3D symfile_objfile->name;=0A= + while ((dir =3D strchr(filename, '/')) !=3D NULL)=0A= + filename =3D dir + 1;=0A= + /* only require the given characters to match, so that longer filena= mes will still match */=0A= + if (!strncmp(filename, LINUX_KERNEL_NAME_STEM, strlen(LINUX_KERNEL_N= AME_STEM)))=0A= + {=0A= + sym =3D lookup_symbol ("start_kernel", NULL, VAR_DOMAIN, NULL, N= ULL);=0A= + if (sym)=0A= + debugkernel =3D 1;=0A= + }=0A= clear_symtab_users ();=0A= }=0A= else=0A= Index: gdb/solib.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/solib.c (revision 4)=0A= +++ gdb/solib.c (working copy)=0A= @@ -44,6 +44,7 @@=0A= #include "solist.h"=0A= #include "observer.h"=0A= #include "readline/readline.h"=0A= +#include =0A= =20=0A= /* Architecture-specific operations. */=0A= =20=0A= @@ -78,6 +79,7 @@=0A= =0C=0A= =20=0A= /* external data declarations */=0A= +extern int debugkernel;=0A= =20=0A= /* FIXME: gdbarch needs to control this variable, or else every=0A= configuration needs to call set_solib_ops. */=0A= @@ -102,6 +104,172 @@=0A= value);=0A= }=0A= =20=0A= +/* Return True if the file NAME exists and is a regular file */=0A= +static int=0A= +is_regular_file (const char *name)=0A= +{=0A= + struct stat st;=0A= + const int status =3D stat (name, &st);=0A= +=0A= + /* Stat should never fail except when the file does not exist.=0A= + If stat fails, analyze the source of error and return True=0A= + unless the file does not exist, to avoid returning false results=0A= + on obscure systems where stat does not work as expected.=0A= + */=0A= + if (status !=3D 0)=0A= + return (errno !=3D ENOENT);=0A= +=0A= + return S_ISREG (st.st_mode);=0A= +}=0A= +=0A= +/* Open a file named STRING, searching path PATH (dir names sep by some ch= ar)=0A= + using mode MODE and protection bits PROT in the calls to open.=0A= +=0A= + If TRY_CWD_FIRST, try to open ./STRING before searching PATH.=0A= + (ie pretend the first element of PATH is "."). This also indicates=0A= + that a slash in STRING disables searching of the path (this is=0A= + so that "exec-file ./foo" or "symbol-file ./foo" insures that you=0A= + get that particular version of foo or an error message).=0A= +=0A= + If FILENAME_OPENED is non-null, set it to a newly allocated string nami= ng=0A= + the actual file opened (this string will always start with a "/"). We= =0A= + have to take special pains to avoid doubling the "/" between the direct= ory=0A= + and the file, sigh! Emacs gets confuzzed by this when we print the=0A= + source file name!!!=20=0A= +=0A= + If a file is found, return the descriptor.=0A= + Otherwise, return -1, with errno set for the last name we tried to open= . */=0A= +=0A= +/* >>>> This should only allow files of certain types,=0A= + >>>> eg executable, non-directory */=0A= +static int=0A= +module_openp (const char *path, int try_cwd_first, const char *string,=0A= + int mode, int prot,=0A= + char **filename_opened)=0A= +{=0A= + register int fd;=0A= + register char *filename;=0A= + const char *p;=0A= + const char *p1;=0A= + register int len;=0A= + int alloclen;=0A= + int uscount;=0A= + const char *fnptr;=0A= + char *fnptr2;=0A= + glob_t globbuf;=0A= +=0A= + if (!path)=0A= + path =3D ".";=0A= +=0A= +#if defined(_WIN32) || defined(__CYGWIN__)=0A= + mode |=3D O_BINARY;=0A= +#endif=0A= +=0A= + /* ./foo =3D> foo */=0A= + while (string[0] =3D=3D '.' && IS_DIR_SEPARATOR (string[1]))=0A= + string +=3D 2;=0A= +=0A= + for (uscount =3D 0, fnptr =3D string; *fnptr; fnptr++)=0A= + if(*fnptr=3D=3D '_')=0A= + uscount++;=0A= + alloclen =3D strlen (path) + strlen (string) + 2 + uscount * 4;=0A= + filename =3D alloca (alloclen);=0A= + fd =3D -1;=0A= + for (p =3D path; p; p =3D p1 ? p1 + 1 : 0)=0A= + {=0A= + p1 =3D strchr (p, DIRNAME_SEPARATOR);=0A= + if (p1)=0A= + len =3D p1 - p;=0A= + else=0A= + len =3D strlen (p);=0A= +=0A= + if (len =3D=3D 4 && p[0] =3D=3D '$' && p[1] =3D=3D 'c'=0A= + && p[2] =3D=3D 'w' && p[3] =3D=3D 'd')=0A= + {=0A= + /* Name is $cwd -- insert current directory name instead. */=0A= + int newlen;=0A= +=0A= + /* First, realloc the filename buffer if too short. */=0A= + len =3D strlen (current_directory);=0A= + newlen =3D len + strlen (string) + 2;=0A= + if (newlen > alloclen)=0A= + {=0A= + alloclen =3D newlen;=0A= + filename =3D alloca (alloclen);=0A= + }=0A= + strcpy (filename, current_directory);=0A= + }=0A= + else=0A= + {=0A= + /* Normal file name in path -- just use it. */=0A= + strncpy (filename, p, len);=0A= + filename[len] =3D 0;=0A= + }=0A= +=0A= + /* Remove trailing slashes */=0A= + while (len > 0 && IS_DIR_SEPARATOR (filename[len - 1]))=0A= + filename[--len] =3D 0;=0A= +=0A= + strcat (filename + len, SLASH_STRING);=0A= + fnptr2 =3D filename + strlen(filename);=0A= + for (uscount =3D 0, fnptr =3D string; ;fnptr++)=0A= + {=0A= + if(*fnptr=3D=3D '_')=0A= + {=0A= + *(fnptr2++) =3D '[';=0A= + *(fnptr2++) =3D '_';=0A= + *(fnptr2++) =3D '-';=0A= + *(fnptr2++) =3D ']';=0A= + }=0A= + else=0A= + {=0A= + *(fnptr2++) =3D *fnptr;=0A= + if (!*fnptr)=0A= + break;=0A= + }=0A= + }=0A= + globbuf.gl_offs =3D 0;=0A= + glob(filename, GLOB_DOOFFS, NULL, &globbuf);=0A= + if (!globbuf.gl_pathv[0])=0A= + continue;=0A= +=0A= + strcpy(filename, globbuf.gl_pathv[0]);=0A= + if (is_regular_file (filename))=0A= + {=0A= + fd =3D open (filename, mode);=0A= + if (fd >=3D 0)=0A= + break;=0A= + }=0A= + }=0A= +=0A= + if (filename_opened)=0A= + {=0A= + /* If a file was opened, canonicalize its filename. Use xfullpath=0A= + rather than gdb_realpath to avoid resolving the basename part=0A= + of filenames when the associated file is a symbolic link. This=0A= + fixes a potential inconsistency between the filenames known to=0A= + GDB and the filenames it prints in the annotations. */=0A= + if (fd < 0)=0A= + *filename_opened =3D NULL;=0A= + else if (IS_ABSOLUTE_PATH (filename))=0A= + *filename_opened =3D xfullpath (filename);=0A= + else=0A= + {=0A= + /* Beware the // my son, the Emacs barfs, the botch that catch... */=0A= +=0A= + char *f =3D concat (current_directory,=0A= + IS_DIR_SEPARATOR (current_directory[strlen (current_directory) = - 1])=0A= + ? "" : SLASH_STRING,=0A= + filename, NULL);=0A= + *filename_opened =3D xfullpath (f);=0A= + xfree (f);=0A= + }=0A= + }=0A= +=0A= + return fd;=0A= +}=0A= +=0A= +=0A= /*=0A= =20=0A= GLOBAL FUNCTION=0A= @@ -201,6 +369,12 @@=0A= if (found_file < 0 && solib_search_path !=3D NULL)=0A= found_file =3D openp (solib_search_path, OPF_TRY_CWD_FIRST,=0A= in_pathname, O_RDONLY | O_BINARY, 0, &temp_pathname);=0A= +=20=0A= + /* If not found and debugging a kernel, try _ and - changes */=0A= + if (found_file < 0 && solib_search_path !=3D NULL && debugkernel) {=0A= + found_file =3D module_openp(solib_search_path,=0A= + 1, in_pathname, O_RDONLY, 0, &temp_pathname);=0A= + }=0A= =20=20=20=0A= /* If not found, next search the solib_search_path (if any) for the base= name=0A= only (ignoring the path). This is to allow reading solibs from a pat= h=0A= @@ -419,7 +593,7 @@=0A= so->sections_end);=0A= =20=0A= so->objfile =3D symbol_file_add (so->so_name, so->from_tty,=0A= - sap, 0, OBJF_SHARED);=0A= + sap, 0, OBJF_SHARED | (debugkernel ? OBJF_READNOW : 0));=0A= free_section_addr_info (sap);=0A= =20=0A= return (1);=0A= @@ -625,6 +799,7 @@=0A= /* Notify any observer that the shared object has been=0A= loaded now that we've added it to GDB's tables. */=0A= observer_notify_solib_loaded (i);=0A= + solib_read_symbols (i, from_tty);=20=0A= }=0A= }=0A= }=0A= Index: gdb/i386-linux-tdep.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/i386-linux-tdep.c (revision 4)=0A= +++ gdb/i386-linux-tdep.c (working copy)=0A= @@ -2,6 +2,7 @@=0A= =20=0A= Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008=0A= Free Software Foundation, Inc.=0A= + Copyright 2004 LinSysSoft Technologies Pvt. Ltd.=0A= =20=0A= This file is part of GDB.=0A= =20=0A= @@ -28,12 +29,15 @@=0A= #include "reggroups.h"=0A= #include "dwarf2-frame.h"=0A= #include "gdb_string.h"=0A= +#include "elf-bfd.h"=0A= =20=0A= #include "i386-tdep.h"=0A= #include "i386-linux-tdep.h"=0A= #include "glibc-tdep.h"=0A= #include "solib-svr4.h"=0A= #include "symtab.h"=0A= +#include "arch-utils.h"=0A= +#include "gdbarch.h"=0A= =20=0A= /* Return the name of register REG. */=0A= =20=0A= @@ -402,6 +406,39 @@=0A= 0 * 4 /* %gs */=0A= };=0A= =20=0A= +int i386_inner_than (CORE_ADDR lhsf, CORE_ADDR rhsf, CORE_ADDR lhsc,=0A= + CORE_ADDR rhsc)=0A= +{=0A= + /* Read code at rhsc, if it contains a stack switch instruction, return= =0A= + * true. We check for 4 instructions.=0A= + * 89C4 mov eax, esp=0A= + * 89DC mov ebx, esp=0A= + * 89CC mov ecx, esp=0A= + * 89D4 mov edx, esp=0A= + * 94 xchg eax, esp=0A= + * 87DC xchg ebx, esp=0A= + * 87CC xchg ecx, esp=0A= + * 87D4 xchg edx, esp=0A= + */=0A= + unsigned short twobyte_insns[] =3D { 0x89c4, 0x89dc, 0x89cc, 0x89d4, 0x8= 7dc,=0A= + 0x87dc, 0x87cc, 0x87d4 };=0A= + unsigned char onebyte_insns[] =3D { 0x94 };=0A= + unsigned short tmp;=0A= + int i;=0A= +=0A= + if (rhsc &&=0A= + target_read_memory(rhsc, (gdb_byte *)&tmp, sizeof(unsigned short)) = =3D=3D 0)=0A= + {=0A= + for (i =3D 0; i < sizeof(onebyte_insns); i++)=0A= + if (onebyte_insns[i] =3D=3D (unsigned char)tmp)=0A= + return 0;=0A= + for (i =3D 0; i < sizeof(twobyte_insns); i++)=0A= + if (twobyte_insns[i] =3D=3D tmp)=0A= + return 0;=0A= + }=0A= + return core_addr_lessthan(lhsf, rhsf, lhsc, rhsc);=0A= +}=0A= +=0A= static void=0A= i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)=0A= {=0A= @@ -446,8 +483,32 @@=0A= /* Enable TLS support. */=0A= set_gdbarch_fetch_tls_load_module_address (gdbarch,=0A= svr4_fetch_objfile_link_map);= =0A= +=0A= + /* Stack grows downward. */=0A= + set_gdbarch_inner_than (gdbarch, i386_inner_than);=0A= }=0A= =20=0A= +static void=0A= +i386_linux_kernel_init_abi (struct gdbarch_info info, struct gdbarch *gdba= rch)=0A= +{=0A= + struct gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch);=0A= +=0A= + /* Linux Kernel uses ELF format for vmlinux file. */=0A= + i386_elf_init_abi (info, gdbarch);=0A= +=0A= + /* We can use the register offsets used for linux applications. Only=0A= + * first 16 elements of the array will be used for kernel. Offsets of th= ose=0A= + * are identical for applications and kernel. */=0A= + tdep->gregset_reg_offset =3D i386_linux_gregset_reg_offset;=0A= + tdep->gregset_num_regs =3D I386_NUM_GREGS;=0A= + tdep->sizeof_gregset =3D I386_NUM_GREGS * 4;=0A= +=0A= + tdep->jb_pc_offset =3D 20; /* From . */=0A= +=0A= + /* Stack grows downward. */=0A= + set_gdbarch_inner_than (gdbarch, i386_inner_than);=0A= +}=0A= +=0A= /* Provide a prototype to silence -Wmissing-prototypes. */=0A= extern void _initialize_i386_linux_tdep (void);=0A= =20=0A= @@ -456,4 +517,7 @@=0A= {=0A= gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_LINUX,=0A= i386_linux_init_abi);=0A= + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_LINUX_KERNEL,=0A= + i386_linux_kernel_init_abi);=0A= +=0A= }=0A= Index: gdb/frame.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/frame.c (revision 4)=0A= +++ gdb/frame.c (working copy)=0A= @@ -380,7 +380,8 @@=0A= comment in "frame.h", there is some fuzz here. Frameless=0A= functions are not strictly inner than (same .stack but=0A= different .code and/or .special address). */=0A= - inner =3D gdbarch_inner_than (gdbarch, l.stack_addr, r.stack_addr);=0A= + inner =3D gdbarch_inner_than (gdbarch, l.stack_addr, r.stack_addr,=0A= + l.code_addr, r.code_addr);=0A= if (frame_debug)=0A= {=0A= fprintf_unfiltered (gdb_stdlog, "{ frame_id_inner (l=3D");=0A= Index: gdb/arch-utils.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/arch-utils.c (revision 4)=0A= +++ gdb/arch-utils.c (working copy)=0A= @@ -80,9 +80,10 @@=0A= /* Helper functions for gdbarch_inner_than */=0A= =20=0A= int=0A= -core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs)=0A= +core_addr_lessthan (CORE_ADDR lhsf, CORE_ADDR rhsf, CORE_ADDR lhsc,=0A= + CORE_ADDR rhsc)=0A= {=0A= - return (lhs < rhs);=0A= + return (lhsf < rhsf);=0A= }=0A= =20=0A= int=0A= Index: gdb/arch-utils.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/arch-utils.h (revision 4)=0A= +++ gdb/arch-utils.h (working copy)=0A= @@ -31,7 +31,8 @@=0A= extern int gdbarch_debug;=0A= =20=0A= /* The only possible cases for inner_than. */=0A= -extern int core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs);=0A= +extern int core_addr_lessthan (CORE_ADDR lhsf, CORE_ADDR rhsf,=0A= + CORE_ADDR lhsc, CORE_ADDR rhsc);=0A= extern int core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs);=0A= =20=0A= /* Identity functions on a CORE_ADDR. Just return the "addr". */=0A= Index: gdb/osabi.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/osabi.c (revision 4)=0A= +++ gdb/osabi.c (working copy)=0A= @@ -56,6 +56,7 @@=0A= "Solaris",=0A= "OSF/1",=0A= "GNU/Linux",=0A= + "Linux-kernel",=0A= "FreeBSD a.out",=0A= "FreeBSD ELF",=0A= "NetBSD a.out",=0A= Index: gdb/gcore.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/gcore.c (revision 4)=0A= +++ gdb/gcore.c (working copy)=0A= @@ -184,7 +184,8 @@=0A= /* Save frame pointer of TOS frame. */=0A= *top =3D get_frame_base (fi);=0A= /* If current stack pointer is more "inner", use that instead. */=0A= - if (gdbarch_inner_than (get_frame_arch (fi), get_frame_sp (fi), *top))= =0A= + if (gdbarch_inner_than (get_frame_arch (fi), get_frame_sp (fi),=0A= + *top, (CORE_ADDR)NULL, (CORE_ADDR)NULL))=0A= *top =3D get_frame_sp (fi);=0A= =20=0A= /* Find prev-most frame. */=0A= Index: gdb/defs.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- gdb/defs.h (revision 4)=0A= +++ gdb/defs.h (working copy)=0A= @@ -918,6 +918,7 @@=0A= GDB_OSABI_SOLARIS,=0A= GDB_OSABI_OSF1,=0A= GDB_OSABI_LINUX,=0A= + GDB_OSABI_LINUX_KERNEL,=0A= GDB_OSABI_FREEBSD_AOUT,=0A= GDB_OSABI_FREEBSD_ELF,=0A= GDB_OSABI_NETBSD_AOUT,=0A= @@ -1182,6 +1183,7 @@=0A= =20=0A= extern ULONGEST align_up (ULONGEST v, int n);=0A= extern ULONGEST align_down (ULONGEST v, int n);=0A= +#define LINUX_KERNEL_NAME_STEM "vmlinux"=0A= =20=0A= /* Allocation and deallocation functions for the libiberty hash table=0A= which use obstacks. */=0A= ------=_NextPart_000_0196_01C9722F.06B319C0--