Constify arguments of gdb_bfd_lookup_symbol and related functions
Fixes this error: /home/pedro/gdb/mygit/src/gdb/solib-frv.c: In function ‘int enable_break2()’: /home/pedro/gdb/mygit/src/gdb/solib-frv.c:622:72: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive] addr = gdb_bfd_lookup_symbol (tmp_bfd, cmp_name, "_dl_debug_addr"); ^ In file included from /home/pedro/gdb/mygit/src/gdb/solib-frv.c:23:0: /home/pedro/gdb/mygit/src/gdb/solib.h:82:18: error: initializing argument 3 of ‘CORE_ADDR gdb_bfd_lookup_symbol(bfd*, int (*)(asymbol*, void*), void*)’ [-fpermissive] extern CORE_ADDR gdb_bfd_lookup_symbol (bfd *abfd, ^ The call in question is: addr = gdb_bfd_lookup_symbol (tmp_bfd, cmp_name, "_dl_debug_addr"); gdb/ChangeLog: * solib-dsbt.c (cmp_name): Constify arguments. * solib-frv.c (cmp_name): Likewise. * solib-svr4.c (svr4_create_solib_event_breakpoints): Likewise. * solib.c (gdb_bfd_lookup_symbol_from_symtab): Likewise. (bfd_lookup_symbol_from_dyn_symtab): Likewise. (gdb_bfd_lookup_symbol): Likewise. * solib.h (gdb_bfd_lookup_symbol): Likewise. (gdb_bfd_lookup_symbol_from_symtab): Likewise.
This commit is contained in:
parent
01f573ad8a
commit
3953f15ce4
6 changed files with 30 additions and 15 deletions
|
@ -2220,7 +2220,7 @@ svr4_create_solib_event_breakpoints (struct gdbarch *gdbarch,
|
|||
/* Helper function for gdb_bfd_lookup_symbol. */
|
||||
|
||||
static int
|
||||
cmp_name_and_sec_flags (asymbol *sym, void *data)
|
||||
cmp_name_and_sec_flags (const asymbol *sym, const void *data)
|
||||
{
|
||||
return (strcmp (sym->name, (const char *) data) == 0
|
||||
&& (sym->section->flags & (SEC_CODE | SEC_DATA)) != 0);
|
||||
|
@ -2480,7 +2480,7 @@ enable_break (struct svr4_info *info, int from_tty)
|
|||
for (bkpt_namep = solib_break_names; *bkpt_namep != NULL; bkpt_namep++)
|
||||
{
|
||||
sym_addr = gdb_bfd_lookup_symbol (tmp_bfd, cmp_name_and_sec_flags,
|
||||
(void *) *bkpt_namep);
|
||||
*bkpt_namep);
|
||||
if (sym_addr != 0)
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue