From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3087 invoked by alias); 22 Feb 2010 15:39:53 -0000 Received: (qmail 3069 invoked by uid 22791); 22 Feb 2010 15:39:52 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40 X-Spam-Check-By: sourceware.org Received: from mail-ew0-f223.google.com (HELO mail-ew0-f223.google.com) (209.85.219.223) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Feb 2010 15:39:49 +0000 Received: by ewy23 with SMTP id 23so2986588ewy.4 for ; Mon, 22 Feb 2010 07:39:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.91.16 with SMTP id g16mr2690066wef.102.1266853186292; Mon, 22 Feb 2010 07:39:46 -0800 (PST) In-Reply-To: <20100222152955.GB30100@caradoc.them.org> References: <20100210200303.GA19632@lucon.org> <20100218054312.GA9022@lucon.org> <20100218153402.GA27929@lucon.org> <20100218230135.GA17916@intel.com> <201002221342.o1MDgSZA029705@glazunov.sibelius.xs4all.nl> <6dc9ffc81002220617o1d348e68hc918d434118cadcb@mail.gmail.com> <201002221501.o1MF1Qrq024363@glazunov.sibelius.xs4all.nl> <6dc9ffc81002220727k50e97d86waac51e92f5e3315@mail.gmail.com> <20100222152955.GB30100@caradoc.them.org> Date: Mon, 22 Feb 2010 15:39:00 -0000 Message-ID: <6dc9ffc81002220739q5b6e082ev452d07b80a5df169@mail.gmail.com> Subject: Re: PATCH: Enable x86 XML target descriptions From: "H.J. Lu" To: "H.J. Lu" , Mark Kettenis , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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: 2010-02/txt/msg00538.txt.bz2 On Mon, Feb 22, 2010 at 7:29 AM, Daniel Jacobowitz w= rote: > On Mon, Feb 22, 2010 at 07:27:30AM -0800, H.J. Lu wrote: >> It works fine. amd64_linux_read_description is called via > > Does it work fine for the right reason? =A0gdbarch has not been set yet. > How can the gdbarch know if the PID is a 32-bit or 64-bit process? > From (gdb) att 20196 Attaching to process 20196 Reading symbols from /export/home/hjl/bugs/gdb/xml/p...done. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Detaching after fork from child process 20207. Breakpoint 3, amd64_linux_read_description (ops=3D0xa94900) at /export/gnu/import/git/gdb-avx/gdb/amd64-linux-nat.c:681 681 { Missing separate debuginfos, use: debuginfo-install expat-2.0.1-8.fc12.x86_64 ncurses-libs-5.7-3.20090207.fc12.x86_64 python-2.6.2-2.fc12.x86_64 python-libs-2.6.2-2.fc12.x86_64 zlib-1.2.3-23.fc12.x86_64 (top-gdb) p target_gdbarch $1 =3D (struct gdbarch *) 0xbb3660 (top-gdb) p *target_gdbarch $2 =3D {initialized_p =3D 1, obstack =3D 0xbb35f0, bfd_arch_info =3D 0x7bd0= a0, byte_order =3D 1, byte_order_for_code =3D 1, osabi =3D GDB_OSABI_LINUX, target_desc =3D 0x0, tdep =3D 0xbb3500, dump_tdep =3D 0, nr_data =3D 18, data =3D 0xbb3a30, swap =3D 0x0, bits_big_endian =3D 0, short_bit =3D 16, int_bit =3D 32, long_bit =3D 32, long_long_bit =3D 64, float_bit =3D 32, float_format =3D 0xa4e6e0, double_bit =3D 64, double_format =3D 0xa4e6f0, long_double_bit =3D 96, long_double_format =3D 0xa4e710, ptr_bit =3D 32, addr_bit =3D 32, char_signed =3D 1, read_pc =3D 0, write_pc =3D 0x4758b0 , virtual_frame_pointer =3D 0x5418a0 , pseudo_register_read =3D 0x46c1d0 , pseudo_register_write =3D 0x46c110 , num_regs =3D 42, num_pseudo_regs =3D 8, sp_regnum =3D 4, pc_regnum =3D 8, ps_regnum =3D 9, fp0_regnum =3D 16, stab_reg_to_regnum =3D 0x46aef0 , ecoff_reg_to_regnum =3D 0x540a60 , sdb_reg_to_regnum =3D 0x46ae40 , dwarf2_reg_to_regnum =3D 0x46aef0 , register_name =3D 0x5c46f0 , register_type =3D 0x5c4df0 , dummy_id =3D 0x46b810 , deprecated_fp_regnum =3D -1, push_dummy_call =3D 0x46c6f0 , call_dummy_location = =3D 4, push_dummy_code =3D 0, ---Type to continue, or q to quit---q print_registers_info =3D 0x51dcb0 bfd_arch_info $3 =3D {bits_per_word =3D 32, bits_per_address =3D 32, bits_per_byte =3D 8, arch =3D bfd_arch_i386, mach =3D 1, arch_name =3D 0x7b3bb2 "i386", printable_name =3D 0x7b3bb2 "i386", section_align_power =3D 3, the_defaul= t =3D 1, compatible =3D 0x609fa0 , scan =3D 0x60a110 , next =3D 0x7bd100} (top-gdb) Gdb will load executable before calling amd64_linux_read_description At this point, target_gdbarch is set and knows inferior is 32bit or not. --=20 H.J.