This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] Fix gdb.dwarf2/dwz.exp for thumb mode
- From: Yao Qi <yao at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Mon, 22 Sep 2014 21:47:51 +0800
- Subject: Re: [PATCH] Fix gdb.dwarf2/dwz.exp for thumb mode
- Authentication-results: sourceware.org; auth=none
- References: <1409706936-11220-1-git-send-email-yao at codesourcery dot com> <87k356lfa8 dot fsf at codesourcery dot com> <87r3zd2hr3 dot fsf at codesourcery dot com>
On 09/15/2014 08:25 PM, Yao Qi wrote:
> Subject: [PATCH] Fix gdb.dwarf2/dwz.exp for thumb mode
> We see the fail in gdb.dwarf2/dwz.exp in thumb mode,
> p the_int^M
> $2 = 99^M
> (gdb) FAIL: gdb.dwarf2/dwz.exp: p the_int
> In thumb mode, the lsb of references to 'main' in the assembly
> (produced by dwarf assember) is set, so the generated debug
> information is incorrect.
> in this patch, we add a label main_label inside function main. Linker
> doesn't set its lsb in thumb mode, and we can get function main's
> address by 'main_label - $main_label_offset'. This label isn't moved
> out of function main in both gcc and clang.
> 2014-09-15 Yao Qi <firstname.lastname@example.org>
> * gdb.dwarf2/main.c (main): New lable main_label.
> * gdb.dwarf2/dwz.exp: Get the offset of main_label to main.
> Return early if $main_label_offset is unknown. Get address
> of main by "main_label - $main_label_offset".