From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31504 invoked by alias); 30 Aug 2011 19:18:14 -0000 Received: (qmail 31494 invoked by uid 22791); 30 Aug 2011 19:18:13 -0000 X-SWARE-Spam-Status: No, hits=-7.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BJ X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 30 Aug 2011 19:17:52 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7UJHpqh006500 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 30 Aug 2011 15:17:51 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p7UJHp3V031271; Tue, 30 Aug 2011 15:17:51 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p7UJHnKj004511; Tue, 30 Aug 2011 15:17:50 -0400 From: Tom Tromey To: Sanjoy Das Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 5/7] Use the loaded reader. References: <1314450736-19389-7-git-send-email-sanjoy@playingwithpointers.com> <1314518609-10204-1-git-send-email-sanjoy@playingwithpointers.com> <1314518609-10204-6-git-send-email-sanjoy@playingwithpointers.com> Date: Tue, 30 Aug 2011 19:18:00 -0000 In-Reply-To: <1314518609-10204-6-git-send-email-sanjoy@playingwithpointers.com> (Sanjoy Das's message of "Sun, 28 Aug 2011 13:33:27 +0530") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2011-08/txt/msg00628.txt.bz2 >>>>> "Sanjoy" == Sanjoy Das writes: Sanjoy> * gdb/jit.c: Include block.h, dictionary.h and frame-unwind.h. Sanjoy> (add_objfile_entry, jit_target_read_impl, jit_object_open_impl) Sanjoy> (jit_symtab_open_impl, compare_block, jit_block_open_impl) Sanjoy> (jit_symtab_line_mapping_add_impl, jit_symtab_close_impl) Sanjoy> (finalize_symtab, jit_object_close_impl) Sanjoy> (jit_reader_try_read_symtab, jit_bfd_try_read_symtab) Sanjoy> (free_objfile_data): New functions. Sanjoy> (_initialize_jit): Register jit_objfile_data with a proper cleanup Sanjoy> function. Just some minor nits on this one. Sanjoy> + for (i = 0; i < nlines; i++) Sanjoy> + { Sanjoy> + stab->linetable->item [i].pc = (CORE_ADDR) map[i].pc; Sanjoy> + stab->linetable->item [i].line = map[i].line; Sanjoy> + } No space before the "[" on those two lines. Sanjoy> + for (i = (actual_nblocks - 1), gdb_block_iter = stab->blocks; Sanjoy> + i >= FIRST_LOCAL_BLOCK; i--, gdb_block_iter = gdb_block_iter->next) Once a 'for' header goes to a second line, I like to put each clause on its own line, since I think that is easier to read. So, add a newline after the second ";". Sanjoy> + /* Fill up the superblock fields for the real blocks, using the Sanjoy> + real_block fields populated earlier. */ Sanjoy> + for (gdb_block_iter = stab->blocks; gdb_block_iter; Sanjoy> + gdb_block_iter = gdb_block_iter->next) Likewise. Sanjoy> + for (gdb_block_iter = stab->blocks, gdb_block_iter_tmp = gdb_block_iter->next; Sanjoy> + gdb_block_iter; gdb_block_iter = gdb_block_iter_tmp) Likewise. Sanjoy> + objfile->msymbols[0].ginfo.name = NULL; Sanjoy> + objfile->msymbols[0].ginfo.value.address = 0; I think it is slightly better to use memset here. Sanjoy> - jit_objfile_data = register_objfile_data (); Sanjoy> + jit_objfile_data = Sanjoy> + register_objfile_data_with_cleanup (NULL,free_objfile_data); Missing space after the ",". This is ok with these things fixed. Tom