+2018-01-19 Tom Tromey <tom@tromey.com>
+
+ * rust-lang.c (rust_lookup_symbol_nonlocal): Look up qualified
+ symbols in the static and global blocks.
+
2018-01-19 James Clarke <jrtc27@jrtc27.com>
* nat/linux-ptrace.c: Remove unnecessary reinclusion of
}
/* Look up bare names in the block's scope. */
+ std::string scopedname;
if (name[cp_find_first_component (name)] == '\0')
{
const char *scope = block_scope (block);
if (scope[0] != '\0')
{
- std::string scopedname = std::string (scope) + "::" + name;
-
- result = lookup_symbol_in_static_block (scopedname.c_str (), block,
- domain);
- if (result.symbol == NULL)
- result = lookup_global_symbol (scopedname.c_str (), block, domain);
+ scopedname = std::string (scope) + "::" + name;
+ name = scopedname.c_str ();
}
+ else
+ name = NULL;
+ }
+
+ if (name != NULL)
+ {
+ result = lookup_symbol_in_static_block (name, block, domain);
+ if (result.symbol == NULL)
+ result = lookup_global_symbol (name, block, domain);
}
return result;
}
+2018-01-19 Tom Tromey <tom@tromey.com>
+
+ * gdb.rust/modules.rs (TWENTY_THREE): New global.
+ * gdb.rust/modules.exp: Add ::-qualified lookup test.
+
2018-01-19 Andreas Arnez <arnez@linux.vnet.ibm.com>
* gdb.arch/s390-vregs.exp: Explicitly cast the return values of
println!("::f2");
}
+// See https://github.com/rust-lang/rust/pull/46457
+#[no_mangle]
+pub static TWENTY_THREE : u16 = 23;
+
pub struct Generic<T>(T);
pub struct Type;
let f2 = || println!("lambda f2");
+ let copy = ::TWENTY_THREE;
+
f2(); // set breakpoint here
f3();
self::f2();