From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23811 invoked by alias); 25 Apr 2010 15:10:33 -0000 Received: (qmail 23799 invoked by uid 22791); 25 Apr 2010 15:10:31 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=BAYES_00,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 25 Apr 2010 15:10:26 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0L1F00400U117500@a-mtaout20.012.net.il> for gdb@sourceware.org; Sun, 25 Apr 2010 18:09:20 +0300 (IDT) Received: from HOME-C4E4A596F7 ([77.124.71.78]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L1F0045RU3J8G00@a-mtaout20.012.net.il>; Sun, 25 Apr 2010 18:09:20 +0300 (IDT) Date: Sun, 25 Apr 2010 15:10:00 -0000 From: Eli Zaretskii Subject: Re: "set foo" In-reply-to: <20100425144347.GA2744@adacore.com> To: Joel Brobecker Cc: gdb@sourceware.org Reply-to: Eli Zaretskii Message-id: <83sk6jzhzv.fsf@gnu.org> References: <8339yk1skw.fsf@gnu.org> <20100424212118.GW13204@adacore.com> <83y6gbzm4e.fsf@gnu.org> <20100425144347.GA2744@adacore.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00132.txt.bz2 > Date: Sun, 25 Apr 2010 10:43:47 -0400 > From: Joel Brobecker > Cc: gdb@sourceware.org > > > So using "set foo" to make sure some symbol used by `foo' is loaded by > > GDB is a valid technique, is that right? > > I think the answer is yes - I am a little confused by "some symbol used > by `foo'" The specific use-case is that GDB does not recognize a certain struct; for example, "ptype struct foo_t" says "No struct type named foo_t". But if I type "set foo", where `foo' is a function whose code uses that struct, GDB magically recognizes the struct afterwards. > but I think I get what you are trying to ask. Basically, what > the above does, as a side effect, is make sure that the full symbols > for the unit containing `foo' get loaded. I am not sure why the person > who added it felt that they needed that The reason is probably that .gdbinit in Emacs defines several user-defined commands that need various symbols for their definition, such as the number of bits used for Lisp type tags to convert an opaque Lisp_Object into a pointer to a C struct. Thanks.