Non-functional change in preparation of the next commit:

Move link_elf_add_gdb(), link_elf_delete_gdb() and link_elf_error()
near the top of the file. The *_gdb() functions are moved inside
the #ifdef DDB already present there.
This commit is contained in:
Marcel Moolenaar 2002-10-19 18:43:37 +00:00
parent f4ecdf056e
commit 1720979bc5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=105467
2 changed files with 72 additions and 82 deletions

View File

@ -160,7 +160,36 @@ r_debug_state(struct r_debug *dummy_one __unused,
{
}
#endif
static void
link_elf_add_gdb(struct link_map *l)
{
struct link_map *prev;
/*
* Scan to the end of the list.
*/
for (prev = r_debug.r_map; prev->l_next != NULL; prev = prev->l_next)
;
/* Link in the new entry. */
l->l_prev = prev;
l->l_next = prev->l_next;
prev->l_next = l;
}
static void
link_elf_delete_gdb(struct link_map *l)
{
if (l->l_prev == NULL) {
if ((r_debug.r_map = l->l_next) != NULL)
l->l_next->l_prev = NULL;
return;
}
if ((l->l_prev->l_next = l->l_next) != NULL)
l->l_next->l_prev = l->l_prev;
}
#endif /* DDB */
#ifdef __ia64__
Elf_Addr link_elf_get_gp(linker_file_t);
@ -171,6 +200,12 @@ Elf_Addr link_elf_get_gp(linker_file_t);
*/
extern struct _dynamic _DYNAMIC;
static void
link_elf_error(const char *s)
{
printf("kldload: %s\n", s);
}
static void
link_elf_init(void* arg)
{
@ -378,46 +413,6 @@ parse_dynamic(elf_file_t ef)
return 0;
}
static void
link_elf_error(const char *s)
{
printf("kldload: %s\n", s);
}
#ifdef DDB
static void
link_elf_add_gdb(struct link_map *l)
{
struct link_map *prev;
/*
* Scan to the end of the list.
*/
for (prev = r_debug.r_map; prev->l_next != NULL; prev = prev->l_next)
;
/* Link in the new entry. */
l->l_prev = prev;
l->l_next = prev->l_next;
prev->l_next = l;
}
static void
link_elf_delete_gdb(struct link_map *l)
{
if (l->l_prev == NULL) {
if ((r_debug.r_map = l->l_next) != NULL)
l->l_next->l_prev = NULL;
return;
}
if ((l->l_prev->l_next = l->l_next) != NULL)
l->l_next->l_prev = l->l_prev;
}
#endif /* DDB */
static int
link_elf_link_preload(linker_class_t cls,
const char* filename, linker_file_t *result)

View File

@ -160,7 +160,36 @@ r_debug_state(struct r_debug *dummy_one __unused,
{
}
#endif
static void
link_elf_add_gdb(struct link_map *l)
{
struct link_map *prev;
/*
* Scan to the end of the list.
*/
for (prev = r_debug.r_map; prev->l_next != NULL; prev = prev->l_next)
;
/* Link in the new entry. */
l->l_prev = prev;
l->l_next = prev->l_next;
prev->l_next = l;
}
static void
link_elf_delete_gdb(struct link_map *l)
{
if (l->l_prev == NULL) {
if ((r_debug.r_map = l->l_next) != NULL)
l->l_next->l_prev = NULL;
return;
}
if ((l->l_prev->l_next = l->l_next) != NULL)
l->l_next->l_prev = l->l_prev;
}
#endif /* DDB */
#ifdef __ia64__
Elf_Addr link_elf_get_gp(linker_file_t);
@ -171,6 +200,12 @@ Elf_Addr link_elf_get_gp(linker_file_t);
*/
extern struct _dynamic _DYNAMIC;
static void
link_elf_error(const char *s)
{
printf("kldload: %s\n", s);
}
static void
link_elf_init(void* arg)
{
@ -378,46 +413,6 @@ parse_dynamic(elf_file_t ef)
return 0;
}
static void
link_elf_error(const char *s)
{
printf("kldload: %s\n", s);
}
#ifdef DDB
static void
link_elf_add_gdb(struct link_map *l)
{
struct link_map *prev;
/*
* Scan to the end of the list.
*/
for (prev = r_debug.r_map; prev->l_next != NULL; prev = prev->l_next)
;
/* Link in the new entry. */
l->l_prev = prev;
l->l_next = prev->l_next;
prev->l_next = l;
}
static void
link_elf_delete_gdb(struct link_map *l)
{
if (l->l_prev == NULL) {
if ((r_debug.r_map = l->l_next) != NULL)
l->l_next->l_prev = NULL;
return;
}
if ((l->l_prev->l_next = l->l_next) != NULL)
l->l_next->l_prev = l->l_prev;
}
#endif /* DDB */
static int
link_elf_link_preload(linker_class_t cls,
const char* filename, linker_file_t *result)