[PATCH 4/11] Fix percpu handling for symbols without debuginfo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When trying to show a percpu symbol without debuginfo, crash fails like
this:

crash> p fcoe_percpu:0
p: gdb request failed: p *(<data variable, no debug info>*)
0xffff88011e2d4900

This is because gdb does not really fail if the type is unknown:

crash> gdb whatis fcoe_percpu
type = <data variable, no debug info>
crash> gdb info variables fcoe_percpu
All variables matching regular expression "fcoe_percpu":
 
Non-debugging symbols:
0x0000000000014900  fcoe_percpu

Of course, the actual contents cannot be shown in this case, but crash
should at least display the address:
 
crash> p fcoe_percpu:0
&per_cpu(fcoe_percpu, 0) = $1 = (void *) 0xffff88011e214900

Signed-off-by: Petr Tesarik <ptesarik@xxxxxxx>
[PATCH 4/11] Fix percpu handling for symbols without debuginfo

When trying to show a percpu symbol without debuginfo, crash fails like
this:

crash> p fcoe_percpu:0
p: gdb request failed: p *(<data variable, no debug info>*) 0xffff88011e2d4900

This is because gdb does not really fail if the type is unknown:

crash> gdb whatis fcoe_percpu
type = <data variable, no debug info>
crash> gdb info variables fcoe_percpu
All variables matching regular expression "fcoe_percpu":

Non-debugging symbols:
0x0000000000014900  fcoe_percpu

Of course, the actual contents cannot be shown in this case, but crash should
at least display the address:

crash> p fcoe_percpu:0
&per_cpu(fcoe_percpu, 0) = $1 = (void *) 0xffff88011e214900

Signed-off-by: Petr Tesarik <ptesarik@xxxxxxx>

---
 symbols.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/symbols.c
+++ b/symbols.c
@@ -6535,6 +6535,9 @@ expr_type_name(const char *expr)
 
 	if (p) {
 		size_t len = strlen(clean_line(p));
+		/* GDB reports unknown types as <...descriptive text...> */
+		if (p[0] == '<' && p[len-1] == '>')
+			return NULL;
 		return strcpy(GETBUF(len + 1), p);
 	}
 	return NULL;
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux