[PATCH] Disassemble over end of line table sequence.

Joel Brobecker brobecker@adacore.com
Mon Jan 31 03:14:00 GMT 2011


> gdb/ChangeLog
> 
> 2011-01-18  Andrew Burgess  <aburgess@broadcom.com>
> 
> 	* disasm.c (compare_lines): Handle the end of sequence markers
> 	within the line table to better support disassembling over
> 	compilation unit boundaries.
> 
> gdb/testsuite/ChangeLog
> 
> 2011-01-18  Andrew Burgess  <aburgess@broadcom.com>
> 
> 	* gdb.base/disasm-end-cu-1.c, gdb.base/disasm-end-cu-2.c,
> 	gdb.base/disasm-end-cu.exp: New test for disassembling over the
> 	boundary between two compilation units.

Sorry for the late review.  For some reason, I completely missed this
email.  Thanks for pinging.

I think we're almost there.  The disasm.c change looks good to me.
But I still have a couple of requests for the testcase.

> +   You should have received a copy of the GNU General Public License
> +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
> +
> +#include <stdio.h>

Can you make your testcase not depend on stdio.h? IO is not always
available, particularly on bareboard targets, so it'd be nice to be
able to build the example on these platforms too... This should be easily
doable by just having another unit that provides a function with the
same signature.

> +# This test tries to disassemble over the boundary between two compilation
> +# units displaying source lines. This checks that the disassemble routine
> +# can handle our use of line number 0 to mark the end of sequence.

Just a nit: missing second space after the period on the second line.

> +gdb_test_multiple "disassemble /m ${main_addr},${dummy_3_addr}" "Disassemble address range with source" {
[...]
> +    timeout {
> +        fail "(timeout) waiting for output of disassemble command"

The "timeout" branch is unnecessary (it's already handled by
gdb_test_multiple).

-- 
Joel



More information about the Gdb-patches mailing list