This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 5/7] Use the loaded reader.


>>>>> "Sanjoy" == Sanjoy Das <sanjoy@playingwithpointers.com> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]