From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9305 invoked by alias); 11 Apr 2010 15:43:18 -0000 Received: (qmail 9294 invoked by uid 22791); 11 Apr 2010 15:43:18 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SARE_MSGID_LONG45 X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 11 Apr 2010 15:43:13 +0000 Received: by vws15 with SMTP id 15so1079885vws.0 for ; Sun, 11 Apr 2010 08:43:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.44.198 with HTTP; Sun, 11 Apr 2010 08:43:11 -0700 (PDT) In-Reply-To: <201004111517.48725.pedro@codesourcery.com> References: <201004110252.35997.pedro@codesourcery.com> <201004111517.48725.pedro@codesourcery.com> Date: Sun, 11 Apr 2010 15:43:00 -0000 Received: by 10.220.126.140 with SMTP id c12mr1346353vcs.170.1271000591279; Sun, 11 Apr 2010 08:43:11 -0700 (PDT) Message-ID: Subject: Re: Fix solib-disc.exp regression with x86 gdbserver From: "H.J. Lu" To: Pedro Alves Cc: 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-04/txt/msg00323.txt.bz2 On Sun, Apr 11, 2010 at 7:17 AM, Pedro Alves wrote: > On Sunday 11 April 2010 15:04:39, H.J. Lu wrote: >> How can I debug gdbserver with gdb? I tried and it didn't work. > > What doesn't work? =A0It Just Works for me: > > =A0$gdb -q --args ./gdbserver :9999 ~/gdb/tests/threads > =A0Reading symbols from /home/pedro/gdb/gdbserver_tracepoints_step_over_b= kpt_pushed/build/gdb/gdbserver/gdbserver...done. > =A0(gdb) start > =A0Temporary breakpoint 1 at 0x40f51f: file ../../../src/gdb/gdbserver/se= rver.c, line 2238. > =A0Starting program: /home/pedro/gdb/gdbserver_tracepoints_step_over_bkpt= _pushed/build/gdb/gdbserver/gdbserver :9999 /home/pedro/gdb/tests/threads > > =A0Temporary breakpoint 1, main (argc=3D4, argv=3D0x7fffffffe068) at ../.= ./../src/gdb/gdbserver/server.c:2238 > =A02238 =A0 =A0 =A0char **next_arg =3D &argv[1]; > =A0(gdb) > > > Attaching works too: > > =A0$ ./gdbserver :9999 ~/gdb/tests/threads > =A0... > > =A0$ gdb -p $(pidof gdbserver) > =A0... > > It used to be GDB would get confused due to the uses of the clone > syscall in linux-low.c, and so breakpoints wouldn't work. =A0The > easy workaround was just to comment out the linux_test_for_tracefork > call (and hardcode linux_supports_tracefork_flag as 1, to get the > same behaviour you'd get without the hack). =A0clone is only used > on uclinux/nommu, so you shouldn't need the hack anymore on linux. > > gdbserver's "--debug" command line switch is also useful (it enables > all that the internal debug output controlled by `if (debug_threads)'). > "(gdb) monitor set debug 1" has the same effect. I will git it a try next time when I run into gdbserver problems. BTW, I followed: http://sourceware.org/gdb/wiki/TestingGDB#Testing_gdbserver_in_a_native_con= figuration I couldn't get dejagnu to find the native-gdbserver board file. I had to put set gdbserve_board_dir xxxxx/gdbserver/boards lappend boards_dir $gdbserve_board_dir in my ~/.dejagnurc. --=20 H.J.