This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH] fix PR-12417
- From: "Agovic, Sanimir" <sanimir dot agovic at intel dot com>
- To: 'Mohsan Saleem' <mohsansaleem_ms at yahoo dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 4 Sep 2013 12:24:35 +0000
- Subject: RE: [PATCH] fix PR-12417
- Authentication-results: sourceware.org; auth=none
- References: <521E2414 dot 40602 at codesourcery dot com> <52254BC6 dot 1050105 at codesourcery dot com> <1378282781 dot 96893 dot YahooMailNeo at web142604 dot mail dot bf1 dot yahoo dot com> <0377C58828D86C4588AEEC42FC3B85A71766C229 at IRSMSX105 dot ger dot corp dot intel dot com> <1378293943 dot 43616 dot YahooMailNeo at web142603 dot mail dot bf1 dot yahoo dot com>
Thanks for taking care of my comments.
+const char *
+thread_name (struct thread_info *ti)
+{
+ const char *name;
+
+ name = ti->name != NULL ? ti->name : target_thread_name (ti);
+ return name != NULL ? name : "";
+}
Imho, we must always call target_thread_name to get the latest thread name.
> -----Original Message-----
> From: Mohsan Saleem [mailto:mohsansaleem_ms@yahoo.com]
> Sent: Wednesday, September 04, 2013 01:26 PM
> To: Agovic, Sanimir
> Cc: gdb-patches@sourceware.org
> Subject: Re: [PATCH] fix PR-12417
>
> >> if (print_thread_events)
> >> - printf_unfiltered (_("[New %s]\n"), target_pid_to_str (ptid));
> >> + printf_unfiltered (_("[New %s \"%s\"]\n"), target_pid_to_str (ptid), thread_name
> >>
>
> >This will print [New 1234 ""] in case a thread name is not available, not sure if we
> >should omit thread name instead.
>
> As when a new thread is created then by default program name is assigned to it. So it will
> print [New 1234 "a.out"], if program is named as "a.out"
>
I see, just was curious if one might see an empty quoted string.
-Sanimir
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052