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: [RFA 1/2] Make line tables independent of progspace


On Thu, 29 Mar 2018, Simon Marchi wrote:

> Since adjust_dwarf2_line used to be passed the relocated address, Tom included a
> "hack" where he relocates the address, passes it through gdbarch_adjust_dwarf2_line,
> and unrelocates it:
> 
>   /* Handle DW_LNE_set_address.  */
>   void handle_set_address (CORE_ADDR baseaddr, CORE_ADDR address)
>   {
>     m_op_index = 0;
>     /* Pass the relocated address to the gdbarch for modification, but
>        then only store the relative address.  */
>     address += baseaddr;
>     m_address = (gdbarch_adjust_dwarf2_line (m_gdbarch, address, false)
> 		 - baseaddr);
>   }
> 
> I think right now this is necessary, because mips_adjust_dwarf2_line does a
> minimal symbol lookup, which are relocated.  So if we passed an unrelocated
> address, I guess it wouldn't find the symbol.

 Yeah, I guess it's all right, the difference will ever be either 1 or 0.

 I would pass it through MIPS16 and/or microMIPS regression testing to be 
sure.  We have the Good Friday public holiday tomorrow here in the UK and 
then Easter Monday, so I won't be able to schedule a test run until 
sometime next week though.

> I just wanted to make sure there wasn't anything you saw that is obviously
> wrong with this approach.  I think that eventually we'll be able to pass an
> unrelocated address to adjust_dwarf2_line, but in the mean time we probably
> need this hack.

 This piece and the associated infrastructure is scheduled to go once Yao 
has sorted the issue with function descriptions and his proposed change: 
<https://sourceware.org/ml/gdb-patches/2016-10/msg00430.html>, when we'll 
be able to reduce the amount of hackery required to handle the broken 
debug record generation for compressed MIPS code (where the ISA bit is set 
in line records, but not in any other debug records).  At that point we'll 
have to have a hook to remove the ISA bit from line entries instead 
though; perhaps that'll be the very `gdbarch_addr_bits_remove'.

  Maciej


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