* [PATCH] Remove dwarf_decode_lines argumewant_line_info
@ 2014-08-27 8:53 Yao Qi
2014-08-27 18:59 ` Doug Evans
0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2014-08-27 8:53 UTC (permalink / raw)
To: gdb-patches
Hi,
dwarf_decode_lines is called in two functions,
dwarf2_build_include_psymtabs and handle_DW_AT_stmt_list, in which, 1
is passed to argument 'want_line_info' and 'want_line_info' is a
conditional variable in dwarf_decode_lines. We can simplify it by
removing 'want_line_info' and propagating the constant 1 into
dwarf_decode_lines. This is what this patch does. This patch also
remove one line comment about WANT_LINE_INFO in
handle_DW_AT_stmt_list, as handle_DW_AT_stmt_list doesn't have such
argument.
gdb:
2014-08-27 Yao Qi <yao@codesourcery.com>
* dwarf2read.c (dwarf_decode_lines): Update declaration.
(handle_DW_AT_stmt_list): Remove comment about WANT_LINE_INFO.
(dwarf_decode_lines): Remove argument
want_line_info. Remove condition check on want_line_info.
Callers update.
---
gdb/dwarf2read.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 4720198..102700a 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1512,8 +1512,7 @@ static struct line_header *dwarf_decode_line_header (unsigned int offset,
struct dwarf2_cu *cu);
static void dwarf_decode_lines (struct line_header *, const char *,
- struct dwarf2_cu *, struct partial_symtab *,
- int);
+ struct dwarf2_cu *, struct partial_symtab *);
static void dwarf2_start_subfile (const char *, const char *, const char *);
@@ -4449,7 +4448,7 @@ dwarf2_build_include_psymtabs (struct dwarf2_cu *cu,
return; /* No linetable, so no includes. */
/* NOTE: pst->dirname is DW_AT_comp_dir (if present). */
- dwarf_decode_lines (lh, pst->dirname, cu, pst, 1);
+ dwarf_decode_lines (lh, pst->dirname, cu, pst);
free_line_header (lh);
}
@@ -8968,8 +8967,7 @@ find_file_and_directory (struct die_info *die, struct dwarf2_cu *cu,
/* Handle DW_AT_stmt_list for a compilation unit.
DIE is the DW_TAG_compile_unit die for CU.
- COMP_DIR is the compilation directory.
- WANT_LINE_INFO is non-zero if the pc/line-number mapping is needed. */
+ COMP_DIR is the compilation directory. */
static void
handle_DW_AT_stmt_list (struct die_info *die, struct dwarf2_cu *cu,
@@ -8990,7 +8988,7 @@ handle_DW_AT_stmt_list (struct die_info *die, struct dwarf2_cu *cu,
{
cu->line_header = line_header;
make_cleanup (free_cu_line_header, cu);
- dwarf_decode_lines (line_header, comp_dir, cu, NULL, 1);
+ dwarf_decode_lines (line_header, comp_dir, cu, NULL);
}
}
}
@@ -17601,15 +17599,13 @@ dwarf_decode_lines_1 (struct line_header *lh, const char *comp_dir,
static void
dwarf_decode_lines (struct line_header *lh, const char *comp_dir,
- struct dwarf2_cu *cu, struct partial_symtab *pst,
- int want_line_info)
+ struct dwarf2_cu *cu, struct partial_symtab *pst)
{
struct objfile *objfile = cu->objfile;
const int decode_for_pst_p = (pst != NULL);
struct subfile *first_subfile = current_subfile;
- if (want_line_info)
- dwarf_decode_lines_1 (lh, comp_dir, cu, decode_for_pst_p);
+ dwarf_decode_lines_1 (lh, comp_dir, cu, decode_for_pst_p);
if (decode_for_pst_p)
{
--
1.9.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Remove dwarf_decode_lines argumewant_line_info
2014-08-27 8:53 [PATCH] Remove dwarf_decode_lines argumewant_line_info Yao Qi
@ 2014-08-27 18:59 ` Doug Evans
2014-08-28 7:15 ` Yao Qi
0 siblings, 1 reply; 3+ messages in thread
From: Doug Evans @ 2014-08-27 18:59 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
Yao Qi writes:
> Hi,
> dwarf_decode_lines is called in two functions,
> dwarf2_build_include_psymtabs and handle_DW_AT_stmt_list, in which, 1
> is passed to argument 'want_line_info' and 'want_line_info' is a
> conditional variable in dwarf_decode_lines. We can simplify it by
> removing 'want_line_info' and propagating the constant 1 into
> dwarf_decode_lines. This is what this patch does. This patch also
> remove one line comment about WANT_LINE_INFO in
> handle_DW_AT_stmt_list, as handle_DW_AT_stmt_list doesn't have such
> argument.
>
> gdb:
>
> 2014-08-27 Yao Qi <yao@codesourcery.com>
>
> * dwarf2read.c (dwarf_decode_lines): Update declaration.
> (handle_DW_AT_stmt_list): Remove comment about WANT_LINE_INFO.
> (dwarf_decode_lines): Remove argument
> want_line_info. Remove condition check on want_line_info.
> Callers update.
LGTM.
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Remove dwarf_decode_lines argumewant_line_info
2014-08-27 18:59 ` Doug Evans
@ 2014-08-28 7:15 ` Yao Qi
0 siblings, 0 replies; 3+ messages in thread
From: Yao Qi @ 2014-08-28 7:15 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
Doug Evans <dje@google.com> writes:
> > 2014-08-27 Yao Qi <yao@codesourcery.com>
> >
> > * dwarf2read.c (dwarf_decode_lines): Update declaration.
> > (handle_DW_AT_stmt_list): Remove comment about WANT_LINE_INFO.
> > (dwarf_decode_lines): Remove argument
> > want_line_info. Remove condition check on want_line_info.
> > Callers update.
>
> LGTM.
Thanks. Patch is pushed in.
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-28 7:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-27 8:53 [PATCH] Remove dwarf_decode_lines argumewant_line_info Yao Qi
2014-08-27 18:59 ` Doug Evans
2014-08-28 7:15 ` Yao Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox