mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-18 16:53:50 +08:00
gdb/
Code cleanup. * breakpoint.c (clear_command): Remove variable sal_name_len and its initialization, remove it from the compare_filenames_for_search call. * dwarf2read.c (dw2_map_symtabs_matching_filename): Remove variable name_len and its initialization, remove it from the compare_filenames_for_search calls. * psymtab.c (partial_map_symtabs_matching_filename): Likewise. * symtab.c (compare_filenames_for_search): Remove the search_len parameter, update the function comment, new variable search_len initialized from SEARCH_NAME. (iterate_over_some_symtabs): Remove variable name_len and its initialization, remove it from the compare_filenames_for_search calls. * symtab.h (compare_filenames_for_search): Remove the search_len parameter,
This commit is contained in:
@ -1,3 +1,20 @@
|
|||||||
|
2012-12-16 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
Code cleanup.
|
||||||
|
* breakpoint.c (clear_command): Remove variable sal_name_len and its
|
||||||
|
initialization, remove it from the compare_filenames_for_search call.
|
||||||
|
* dwarf2read.c (dw2_map_symtabs_matching_filename): Remove variable
|
||||||
|
name_len and its initialization, remove it from the
|
||||||
|
compare_filenames_for_search calls.
|
||||||
|
* psymtab.c (partial_map_symtabs_matching_filename): Likewise.
|
||||||
|
* symtab.c (compare_filenames_for_search): Remove the search_len
|
||||||
|
parameter, update the function comment, new variable search_len
|
||||||
|
initialized from SEARCH_NAME.
|
||||||
|
(iterate_over_some_symtabs): Remove variable name_len and its
|
||||||
|
initialization, remove it from the compare_filenames_for_search calls.
|
||||||
|
* symtab.h (compare_filenames_for_search): Remove the search_len
|
||||||
|
parameter,
|
||||||
|
|
||||||
2012-12-16 Joel Brobecker <brobecker@adacore.com>
|
2012-12-16 Joel Brobecker <brobecker@adacore.com>
|
||||||
|
|
||||||
* Makefile.in (SFILES): Move ravenscar-thread.c from here...
|
* Makefile.in (SFILES): Move ravenscar-thread.c from here...
|
||||||
|
@ -11881,7 +11881,7 @@ clear_command (char *arg, int from_tty)
|
|||||||
make_cleanup (VEC_cleanup (breakpoint_p), &found);
|
make_cleanup (VEC_cleanup (breakpoint_p), &found);
|
||||||
for (i = 0; i < sals.nelts; i++)
|
for (i = 0; i < sals.nelts; i++)
|
||||||
{
|
{
|
||||||
int is_abs, sal_name_len;
|
int is_abs;
|
||||||
|
|
||||||
/* If exact pc given, clear bpts at that pc.
|
/* If exact pc given, clear bpts at that pc.
|
||||||
If line given (pc == 0), clear all bpts on specified line.
|
If line given (pc == 0), clear all bpts on specified line.
|
||||||
@ -11897,7 +11897,6 @@ clear_command (char *arg, int from_tty)
|
|||||||
|
|
||||||
sal = sals.sals[i];
|
sal = sals.sals[i];
|
||||||
is_abs = sal.symtab == NULL ? 1 : IS_ABSOLUTE_PATH (sal.symtab->filename);
|
is_abs = sal.symtab == NULL ? 1 : IS_ABSOLUTE_PATH (sal.symtab->filename);
|
||||||
sal_name_len = is_abs ? 0 : strlen (sal.symtab->filename);
|
|
||||||
|
|
||||||
/* Find all matching breakpoints and add them to 'found'. */
|
/* Find all matching breakpoints and add them to 'found'. */
|
||||||
ALL_BREAKPOINTS (b)
|
ALL_BREAKPOINTS (b)
|
||||||
@ -11930,8 +11929,7 @@ clear_command (char *arg, int from_tty)
|
|||||||
line_match = 1;
|
line_match = 1;
|
||||||
else if (!IS_ABSOLUTE_PATH (sal.symtab->filename)
|
else if (!IS_ABSOLUTE_PATH (sal.symtab->filename)
|
||||||
&& compare_filenames_for_search (loc->source_file,
|
&& compare_filenames_for_search (loc->source_file,
|
||||||
sal.symtab->filename,
|
sal.symtab->filename))
|
||||||
sal_name_len))
|
|
||||||
line_match = 1;
|
line_match = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3068,7 +3068,6 @@ dw2_map_symtabs_matching_filename (struct objfile *objfile, const char *name,
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const char *name_basename = lbasename (name);
|
const char *name_basename = lbasename (name);
|
||||||
int name_len = strlen (name);
|
|
||||||
int is_abs = IS_ABSOLUTE_PATH (name);
|
int is_abs = IS_ABSOLUTE_PATH (name);
|
||||||
|
|
||||||
dw2_setup (objfile);
|
dw2_setup (objfile);
|
||||||
@ -3095,8 +3094,7 @@ dw2_map_symtabs_matching_filename (struct objfile *objfile, const char *name,
|
|||||||
const char *this_name = file_data->file_names[j];
|
const char *this_name = file_data->file_names[j];
|
||||||
|
|
||||||
if (FILENAME_CMP (name, this_name) == 0
|
if (FILENAME_CMP (name, this_name) == 0
|
||||||
|| (!is_abs && compare_filenames_for_search (this_name,
|
|| (!is_abs && compare_filenames_for_search (this_name, name)))
|
||||||
name, name_len)))
|
|
||||||
{
|
{
|
||||||
if (dw2_map_expand_apply (objfile, per_cu,
|
if (dw2_map_expand_apply (objfile, per_cu,
|
||||||
name, full_path, real_path,
|
name, full_path, real_path,
|
||||||
@ -3119,7 +3117,7 @@ dw2_map_symtabs_matching_filename (struct objfile *objfile, const char *name,
|
|||||||
&& (FILENAME_CMP (full_path, this_real_name) == 0
|
&& (FILENAME_CMP (full_path, this_real_name) == 0
|
||||||
|| (!is_abs
|
|| (!is_abs
|
||||||
&& compare_filenames_for_search (this_real_name,
|
&& compare_filenames_for_search (this_real_name,
|
||||||
name, name_len))))
|
name))))
|
||||||
{
|
{
|
||||||
if (dw2_map_expand_apply (objfile, per_cu,
|
if (dw2_map_expand_apply (objfile, per_cu,
|
||||||
name, full_path, real_path,
|
name, full_path, real_path,
|
||||||
@ -3137,7 +3135,7 @@ dw2_map_symtabs_matching_filename (struct objfile *objfile, const char *name,
|
|||||||
&& (FILENAME_CMP (real_path, this_real_name) == 0
|
&& (FILENAME_CMP (real_path, this_real_name) == 0
|
||||||
|| (!is_abs
|
|| (!is_abs
|
||||||
&& compare_filenames_for_search (this_real_name,
|
&& compare_filenames_for_search (this_real_name,
|
||||||
name, name_len))))
|
name))))
|
||||||
{
|
{
|
||||||
if (dw2_map_expand_apply (objfile, per_cu,
|
if (dw2_map_expand_apply (objfile, per_cu,
|
||||||
name, full_path, real_path,
|
name, full_path, real_path,
|
||||||
|
@ -168,7 +168,6 @@ partial_map_symtabs_matching_filename (struct objfile *objfile,
|
|||||||
{
|
{
|
||||||
struct partial_symtab *pst;
|
struct partial_symtab *pst;
|
||||||
const char *name_basename = lbasename (name);
|
const char *name_basename = lbasename (name);
|
||||||
int name_len = strlen (name);
|
|
||||||
int is_abs = IS_ABSOLUTE_PATH (name);
|
int is_abs = IS_ABSOLUTE_PATH (name);
|
||||||
|
|
||||||
ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, pst)
|
ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, pst)
|
||||||
@ -183,8 +182,7 @@ partial_map_symtabs_matching_filename (struct objfile *objfile,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (FILENAME_CMP (name, pst->filename) == 0
|
if (FILENAME_CMP (name, pst->filename) == 0
|
||||||
|| (!is_abs && compare_filenames_for_search (pst->filename,
|
|| (!is_abs && compare_filenames_for_search (pst->filename, name)))
|
||||||
name, name_len)))
|
|
||||||
{
|
{
|
||||||
if (partial_map_expand_apply (objfile, name, full_path, real_path,
|
if (partial_map_expand_apply (objfile, name, full_path, real_path,
|
||||||
pst, callback, data))
|
pst, callback, data))
|
||||||
@ -205,7 +203,7 @@ partial_map_symtabs_matching_filename (struct objfile *objfile,
|
|||||||
if (pst->fullname != NULL
|
if (pst->fullname != NULL
|
||||||
&& (FILENAME_CMP (full_path, pst->fullname) == 0
|
&& (FILENAME_CMP (full_path, pst->fullname) == 0
|
||||||
|| (!is_abs && compare_filenames_for_search (pst->fullname,
|
|| (!is_abs && compare_filenames_for_search (pst->fullname,
|
||||||
name, name_len))))
|
name))))
|
||||||
{
|
{
|
||||||
if (partial_map_expand_apply (objfile, name, full_path, real_path,
|
if (partial_map_expand_apply (objfile, name, full_path, real_path,
|
||||||
pst, callback, data))
|
pst, callback, data))
|
||||||
@ -224,8 +222,7 @@ partial_map_symtabs_matching_filename (struct objfile *objfile,
|
|||||||
}
|
}
|
||||||
if (rp != NULL
|
if (rp != NULL
|
||||||
&& (FILENAME_CMP (real_path, rp) == 0
|
&& (FILENAME_CMP (real_path, rp) == 0
|
||||||
|| (!is_abs && compare_filenames_for_search (real_path,
|
|| (!is_abs && compare_filenames_for_search (real_path, name))))
|
||||||
name, name_len))))
|
|
||||||
{
|
{
|
||||||
if (partial_map_expand_apply (objfile, name, full_path, real_path,
|
if (partial_map_expand_apply (objfile, name, full_path, real_path,
|
||||||
pst, callback, data))
|
pst, callback, data))
|
||||||
|
17
gdb/symtab.c
17
gdb/symtab.c
@ -147,15 +147,14 @@ const struct block *block_found;
|
|||||||
|
|
||||||
/* See whether FILENAME matches SEARCH_NAME using the rule that we
|
/* See whether FILENAME matches SEARCH_NAME using the rule that we
|
||||||
advertise to the user. (The manual's description of linespecs
|
advertise to the user. (The manual's description of linespecs
|
||||||
describes what we advertise). SEARCH_LEN is the length of
|
describes what we advertise). We assume that SEARCH_NAME is
|
||||||
SEARCH_NAME. We assume that SEARCH_NAME is a relative path.
|
a relative path. Returns true if they match, false otherwise. */
|
||||||
Returns true if they match, false otherwise. */
|
|
||||||
|
|
||||||
int
|
int
|
||||||
compare_filenames_for_search (const char *filename, const char *search_name,
|
compare_filenames_for_search (const char *filename, const char *search_name)
|
||||||
int search_len)
|
|
||||||
{
|
{
|
||||||
int len = strlen (filename);
|
int len = strlen (filename);
|
||||||
|
size_t search_len = strlen (search_name);
|
||||||
|
|
||||||
if (len < search_len)
|
if (len < search_len)
|
||||||
return 0;
|
return 0;
|
||||||
@ -196,7 +195,6 @@ iterate_over_some_symtabs (const char *name,
|
|||||||
{
|
{
|
||||||
struct symtab *s = NULL;
|
struct symtab *s = NULL;
|
||||||
const char* base_name = lbasename (name);
|
const char* base_name = lbasename (name);
|
||||||
int name_len = strlen (name);
|
|
||||||
int is_abs = IS_ABSOLUTE_PATH (name);
|
int is_abs = IS_ABSOLUTE_PATH (name);
|
||||||
|
|
||||||
for (s = first; s != NULL && s != after_last; s = s->next)
|
for (s = first; s != NULL && s != after_last; s = s->next)
|
||||||
@ -208,7 +206,7 @@ iterate_over_some_symtabs (const char *name,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_abs && compare_filenames_for_search (s->filename, name, name_len))
|
if (!is_abs && compare_filenames_for_search (s->filename, name))
|
||||||
{
|
{
|
||||||
if (callback (s, data))
|
if (callback (s, data))
|
||||||
return 1;
|
return 1;
|
||||||
@ -233,8 +231,7 @@ iterate_over_some_symtabs (const char *name,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fp != NULL && !is_abs && compare_filenames_for_search (fp, name,
|
if (fp != NULL && !is_abs && compare_filenames_for_search (fp, name))
|
||||||
name_len))
|
|
||||||
{
|
{
|
||||||
if (callback (s, data))
|
if (callback (s, data))
|
||||||
return 1;
|
return 1;
|
||||||
@ -256,7 +253,7 @@ iterate_over_some_symtabs (const char *name,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_abs && compare_filenames_for_search (rp, name, name_len))
|
if (!is_abs && compare_filenames_for_search (rp, name))
|
||||||
{
|
{
|
||||||
if (callback (s, data))
|
if (callback (s, data))
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1309,8 +1309,7 @@ extern int symtab_create_debug;
|
|||||||
extern int basenames_may_differ;
|
extern int basenames_may_differ;
|
||||||
|
|
||||||
int compare_filenames_for_search (const char *filename,
|
int compare_filenames_for_search (const char *filename,
|
||||||
const char *search_name,
|
const char *search_name);
|
||||||
int search_len);
|
|
||||||
|
|
||||||
int iterate_over_some_symtabs (const char *name,
|
int iterate_over_some_symtabs (const char *name,
|
||||||
const char *full_path,
|
const char *full_path,
|
||||||
|
Reference in New Issue
Block a user