From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23884 invoked by alias); 22 Oct 2012 22:01:52 -0000 Received: (qmail 23836 invoked by uid 22791); 22 Oct 2012 22:01:52 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_BD,TW_CF,TW_LR,TW_SR X-Spam-Check-By: sourceware.org Received: from mail-oa0-f41.google.com (HELO mail-oa0-f41.google.com) (209.85.219.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Oct 2012 22:01:47 +0000 Received: by mail-oa0-f41.google.com with SMTP id k14so3453820oag.0 for ; Mon, 22 Oct 2012 15:01:46 -0700 (PDT) Received: by 10.182.172.74 with SMTP id ba10mr8311568obc.83.1350943305999; Mon, 22 Oct 2012 15:01:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.69.39 with HTTP; Mon, 22 Oct 2012 15:01:25 -0700 (PDT) In-Reply-To: <87pq4agr0t.fsf@fleche.redhat.com> References: <508486C7.4080505@gmail.com> <87pq4agr0t.fsf@fleche.redhat.com> From: Bruce Korb Date: Mon, 22 Oct 2012 22:01:00 -0000 Message-ID: Subject: Re: custom runtime GDB extensions To: Tom Tromey Cc: Abhijit Halder , gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 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: 2012-10/txt/msg00093.txt.bz2 Hi Tom, Thank you. On Mon, Oct 22, 2012 at 2:01 PM, Tom Tromey wrote: >>>>>> "Bruce" == Bruce Korb writes: > > Bruce> I don't know exactly why the dlopen of shared objects is > Bruce> disparaged, because I couldn't find references via Googling. > > I think the fundamental reason is that we don't want to keep C API > compatibility in gdb. > > There's the JIT API, of course, but it is intentionally very limited. Perhaps that is the ticket. I don't really want access to lots of internals, my goal is to be able to call a dynamically loaded function that can print some information about the arguments passed in, as exampled below. If the "JIT API" is up to that task, then I don't need anything grander. I searched backward from dlopen to functions that used it and didn't trace my way to anything I could figure out how to use. (gdb) plugin add ~/work/GIT/flag-project/mask-disp.so (gdb) mask The following mask types are supported: at-flag cfg-flag config-flag ldd-flag ldlm-cancel-flag ldlm-flag ll-file-flag llog-ctxt-flag llog-flag llog-misc-flag lmd-flag obd-connect-flag obd-flag obd-incompat-flag obd-llog-flag os-state-flag ptlrpc-reply-flag ptlrpc-sec-flag (gdb) mask obd-flag all 0xF03FFF7F represents: inlinedata obdmdexists delorphan norpc idonly recreate_objs debug_check no_usrquota no_grpquota create_crow srvlock cksum_crc32 cksum_adler cksum_crc32c cksum_rsvd2 cksum_rsvd3 shrink_grant mmap recov_resend nospc_blk short_io local-1 local-2 local-3 local-4 (gdb) mask obd-flag srvlock short_io obdmdexists 0x200802 represents: obdmdexists srvlock short_io (gdb) mask obd-flag 0707 0x147 represents: inlinedata obdmdexists delorphan debug_check no_usrquota