From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fernando Nasser To: Andrew Cagney Cc: gdb-patches@sources.redhat.com, Nick Clifton Subject: Re: RFA: [buildsym.c] Turn off unused addr bits in linetable Date: Tue, 13 Mar 2001 09:21:00 -0000 Message-id: <3AAE5652.8EDD98FA@redhat.com> References: <3AAD70B6.A9C16F36@redhat.com> <3AAE3502.BFFE90D2@cygnus.com> X-SW-Source: 2001-03/msg00192.html Andrew Cagney wrote: > > Fernando Nasser wrote: > > > > Some systems like ARM may have extra bits set in the address to indicate > > a mode or something else (the LSB=1 means thumb mode for ARM). > > > > So, before storing line number addresses we may need to turn this bits > > off as they may be passed to gdb with the bits on as result of > > relocation (ld has no way of knowing it is for a line table entry). > > > > The following patch passes the line addresses through the target > > dependent macro ADDR_BITS_REMOVE() before storing it on the table. > > > > OK to commit? > > > > ChangeLog: > > > > * buildsym.c (record_line): Turn off unused addr bits. > > I'm not sure about this. The ARM has two ways of identifying THUMB code > - the LSB and a tacky symbol lookup. > Yes, but the loader relocation produces _some_ thumb addresses with the LSB bit on. The bit in the symbol table is only used to detect thumb addresses that had the bit turned off (I have a second patch that optimizes the ARM implementation of ADDR_BITS_REMOVE() but it is not necessary for correctness). > Others, such as MIPS/MIPS16 don't. I'm not sure how this will affect > that target. Does the code that uses this address of line also ``turn > off unused addr bits''? > Well, they should. BRAKPOINT_FROM_PC() is supposed to make the necessary address adjustments. In the ARM case, it does turn off the thumb bit (the others will never be set where it is used). I don't have a MIPS target to test. I will depend on someone doing it for me. I will take a look at the macros implementation though. Thanks for the heads up. -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9