* core.c (core_files_info): Shorten output.
* exec.c (exec_files_info): Ditto. (build_section_table): Ignore zero-length sections.
This commit is contained in:
parent
39bf59520b
commit
dad0e12d57
2 changed files with 18 additions and 14 deletions
10
gdb/core.c
10
gdb/core.c
|
@ -282,13 +282,11 @@ core_files_info (t)
|
||||||
printf ("\tCore file `%s'.\n", bfd_get_filename(core_bfd));
|
printf ("\tCore file `%s'.\n", bfd_get_filename(core_bfd));
|
||||||
|
|
||||||
for (p = t->sections; p < t->sections_end; p++) {
|
for (p = t->sections; p < t->sections_end; p++) {
|
||||||
printf(p->bfd == core_bfd? "\tcore file ": "\tshared lib ");
|
printf("\t%s", local_hex_string_custom (p->addr, "08"));
|
||||||
printf("from %s", local_hex_string_custom (p->addr, "08"));
|
printf(" - %s is %s", local_hex_string_custom (p->endaddr, "08"),
|
||||||
printf(" to %s", local_hex_string_custom (p->endaddr, "08"));
|
bfd_section_name (p->bfd, p->sec_ptr));
|
||||||
if (p->bfd != core_bfd) {
|
if (p->bfd != core_bfd) {
|
||||||
printf(" is %s in %s",
|
printf(" in %s", bfd_get_filename (p->bfd));
|
||||||
bfd_section_name (p->bfd, p->sec_ptr),
|
|
||||||
bfd_get_filename (p->bfd));
|
|
||||||
}
|
}
|
||||||
printf ("\n");
|
printf ("\n");
|
||||||
}
|
}
|
||||||
|
|
18
gdb/exec.c
18
gdb/exec.c
|
@ -52,7 +52,7 @@ int write_files = 0;
|
||||||
|
|
||||||
/* Text start and end addresses (KLUDGE) if needed */
|
/* Text start and end addresses (KLUDGE) if needed */
|
||||||
|
|
||||||
#if NEED_TEXT_START_END
|
#ifdef NEED_TEXT_START_END
|
||||||
CORE_ADDR text_start = 0;
|
CORE_ADDR text_start = 0;
|
||||||
CORE_ADDR text_end = 0;
|
CORE_ADDR text_end = 0;
|
||||||
#endif
|
#endif
|
||||||
|
@ -144,15 +144,18 @@ exec_file_command (filename, from_tty)
|
||||||
error ("Can't find the file sections in `%s': %s",
|
error ("Can't find the file sections in `%s': %s",
|
||||||
exec_bfd->filename, bfd_errmsg (bfd_error));
|
exec_bfd->filename, bfd_errmsg (bfd_error));
|
||||||
|
|
||||||
#if NEED_TEXT_START_END
|
#ifdef NEED_TEXT_START_END
|
||||||
/* This is a KLUDGE (FIXME) because a few places in a few ports
|
/* This is a KLUDGE (FIXME) because a few places in a few ports
|
||||||
(29K springs to mind) need this info for now. */
|
(29K springs to mind) need this info for now. */
|
||||||
{
|
{
|
||||||
struct section_table *p;
|
struct section_table *p;
|
||||||
for (p = exec_ops.sections; p < exec_ops.sections_end; p++)
|
for (p = exec_ops.sections; p < exec_ops.sections_end; p++)
|
||||||
if (!strcmp (".text", bfd_section_name (p->bfd, p->sec_ptr))
|
if (!strcmp (".text", bfd_section_name (p->bfd, p->sec_ptr)))
|
||||||
|
{
|
||||||
text_start = p->addr;
|
text_start = p->addr;
|
||||||
text_end = p->endaddr;
|
text_end = p->endaddr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -201,6 +204,8 @@ add_to_section_table (abfd, asect, table_pp_char)
|
||||||
/* FIXME, we need to handle BSS segment here...it alloc's but doesn't load */
|
/* FIXME, we need to handle BSS segment here...it alloc's but doesn't load */
|
||||||
if (!(aflag & SEC_LOAD))
|
if (!(aflag & SEC_LOAD))
|
||||||
return;
|
return;
|
||||||
|
if (0 == bfd_section_size (abfd, asect))
|
||||||
|
return;
|
||||||
(*table_pp)->bfd = abfd;
|
(*table_pp)->bfd = abfd;
|
||||||
(*table_pp)->sec_ptr = asect;
|
(*table_pp)->sec_ptr = asect;
|
||||||
(*table_pp)->addr = bfd_section_vma (abfd, asect);
|
(*table_pp)->addr = bfd_section_vma (abfd, asect);
|
||||||
|
@ -320,11 +325,12 @@ exec_files_info ()
|
||||||
|
|
||||||
printf ("\tExecutable file `%s'.\n", bfd_get_filename(exec_bfd));
|
printf ("\tExecutable file `%s'.\n", bfd_get_filename(exec_bfd));
|
||||||
|
|
||||||
for (p = exec_ops.sections; p < exec_ops.sections_end; p++)
|
for (p = exec_ops.sections; p < exec_ops.sections_end; p++) {
|
||||||
printf("\texecutable from 0x%08x to 0x%08x is %s\n",
|
printf("\t%s", local_hex_string_custom (p->addr, "08"));
|
||||||
p->addr, p->endaddr,
|
printf(" - %s is %s\n", local_hex_string_custom (p->endaddr, "08"),
|
||||||
bfd_section_name (exec_bfd, p->sec_ptr));
|
bfd_section_name (exec_bfd, p->sec_ptr));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_section_command (args, from_tty)
|
set_section_command (args, from_tty)
|
||||||
|
|
Loading…
Add table
Reference in a new issue