From: Yao Qi <qiyaoltc@gmail.com>
To: Pedro Alves <palves@redhat.com>
Cc: Ulrich Weigand <uweigand@de.ibm.com>,
Jan Kratochvil <jan.kratochvil@redhat.com>,
Simon Marchi <simon.marchi@ericsson.com>,
Keith Seitz <keiths@redhat.com>,
gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix setting-breakpoints regression on PPC64 (function descriptors)
Date: Fri, 08 Dec 2017 09:44:00 -0000 [thread overview]
Message-ID: <867etxpn9k.fsf@gmail.com> (raw)
In-Reply-To: <0bea6805-b8eb-da2c-07f6-0f1ee917c7b5@redhat.com> (Pedro Alves's message of "Wed, 29 Nov 2017 19:07:54 +0000")
Pedro Alves <palves@redhat.com> writes:
> @@ -4309,22 +4309,16 @@ minsym_found (struct linespec_state *self, struct objfile *objfile,
> struct minimal_symbol *msymbol,
> std::vector<symtab_and_line> *result)
> {
> - struct gdbarch *gdbarch = get_objfile_arch (objfile);
> - CORE_ADDR pc;
> struct symtab_and_line sal;
>
> - if (msymbol_is_text (msymbol))
> - {
> - sal = find_pc_sect_line (MSYMBOL_VALUE_ADDRESS (objfile, msymbol),
> - (struct obj_section *) 0, 0);
> - sal.section = MSYMBOL_OBJ_SECTION (objfile, msymbol);
This line is removed, so that sal.section can be null. It causes
PR 22567. How is the patch below?
> + /* The minimal symbol might point to a function descriptor, which is
> + not a text symbol; try resolving it to the actual code
> + address. */
>
> - /* The minimal symbol might point to a function descriptor;
> - resolve it to the actual code address instead. */
> - pc = gdbarch_convert_from_func_ptr_addr (gdbarch, sal.pc,
> - ¤t_target);
> - if (pc != sal.pc)
> - sal = find_pc_sect_line (pc, NULL, 0);
> + CORE_ADDR func_addr;
> + if (msymbol_is_function (objfile, msymbol, &func_addr))
> + {
> + sal = find_pc_sect_line (func_addr, NULL, 0);
>
> if (self->funfirstline)
> {
--
Yao (齐尧)
From b8e112071a75e7227dc3ee5f35cfa874f3b41da7 Mon Sep 17 00:00:00 2001
From: Yao Qi <yao.qi@linaro.org>
Date: Thu, 7 Dec 2017 16:53:13 +0000
Subject: [PATCH] Fix PR 22567: set SAL .section in minsym_found
PR 22567 is that breakpoint location can't correct gdbarch from SAL,
because its fields .section and .symtab is NULL. We use to have code
setting .section, but was removed by 4024cf2
- if (msymbol_is_text (msymbol))
+ CORE_ADDR func_addr;
+ if (msymbol_is_function (objfile, msymbol, &func_addr))
{
- sal = find_pc_sect_line (MSYMBOL_VALUE_ADDRESS (objfile, msymbol),
- (struct obj_section *) 0, 0);
- sal.section = MSYMBOL_OBJ_SECTION (objfile, msymbol);
this patch adds this back by moving it to the common place at the bottom
of the function.
gdb:
2017-12-07 Yao Qi <yao.qi@linaro.org>
PR breakpionts/22567
* linespec.c (minsym_found): Set sal. objfile and section.
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 09758762..8c36f2a 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -4365,9 +4365,10 @@ minsym_found (struct linespec_state *self, struct objfile *objfile,
sal.objfile = objfile;
sal.pc = MSYMBOL_VALUE_ADDRESS (objfile, msymbol);
sal.pspace = current_program_space;
- sal.section = MSYMBOL_OBJ_SECTION (objfile, msymbol);
}
+ sal.section = MSYMBOL_OBJ_SECTION (objfile, msymbol);
+
if (maybe_add_address (self->addr_set, objfile->pspace, sal.pc))
add_sal_to_sals (self, result, &sal, MSYMBOL_NATURAL_NAME (msymbol), 0);
}
next prev parent reply other threads:[~2017-12-08 9:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-04 18:47 [PATCH 0/2] Make "list ambiguous" show symbol names too Pedro Alves
2017-09-04 18:47 ` [PATCH 1/2] Fix "list ambiguous_variable" Pedro Alves
2017-09-06 18:41 ` Keith Seitz
2017-09-20 15:25 ` Pedro Alves
2017-10-16 15:03 ` Simon Marchi
2017-11-25 7:40 ` ppc64 regression: " Jan Kratochvil
2017-11-26 16:38 ` Ulrich Weigand
2017-11-29 19:08 ` [PATCH] Fix setting-breakpoints regression on PPC64 (function descriptors) (was: Re: ppc64 regression: [PATCH 1/2] Fix "list ambiguous_variable") Pedro Alves
2017-11-29 19:20 ` [PATCH] Fix setting-breakpoints regression on PPC64 (function descriptors) (was: Re: ppc64 regression: [PATCH 1/2] Fix "list amb Ulrich Weigand
2017-11-29 19:28 ` Pedro Alves
2017-12-08 9:44 ` Yao Qi [this message]
2017-12-08 11:34 ` [PATCH] Fix setting-breakpoints regression on PPC64 (function descriptors) Pedro Alves
2017-12-08 16:57 ` Yao Qi
2017-09-04 18:47 ` [PATCH 2/2] Make "list ambiguous" show symbol names too Pedro Alves
2017-09-06 18:43 ` Keith Seitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=867etxpn9k.fsf@gmail.com \
--to=qiyaoltc@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=keiths@redhat.com \
--cc=palves@redhat.com \
--cc=simon.marchi@ericsson.com \
--cc=uweigand@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox