This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix gdb.base/shreloc.exp: (msymbol) relocated functions have different addresses fail in cygwin

Hi Yao,

Thanks for your review.

On 09/12/13 14:49, Yao Qi wrote:
On 09/12/2013 02:31 PM, Hui Zhu wrote:
-proc get_msym_addrs { var msymfile } {
+proc get_msym_addrs { var msymfile { plus_var "" } } {

'plus_var' is not good candidate for parameter name.  I'd call it 'mst'
or 'msym_type'.


      # Extract the list of values for symbols matching var in the
      # minimal symbol output file

      global gdb_prompt hex
      set result ""

-    send_gdb "shell grep -E \" ${var}(\[ \t\]+.*)?\$\" ${msymfile}\n"
+    if { "${plus_var}" == "" } {
+    send_gdb "shell grep -E \" ${var}(\[ \t\]+.*)?\$\" ${msymfile}\n"
+    } else {
+    send_gdb "shell grep -E \" ${plus_var} .* ${var}(\[ \t\]+.*)?\$\" ${msymfile}\n"
+    }

This condition checking is not necessary, we can do

   send_gdb "shell grep -E \"${plus_var} ${var}(\[ \t\]+.*)?\$\" ${msymfile}\n"

Because for the output format is: [ 7] T 0x2aaaaacd058a fn_1 section .text  shreloc1.c
It need a ".*" after "T".  So I change "T" to "T.*" to handle it.

Post a new version according to your comments.


2013-09-12  Hui Zhu  <>

	* gdb.base/shreloc.exp (get_msym_addrs): Add argument "msym_type".
	(check_different): Ditto.
	((msymbol) relocated functions have different addresses): Add
	argument 'T.*' when call check_different.

Attachment: fix-cygwin-shreloc.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]