Changeset View
Changeset View
Standalone View
Standalone View
contrib/gdb/gdb/symfile.c
Show First 20 Lines • Show All 1,016 Lines • ▼ Show 20 Lines | separate_debug_file_exists (const char *name, unsigned long crc) | ||||
char buffer[8*1024]; | char buffer[8*1024]; | ||||
int count; | int count; | ||||
fd = open (name, O_RDONLY | O_BINARY); | fd = open (name, O_RDONLY | O_BINARY); | ||||
if (fd < 0) | if (fd < 0) | ||||
return 0; | return 0; | ||||
while ((count = read (fd, buffer, sizeof (buffer))) > 0) | while ((count = read (fd, buffer, sizeof (buffer))) > 0) | ||||
file_crc = gnu_debuglink_crc32 (file_crc, buffer, count); | file_crc = gnu_debuglink_crc32 (file_crc, (unsigned char *)buffer, count); | ||||
close (fd); | close (fd); | ||||
return crc == file_crc; | return crc == file_crc; | ||||
} | } | ||||
static char *debug_file_directory = NULL; | static char *debug_file_directory = NULL; | ||||
▲ Show 20 Lines • Show All 1,610 Lines • ▼ Show 20 Lines | add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name, | ||||
switch (language) | switch (language) | ||||
{ | { | ||||
case language_c: | case language_c: | ||||
case language_cplus: | case language_cplus: | ||||
SYMBOL_CPLUS_DEMANGLED_NAME (&psymbol) = | SYMBOL_CPLUS_DEMANGLED_NAME (&psymbol) = | ||||
deprecated_bcache (buf, dem_namelength + 1, objfile->psymbol_cache); | deprecated_bcache (buf, dem_namelength + 1, objfile->psymbol_cache); | ||||
break; | break; | ||||
default: | |||||
break; | |||||
/* FIXME What should be done for the default case? Ignoring for now. */ | /* FIXME What should be done for the default case? Ignoring for now. */ | ||||
} | } | ||||
/* val and coreaddr are mutually exclusive, one of them *will* be zero */ | /* val and coreaddr are mutually exclusive, one of them *will* be zero */ | ||||
if (val != 0) | if (val != 0) | ||||
{ | { | ||||
SYMBOL_VALUE (&psymbol) = val; | SYMBOL_VALUE (&psymbol) = val; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 672 Lines • ▼ Show 20 Lines | if (! ovly_table_msym) | ||||
return 0; | return 0; | ||||
} | } | ||||
cache_novlys = read_memory_integer (SYMBOL_VALUE_ADDRESS (novlys_msym), 4); | cache_novlys = read_memory_integer (SYMBOL_VALUE_ADDRESS (novlys_msym), 4); | ||||
cache_ovly_table | cache_ovly_table | ||||
= (void *) xmalloc (cache_novlys * sizeof (*cache_ovly_table)); | = (void *) xmalloc (cache_novlys * sizeof (*cache_ovly_table)); | ||||
cache_ovly_table_base = SYMBOL_VALUE_ADDRESS (ovly_table_msym); | cache_ovly_table_base = SYMBOL_VALUE_ADDRESS (ovly_table_msym); | ||||
read_target_long_array (cache_ovly_table_base, | read_target_long_array (cache_ovly_table_base, | ||||
(int *) cache_ovly_table, | (unsigned int *) cache_ovly_table, | ||||
cache_novlys * 4); | cache_novlys * 4); | ||||
return 1; /* SUCCESS */ | return 1; /* SUCCESS */ | ||||
} | } | ||||
#if 0 | #if 0 | ||||
/* Find and grab a copy of the target _ovly_region_table | /* Find and grab a copy of the target _ovly_region_table | ||||
(and _novly_regions, which is needed for the table's size) */ | (and _novly_regions, which is needed for the table's size) */ | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | simple_overlay_update_1 (struct obj_section *osect) | ||||
size = bfd_get_section_size (osect->the_bfd_section); | size = bfd_get_section_size (osect->the_bfd_section); | ||||
for (i = 0; i < cache_novlys; i++) | for (i = 0; i < cache_novlys; i++) | ||||
if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect) | if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect) | ||||
&& cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect) | && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect) | ||||
/* && cache_ovly_table[i][SIZE] == size */ ) | /* && cache_ovly_table[i][SIZE] == size */ ) | ||||
{ | { | ||||
read_target_long_array (cache_ovly_table_base + i * TARGET_LONG_BYTES, | read_target_long_array (cache_ovly_table_base + i * TARGET_LONG_BYTES, | ||||
(int *) cache_ovly_table[i], 4); | (unsigned int *) cache_ovly_table[i], 4); | ||||
if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect) | if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect) | ||||
&& cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect) | && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect) | ||||
/* && cache_ovly_table[i][SIZE] == size */ ) | /* && cache_ovly_table[i][SIZE] == size */ ) | ||||
{ | { | ||||
osect->ovly_mapped = cache_ovly_table[i][MAPPED]; | osect->ovly_mapped = cache_ovly_table[i][MAPPED]; | ||||
return 1; | return 1; | ||||
} | } | ||||
else /* Warning! Warning! Target's ovly table has changed! */ | else /* Warning! Warning! Target's ovly table has changed! */ | ||||
▲ Show 20 Lines • Show All 200 Lines • Show Last 20 Lines |