[v2,1/2] gdb/testsuite: allowed for function_range to deal with mangled functions

Message ID 20221104154744.418906-2-blarsen@redhat.com
State Committed
Commit 2acccd0a59af7a04e341d31f68b370486d5fc474
Headers
Series Improve error messages with incomplete variables |

Commit Message

Guinevere Larsen Nov. 4, 2022, 3:47 p.m. UTC
  When calling get_func_info inside a test case, it would cause failures
if the function was printed using a C++ style mangled name. The current
patch fixes this by allowing for mangled names along with the current
rules.
---
 gdb/testsuite/lib/dwarf.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Tom Tromey Nov. 9, 2022, 5:15 p.m. UTC | #1
>>>>> "Bruno" == Bruno Larsen via Gdb-patches <gdb-patches@sourceware.org> writes:

Bruno> When calling get_func_info inside a test case, it would cause failures
Bruno> if the function was printed using a C++ style mangled name. The current
Bruno> patch fixes this by allowing for mangled names along with the current
Bruno> rules.

Looks good.  Thank you.

Tom
  
Guinevere Larsen Nov. 10, 2022, 11:41 a.m. UTC | #2
On 09/11/2022 18:15, Tom Tromey wrote:
>>>>>> "Bruno" == Bruno Larsen via Gdb-patches <gdb-patches@sourceware.org> writes:
> Bruno> When calling get_func_info inside a test case, it would cause failures
> Bruno> if the function was printed using a C++ style mangled name. The current
> Bruno> patch fixes this by allowing for mangled names along with the current
> Bruno> rules.
>
> Looks good.  Thank you.
Thanks for the review. Which email should I add to the Approved-by tag?
  
Tom Tromey Nov. 10, 2022, 1:44 p.m. UTC | #3
Bruno> Thanks for the review. Which email should I add to the Approved-by tag?

It's not super important to me but I guess as a rule of thumb it seems
safe to use whatever address the approval is sent from.

Tom
  
Guinevere Larsen Nov. 10, 2022, 1:52 p.m. UTC | #4
On 10/11/2022 14:44, Tom Tromey wrote:
> Bruno> Thanks for the review. Which email should I add to the Approved-by tag?
>
> It's not super important to me but I guess as a rule of thumb it seems
> safe to use whatever address the approval is sent from.

Thanks, I pushed the whole series!
  

Patch

diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index b843b1acf75..9df8e7f9bdc 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -400,7 +400,7 @@  proc function_range { func src {options {debug}} } {
     if { $func_length != 0 } {
 	set func_pattern "$func_pattern\\+$func_length"
     }
-    set test "x/2i $func+$func_length"
+    set test "with print asm-demangle on -- x/2i $func+$func_length"
     gdb_test_multiple $test $test {
 	-re ".*($hex) <$func_pattern>:\[^\r\n\]+\r\n\[ \]+($hex).*\.\r\n$gdb_prompt $" {
 	    set start $expect_out(1,string)