aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi/basics.c
AgeCommit message (Collapse)AuthorFilesLines
2019-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
This commit applies all changes made after running the gdb/copyright.py script. Note that one file was flagged by the script, due to an invalid copyright header (gdb/unittests/basic_string_view/element_access/char/empty.cc). As the file was copied from GCC's libstdc++-v3 testsuite, this commit leaves this file untouched for the time being; a patch to fix the header was sent to gcc-patches first. gdb/ChangeLog: Update copyright year range in all GDB files.
2018-01-21gdb: PR mi/20395: Fix -var-update for registers in frames 1 and upAndrew Burgess1-0/+2
This patch fixes a problem with using the MI -var-update command to access the values of registers in frames other than the current frame. The patch includes a test that demonstrates the problem: * run so there are several frames on the stack * create a fixed varobj for $pc in each frame, #'s 1 and above * step one instruction, to modify the value of $pc * call -var-update for each of the previously created varobjs to verify that they are not reported as having changed. Without the patch, the -var-update command reported that $pc for all frames 1 and above had changed to the value of $pc in frame 0. A varobj is created as either fixed, the expression is evaluated within the context of a specific frame, or floating, the expression is evaluated within the current frame, whatever that may be. When a varobj is created by -var-create we set two fields of the varobj to track the context in which the varobj was created, these two fields are varobj->root->frame and var->root->valid_block. If a varobj is of type fixed, then, when we subsequently try to reevaluate the expression associated with the varobj we must determine if the original frame (and block) is still available, if it is not then the varobj can no longer be evaluated. The problem is that for register expressions varobj->root->valid_block is not set correctly. This block tracking is done using the global 'innermost_block' which is set in the various parser files (for example c-exp.y). However, this is not set for register expressions. The fix then seems like it should be to just update the innermost block when parsing register expressions, however, that solution causes several test regressions. The problem is that in some cases we rely on the expression parsing code not updating the innermost block for registers, one example is when we parse the expression for a 'display' command. The display commands treats registers like floating varobjs, but symbols are treated like fixed varobjs. So 'display $reg_name' will always show the value of '$reg_name' even as the user moves from frame to frame, while 'display my_variable' will only show 'my_variable' while it is in the current frame and/or block, when the user moves to a new frame and/or block (even one with a different 'my_variable' in) then the display of 'my_variable' stops. For the case of 'display', without the option to force fixed or floating expressions, the current behaviour is probably the best choice. For the varobj system though, we can choose between floating and fixed, and we should try to make this work for registers. There's only one existing test case that needs to be updated, in that test a fixed varobj is created using a register, the MI output now include the thread-id in which the varobj should be evaluated, which I believe is correct behaviour. I also added a new floating test case into the same test script, however, right now this also includes the thread-id in the expected output, which I believe is an existing gdb bug, which I plan to fix next. Tested on x86_64 Linux native and native-gdbserver, no regressions. gdb/ChangeLog: PR mi/20395 * ada-exp.y (write_var_from_sym): Pass extra parameter when updating innermost block. * parse.c (innermost_block_tracker::update): Take extra type parameter, and check types match before updating innermost block. (write_dollar_variable): Update innermost block for registers. * parser-defs.h (enum innermost_block_tracker_type): New enum. (innermost_block_tracker::innermost_block_tracker): Initialise m_types member. (innermost_block_tracker::reset): Take type parameter. (innermost_block_tracker::update): Take type parameter, and pass type through as needed. (innermost_block_tracker::m_types): New member. * varobj.c (varobj_create): Pass type when reseting innermost block. gdb/testsuite/ChangeLog: * gdb.mi/basics.c: Add new global. * gdb.mi/mi-frame-regs.exp: New file. * gdb.mi/mi-var-create-rtti.exp: Update expected results, add new case.
2018-01-02Update copyright year range in all GDB filesJoel Brobecker1-1/+1
gdb/ChangeLog: Update copyright year range in all GDB files
2017-01-01update copyright year range in GDB filesJoel Brobecker1-1/+1
This applies the second part of GDB's End of Year Procedure, which updates the copyright year range in all of GDB's files. gdb/ChangeLog: Update copyright year range in all GDB files.
2016-01-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2015-01-01Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2014-08-25Fix clang compilation errors in gdb.mi/basics.c.Doug Evans1-4/+4
gdb/testsuite/ChangeLog: * gdb.mi/basics.c (callee3, callee2, callee1): Specify result type. (main): Ditto.
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker1-1/+1
2013-01-01Update years in copyright notice for the GDB files.Joel Brobecker1-1/+1
Two modifications: 1. The addition of 2013 to the copyright year range for every file; 2. The use of a single year range, instead of potentially multiple year ranges, as approved by the FSF.
2012-01-04Copyright year update in most files of the GDB Project.Joel Brobecker1-2/+1
gdb/ChangeLog: Copyright year update in most files of the GDB Project.
2012-01-02Update the copyright header of various files...Joel Brobecker1-1/+1
... to follow the correct syntax (according to the gospel of gnulib's update-copyright). In other words: - no comma after the last year; - FSF spelled exactly "Free Software Foundation, Inc.", with the comma and the period at the end. sim/common/ChangeLog: * dv-sockser.h, sim-assert.h, sim-fpu.c: Reformat the copyright header. sim/m32c/ChangeLog: * blinky.S, gloss.S, sample.S: Reformat copyright header. sim/mn10300/ChangeLog: * sim-main.h: Reformat copyright header. sim/ppc/ChangeLog: * dp-bit.c: Reformat copyright header. gdb/ChangeLog: * gdb/common/gdb_thread_db.h, gdb/dbxread.c, gdb/environ.c, gdb/gcore.h, gdb/rs6000-tdep.h, gdb/s390-nat.c, gdb/tic6x-tdep.c: Reformat the copyright header. gdb/gdbserver/ChangeLog: * terminal.h: Reformat copyright header. gdb/testsuite/ChangeLog: * dg-extract-results.sh, gdb.arch/gcore.c, gdb.arch/gdb1558.c, gdb.arch/i386-gnu-cfi.c, gdb.base/complex.c, gdb.base/cvexpr.c, gdb.base/gcore.c, gdb.base/gdb1555-main.c, gdb.base/gdb1555.c, gdb.base/gdb1821.c, gdb.base/long_long.c, gdb.base/restore.c, gdb.base/sepdebug.c, gdb.base/type-opaque-lib.c, gdb.base/type-opaque-main.c, gdb.cp/maint.exp, gdb.cp/namespace1.cc, gdb.cp/pr9631.cc, gdb.cp/psmang1.cc, gdb.cp/psmang2.cc, gdb.cp/try_catch.cc, gdb.cp/virtfunc.cc, gdb.hp/gdb.base-hp/reg.exp, gdb.mi/basics.c, gdb.mi/mi-stack.c, gdb.mi/mi-var-child.c, gdb.mi/mi2-var-child.exp, gdb.mi/var-cmd.c, gdb.threads/thread_check.c: Reformat copyright header.
2011-05-202011-05-20 Pedro Alves <pedro@codesourcery.com>Pedro Alves1-4/+0
gdb/testsuite/ * gdb.mi/basics.c: Don't include stdio.h or unistd.h. (callme): Remove printf call.
2011-01-01run copyright.sh for 2011.Joel Brobecker1-1/+1
2010-01-01Update copyright year in most headers.Joel Brobecker1-1/+2
Automatic update by copyright.sh.
2009-04-03 Eliminate some sleep usage.Vladimir Prus1-2/+5
* gdb.mi/basics.c (do_nothing): New. (main): Use do_nothing instead of printf, so that not to introduce race condition between output of inferiour and output of gdb. Do not use sleep as it is not generally available on embedded targets.
2009-01-03 Updated copyright notices for most files.Joel Brobecker1-1/+1
2008-06-13 Robustify mi-simplerun.Vladimir Prus1-7/+2
* gdb.mi/basics.c (main): Add a call to sleep. * gdb.mi/mi-cli.exp: Adjust for change in line numbers. * gdb.mi/mi2-cli.exp: Likewise. * gdb.mi/mi-break.exp: Likewise.
2008-02-01 * breakpoint.c (break_command_1): Return void.Vladimir Prus1-0/+5
(break_command_really): Return void. Rethrow exceptions instead of returning. (gdb_breakpoint): Remove the error_message parameter. Return void. Rename to set_breakpoint. * gdb.h (gdb_breakpoint): Rename and move to... * breakpoint.h (set_breakpoint): ...here. * mi/mi-cmb-break.c (mi_cmd_break_insert): Restore event hooks even if exception is thrown. Adjust to gdb_breakpoint interface changes.
2008-01-22 * breakpoint.c (break_command_really): New parameterVladimir Prus1-0/+8
ignore_count. (break_command_1): Pass 0 as ignore_count to break_command_really. (gdb_breakpoint): Pass ignore_count to break_command_really.
2008-01-01 Updated copyright notices for most files.Daniel Jacobowitz1-1/+1
2007-08-23 Switch the license of all .c files to GPLv3.Joel Brobecker1-9/+7
Switch the license of all .h files to GPLv3. Switch the license of all .cc files to GPLv3.
2007-01-09Copyright updates for 2007.Daniel Jacobowitz1-2/+1
2005-07-31 * gdb.mi/basics.c, gdb.mi/var-cmd.c: Revert last change.Daniel Jacobowitz1-2/+1
* gdb.mi/mi-stack.c: New file, based on gdb.mi/basics.c. * gdb.mi/mi-var-child.c: New file, based on gdb.mi/var-cmd.c. * gdb.mi/mi-stack.exp: Update to use mi-stack.c as a source file. * gdb.mi/mi-var-child.exp: Update to use mi-var-child.c as a source file.
2005-07-27* gdb.mi/var-cmd.c: Give long_array in _struct_decl 12 elements.Nick Roberts1-1/+2
(do_children_tests): Assign values to the extra elements. * gdb.mi/mi-var-child.exp: Adapt tests for extra elements and use them for tests for "-var-update --no-values" and "-var-update --all-values". Add test for "-var-list-children --simple-values". * gdb.mi/basics.c (callee4): Add integer array D[3]... * gdb.mi/mi-stack.exp (test_stack_locals_listing): ...to test "-stack-list-locals --simple-values" Improve doc strings and comments.
2004-08-262004-08-26 Michael Chastain <mec.gnu@mindspring.com>Michael Chastain1-1/+3
* gdb.mi/basics.c: Include <stdio.h>. * gdb.mi/pthreads.c: Include <stdlib.h>. * gdb.mi/var-cmd.c: Include <stdlib.h>.
2004-08-252004-08-24 Michael Chastain <mec.gnu@mindspring.com>Michael Chastain1-0/+20
* gdb.mi/basics.c: Add copyright notice. * gdb.mi/var-cmd.c: Add copyright notice.
2000-03-14Point MI testsuite files at MI testsuite ChangeLog.Andrew Cagney1-1/+5
2000-03-062000-03-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>Elena Zannoni1-2/+2
* mi-disassemble.exp: Don't assume numbers for the offset values. They can be different depending on the architecture. * mi-watch.exp (test_watchpoint_triggering): In same cases the type can be 'hw wathcpoint' not just 'watchpoint'. Adjust for that. * basics.c (callee4): Make the function return something, otherwise the return value is undefined.
2000-02-23Add mi/ and testsuite/gdb.mi/ subdirectories.Andrew Cagney1-0/+41
Add --enable-gdbmi option to configury. Add mi rules to Makefile.in Add mi conditional output to event-top.c infrun.c main.c top.c. Add -i=mi option.