From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25051 invoked by alias); 16 Dec 2002 16:25:36 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 24993 invoked from network); 16 Dec 2002 16:25:34 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 16 Dec 2002 16:25:34 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 3B2683CBB; Mon, 16 Dec 2002 11:25:32 -0500 (EST) Message-ID: <3DFDFE7C.3060100@redhat.com> Date: Mon, 16 Dec 2002 08:31:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.1) Gecko/20021211 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Snyder Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] improved error message References: <200212132326.gBDNQdAm009198@to-limbo.toronto.redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-12/txt/msg00469.txt.bz2 > There are like five places in thread-db.c that all give the same > error message. This just adds the function name, so you have a > chance of figuring out where the error occurred. > > 2002-12-13 Michael Snyder > > * thread-db.c (thread_from_lwp): Uniquify error msg. > (lwp_from_thread): Ditto. > (check_event): Ditto. > (find_new_threads_callback): Ditto. > (thread_db_pid_to_str): Ditto. Er, this looks wrong. A normal user visible error message should not include references to internal function names. Can you either reword the messages or, perhaphs, add a debug mode that displys this additional information? Andrew > Index: thread-db.c > =================================================================== > RCS file: /cvs/src/src/gdb/thread-db.c,v > retrieving revision 1.25 > diff -p -r1.25 thread-db.c > *** thread-db.c 23 Nov 2002 01:34:43 -0000 1.25 > --- thread-db.c 13 Dec 2002 23:20:49 -0000 > *************** thread_from_lwp (ptid_t ptid) > *** 250,256 **** > > err = td_thr_get_info_p (&th, &ti); > if (err != TD_OK) > ! error ("Cannot get thread info: %s", thread_db_err_str (err)); > > return BUILD_THREAD (ti.ti_tid, GET_PID (ptid)); > } > --- 250,257 ---- > > err = td_thr_get_info_p (&th, &ti); > if (err != TD_OK) > ! error ("thread_from_lwp: cannot get thread info: %s", > ! thread_db_err_str (err)); > > return BUILD_THREAD (ti.ti_tid, GET_PID (ptid)); > } > *************** lwp_from_thread (ptid_t ptid) > *** 272,278 **** > > err = td_thr_get_info_p (&th, &ti); > if (err != TD_OK) > ! error ("Cannot get thread info: %s", thread_db_err_str (err)); > > return BUILD_LWP (ti.ti_lid, GET_PID (ptid)); > } > --- 273,280 ---- > > err = td_thr_get_info_p (&th, &ti); > if (err != TD_OK) > ! error ("lwp_from_thread: cannot get thread info: %s", > ! thread_db_err_str (err)); > > return BUILD_LWP (ti.ti_lid, GET_PID (ptid)); > } > *************** check_event (ptid_t ptid) > *** 685,691 **** > > err = td_thr_get_info_p (msg.th_p, &ti); > if (err != TD_OK) > ! error ("Cannot get thread info: %s", thread_db_err_str (err)); > > ptid = BUILD_THREAD (ti.ti_tid, GET_PID (ptid)); > > --- 687,694 ---- > > err = td_thr_get_info_p (msg.th_p, &ti); > if (err != TD_OK) > ! error ("check_event: cannot get thread info: %s", > ! thread_db_err_str (err)); > > ptid = BUILD_THREAD (ti.ti_tid, GET_PID (ptid)); > > *************** find_new_threads_callback (const td_thrh > *** 950,956 **** > > err = td_thr_get_info_p (th_p, &ti); > if (err != TD_OK) > ! error ("Cannot get thread info: %s", thread_db_err_str (err)); > > if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE) > return 0; /* A zombie -- ignore. */ > --- 953,960 ---- > > err = td_thr_get_info_p (th_p, &ti); > if (err != TD_OK) > ! error ("find_new_threads_callback: cannot get thread info: %s", > ! thread_db_err_str (err)); > > if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE) > return 0; /* A zombie -- ignore. */ > *************** thread_db_pid_to_str (ptid_t ptid) > *** 993,999 **** > > err = td_thr_get_info_p (&th, &ti); > if (err != TD_OK) > ! error ("Cannot get thread info for thread %ld: %s", > (long) GET_THREAD (ptid), thread_db_err_str (err)); > > if (ti.ti_state == TD_THR_ACTIVE && ti.ti_lid != 0) > --- 997,1003 ---- > > err = td_thr_get_info_p (&th, &ti); > if (err != TD_OK) > ! error ("thread_db_pid_to_str: cannot get thread info for %ld: %s", > (long) GET_THREAD (ptid), thread_db_err_str (err)); > > if (ti.ti_state == TD_THR_ACTIVE && ti.ti_lid != 0) >