Don't write to inferior_ptid in linux_get_siginfo_data
[deliverable/binutils-gdb.git] / sim / common / sim-utils.c
index 47bc84306fb1ebaafe95be2d05293ab2ebe470ac..d420f55d5150f0247c4ac20b0f598a9d8bfd5e31 100644 (file)
@@ -1,5 +1,5 @@
 /* Miscellaneous simulator utilities.
 /* Miscellaneous simulator utilities.
-   Copyright (C) 1997-2018 Free Software Foundation, Inc.
+   Copyright (C) 1997-2020 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
 This file is part of GDB, the GNU debugger.
    Contributed by Cygnus Support.
 
 This file is part of GDB, the GNU debugger.
@@ -263,11 +263,11 @@ sim_analyze_program (SIM_DESC sd, const char *prog_name, bfd *prog_bfd)
   STATE_START_ADDR (sd) = bfd_get_start_address (prog_bfd);
 
   for (s = prog_bfd->sections; s; s = s->next)
   STATE_START_ADDR (sd) = bfd_get_start_address (prog_bfd);
 
   for (s = prog_bfd->sections; s; s = s->next)
-    if (strcmp (bfd_get_section_name (prog_bfd, s), ".text") == 0)
+    if (strcmp (bfd_section_name (s), ".text") == 0)
       {
        STATE_TEXT_SECTION (sd) = s;
       {
        STATE_TEXT_SECTION (sd) = s;
-       STATE_TEXT_START (sd) = bfd_get_section_vma (prog_bfd, s);
-       STATE_TEXT_END (sd) = STATE_TEXT_START (sd) + bfd_section_size (prog_bfd, s);
+       STATE_TEXT_START (sd) = bfd_section_vma (s);
+       STATE_TEXT_END (sd) = STATE_TEXT_START (sd) + bfd_section_size (s);
        break;
       }
 
        break;
       }
 
@@ -355,8 +355,8 @@ map_to_str (unsigned map)
     case io_map: return "io";
     default:
       {
     case io_map: return "io";
     default:
       {
-       static char str[10];
-       sprintf (str, "(%ld)", (long) map);
+       static char str[16];
+       snprintf (str, sizeof(str), "(%ld)", (long) map);
        return str;
       }
     }
        return str;
       }
     }
@@ -385,8 +385,8 @@ access_to_str (unsigned access)
     case access_read_write_exec_io: return "read_write_exec_io";
     default:
       {
     case access_read_write_exec_io: return "read_write_exec_io";
     default:
       {
-       static char str[10];
-       sprintf (str, "(%ld)", (long) access);
+       static char str[16];
+       snprintf (str, sizeof(str), "(%ld)", (long) access);
        return str;
       }
     }
        return str;
       }
     }
This page took 0.023994 seconds and 4 git commands to generate.