[binutils-gdb] Constify main_name

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[binutils-gdb] Constify main_name

gdb-buildbot
*** TEST RESULTS FOR COMMIT cd215b2eb74c179d936a3b28577753a08de1cf83 ***

commit cd215b2eb74c179d936a3b28577753a08de1cf83
Author:     Tom Tromey <[hidden email]>
AuthorDate: Thu Jul 18 09:29:15 2019 -0600
Commit:     Tom Tromey <[hidden email]>
CommitDate: Thu Jul 18 09:31:12 2019 -0600

    Constify main_name
   
    This patch constifies the return type of main_name.  There is a
    comment indicating that this wasn't possible at some point in the
    past, but whatever the barrier was, it is gone now.
   
    Tested by rebuilding.
   
    gdb/ChangeLog
    2019-07-18  Tom Tromey  <[hidden email]>
   
            * symtab.c (main_name): Constify return type.
            * symfile.c (set_initial_language): Update.
            * symtab.h (main_name): Constify return type.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 175aa92a57..fa669daa4b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2019-07-18  Tom Tromey  <[hidden email]>
+
+ * symtab.c (main_name): Constify return type.
+ * symfile.c (set_initial_language): Update.
+ * symtab.h (main_name): Constify return type.
+
 2019-07-17  Tom Tromey  <[hidden email]>
 
  * tui/tui-winsource.c (tui_update_source_window)
diff --git a/gdb/symfile.c b/gdb/symfile.c
index d2b88fc9e4..c70a5ce34e 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1706,7 +1706,7 @@ set_initial_language (void)
 
   if (lang == language_unknown)
     {
-      char *name = main_name ();
+      const char *name = main_name ();
       struct symbol *sym = lookup_symbol (name, NULL, VAR_DOMAIN, NULL).symbol;
 
       if (sym != NULL)
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 41898992c1..719e5b2ee9 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -5741,8 +5741,10 @@ find_main_name (void)
   set_main_name ("main", language_unknown);
 }
 
-char *
-main_name (void)
+/* See symtab.h.  */
+
+const char *
+main_name ()
 {
   struct main_info *info = get_main_info ();
 
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 6780fa37be..b91454c85c 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -2041,11 +2041,8 @@ extern std::vector<symbol_search> search_symbols (const char *,
 extern bool treg_matches_sym_type_name (const compiled_regex &treg,
  const struct symbol *sym);
 
-/* The name of the ``main'' function.
-   FIXME: cagney/2001-03-20: Can't make main_name() const since some
-   of the calling code currently assumes that the string isn't
-   const.  */
-extern /*const */ char *main_name (void);
+/* The name of the ``main'' function.  */
+extern const char *main_name ();
 extern enum language main_language (void);
 
 /* Lookup symbol NAME from DOMAIN in MAIN_OBJFILE's global blocks.
Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-i686, branch master

gdb-buildbot
Buildername:
        Fedora-i686

Worker:
        fedora-x86-64-4

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/18/builds/336

Author:
        Tom Tromey <[hidden email]>

Commit tested:
        cd215b2eb74c179d936a3b28577753a08de1cf83

Subject of commit:
        Constify main_name

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-i686/cd/cd215b2eb74c179d936a3b28577753a08de1cf83/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=0: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-i686/cd/cd215b2eb74c179d936a3b28577753a08de1cf83//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-i686/cd/cd215b2eb74c179d936a3b28577753a08de1cf83//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-cc-with-index, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-cc-with-index

Worker:
        fedora-x86-64-1

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/20/builds/335

Author:
        Tom Tromey <[hidden email]>

Commit tested:
        cd215b2eb74c179d936a3b28577753a08de1cf83

Subject of commit:
        Constify main_name

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-cc-with-index/cd/cd215b2eb74c179d936a3b28577753a08de1cf83/

*** Diff to previous build ***
==============================================
PASS -> FAIL: gdb.base/continue-all-already-running.exp: breakpoint hit
PASS -> FAIL: gdb.base/dprintf-non-stop.exp: inferior stopped
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=1: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-cc-with-index/cd/cd215b2eb74c179d936a3b28577753a08de1cf83//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-cc-with-index/cd/cd215b2eb74c179d936a3b28577753a08de1cf83//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-m64, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-m64

Worker:
        fedora-x86-64-2

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/3/builds/358

Author:
        Tom Tromey <[hidden email]>

Commit tested:
        cd215b2eb74c179d936a3b28577753a08de1cf83

Subject of commit:
        Constify main_name

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-m64/cd/cd215b2eb74c179d936a3b28577753a08de1cf83/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/non-ldr-exit.exp: program exits normally
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m64/cd/cd215b2eb74c179d936a3b28577753a08de1cf83//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m64/cd/cd215b2eb74c179d936a3b28577753a08de1cf83//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-gdbserver-m32, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-native-gdbserver-m32

Worker:
        fedora-x86-64-3

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/24/builds/333

Author:
        Tom Tromey <[hidden email]>

Commit tested:
        cd215b2eb74c179d936a3b28577753a08de1cf83

Subject of commit:
        Constify main_name

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-gdbserver-m32/cd/cd215b2eb74c179d936a3b28577753a08de1cf83/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-gdbserver-m32/cd/cd215b2eb74c179d936a3b28577753a08de1cf83//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-gdbserver-m32/cd/cd215b2eb74c179d936a3b28577753a08de1cf83//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-native-extended-gdbserver-m64

Worker:
        fedora-x86-64-1

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/2/builds/335

Author:
        Tom Tromey <[hidden email]>

Commit tested:
        cd215b2eb74c179d936a3b28577753a08de1cf83

Subject of commit:
        Constify main_name

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m64/cd/cd215b2eb74c179d936a3b28577753a08de1cf83/

*** Diff to previous build ***
==============================================
FAIL -> UNRESOLVED: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=main: force-fail=1: run failure detected
FAIL -> UNRESOLVED: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=separate: force-fail=1: run failure detected
FAIL -> UNRESOLVED: gdb.mi/mi-exec-run.exp: inferior-tty=separate: mi=main: force-fail=1: run failure detected
FAIL -> UNRESOLVED: gdb.mi/mi-exec-run.exp: inferior-tty=separate: mi=separate: force-fail=1: run failure detected
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=0: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m64/cd/cd215b2eb74c179d936a3b28577753a08de1cf83//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m64/cd/cd215b2eb74c179d936a3b28577753a08de1cf83//xfail.table.gz>