aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-05-26Enhance objdump's --private option so that it can display the contents of PE ↵Nick Clifton11-7/+670
format files. * od-pe.c: New file: Dumps fields in PE format headers. * configure.ac (od_vectors): Add objdump_private_desc_pe for PE format targets. (od_files): Add od-pe for PE format targets. * configure: Regenerate. * Makefile.am (CFILES): Add od-pe.c (EXTRA_objdump_SOURCE): Likewise. * Makefile.in: Generate. * NEWS: Mention the new feature. * doc/binutils.texi: Document the new support. * objdump.c (wide_output): Change from local to global. * objdump.h (wide_output): Prototype. (objdump_private_desc_pe): Prototype. * testsuite/binutils-all/objdump.exp: Add a test of the new feature.
2023-05-26Remove duplicate definitionAndreas Schwab2-2/+6
* coff/pe.h (IMAGE_FILE_MACHINE_AMD64): Remove duplicate definition. Alphabetize.
2023-05-26x86: fix disassembler build after 1a3b4f90bc5fJan Beulich1-1/+1
In commit 1a3b4f90bc5f ("x86: convert two pointers to (indexing) integers") I neglected the fact that compilers may warn about comparing ptrdiff_t (signed long) with size_t (unsigned long) values. Since just before we've checked that the value is positive, simply add a cast (despite my dislike for casts).
2023-05-26[gdb/testsuite] Add test-case gdb.tui/color-prompt.expTom de Vries3-3/+88
Add a test-case that sets a prompt with color in TUI. The line containing the prompt is shown by get_line_with_attrs as follows: ... <fg:31>(gdb) <fg:default> ... The 31 means red, but only for foreground colors, for background colors 41 means red. Make this more readable by using color names for both foreground and background, such that we have instead: .... <fg:red>(gdb) <fg:default> ... Tested on x86_64-linux.
2023-05-26[gdb/testsuite] Add invisible and blinking attributes in tuitermTom de Vries2-0/+22
I noticed curses using the invisible and blinking attributes. Add these in tuiterm. Tested on x86_64-linux.
2023-05-26[gdb/testsuite] Fix reverse attribute in tuitermTom de Vries2-1/+37
I noticed in proc Term::_csi_m arguments that while parameters 7 and 27 are supposed to set the reverse attribute to 1 and 0, in fact it's set to 1 in both cases: ... 7 { set _attrs(reverse) 1 } ... 27 { set _attrs(reverse) 1 } ... Fix this and add a regression test in gdb.tui/tuiterm.exp. Tested on x86_64-linux.
2023-05-26iamcu: suppress tests which can't possibly workJan Beulich1-18/+23
With neither --32 nor --64 passed to gas, advanced features like AVX aren't available without explicitly enabling them.
2023-05-26x86-64: improve gas diagnostic when no 32-bit target is configuredJan Beulich1-1/+15
Make this similar to --64 and --x32: Check whether a suitable target exists.
2023-05-26x86-64: conditionalize tests using --32Jan Beulich1-2/+12
Using this option doesn't really work when no support for any 32-bit target was configured in (as is the case for at least cloudabi and rdos).
2023-05-26x86: split gas testsuite .exp fileJan Beulich2-615/+647
The set of 32-bit-only and 64-bit-only tests has grown quite large. In particular when one's after only the results for the 64-bit set, having them live in a separate .exp file is easier / faster.
2023-05-26x86: convert two pointers to (indexing) integersJan Beulich1-16/+17
This in particular reduces the number of pointers to non-const that we have (and that could potentially be used for undue modification of state). As a result, fetch_code()'s 2nd parameter can then also become pointer-to-const.
2023-05-26x86: disassembling over-long insnsJan Beulich1-9/+10
The present way of dealing with them - misusing MAX_MNEM_SIZE, which has nothing to do with insn length - leads to inconsistent results. Since we allow for up to MAX_CODE_LENGTH - 1 prefix bytes (which then could be followed by another MAX_CODE_LENGTH "normal" insn bytes until we're done decoding), size the_buffer[] accordingly. Move struct dis_private down to be able to use MAX_CODE_LENGTH without moving its #define. While doing this also alter the order to have the potentially large array last.
2023-05-26x86: use fixed-width type for codep and friendsJan Beulich1-57/+55
This first of all removes a dependency on bfd_byte and unsigned char being the same types. It further eliminates the need to mask by 0xff when fetching values (which wasn't done fully consistently anyway), improving code legibility. While there, where possible add const.
2023-05-26x86: figure braces aren't really part of mnemonicsJan Beulich1-8/+24
Instead they're separators for pseudo-prefixes. Don't insert them in mnemonic_chars[], handling them explicitly in parse_insn() instead. Note that this eliminates the need for another separator after a pseudo- prefix. While maybe not overly interesting for a following real mnemonic, I view this as quite desirable between multiple successive pseudo-prefixes (bringing things in line with the other use of figure braces in AVX512's zeroing-masking). Drop the unused is_mnemonic_char() at this occasion.
2023-05-26x86: de-duplicate operand_special_chars[] wrt extra_symbol_chars[]Jan Beulich1-10/+7
Having to add characters to both arrays can easily lead to oversights. Consuming extra_symbol_chars[] when populating operand_chars[] also allows to drop two special cases in md_begin(). Constify operand_special_chars[] at this occasion.
2023-05-25sframe/doc: minor improvements for readabilityIndu Bhagat1-10/+10
libsframe/ * sframe-spec.texi: Cosmetic fixes.
2023-05-25libsframe: revisit sframe_find_fre APIIndu Bhagat1-34/+49
Inspite of implementing a rather simple functionality, this function was relatively difficult to follow, and maintain. Some changes are done now to address that - refactor the function and use better names to make it more readable. The changes to the implementation do not cause any change in the contract of the API. libsframe/ * sframe.c (sframe_fre_get_end_ip_offset): to here... (sframe_find_fre): Refactor some bits from...
2023-05-25libsframe: use const char * consistently for immutable FRE buffersIndu Bhagat1-13/+11
libsframe/ * sframe.c (sframe_decode_fre): Use const char * datatype when handling buffer containing the FREs. (sframe_fre_get_end_ip_offset): Likewise. (sframe_find_fre): Likewise. (sframe_decoder_get_fre): Likewise.
2023-05-25libsframe: use uint8_t data type for FRE info related stubsIndu Bhagat1-21/+20
libsframe/ * sframe.c: Use uint8_t for FRE offset count and FRE offset size. Use uint8_t for FRE info word as well.
2023-05-26PR22263 ld testAlan Modra1-3/+29
A number of targets that I test regularly fail the "Build pr22263-1" test for various reasons. arm-linux-gnueabi: "undefined reference to `__aeabi_read_tp'" ia64-linux-gnu: "Explicit stops are ignored in auto mode" m68k-linux-gnu: "undefined reference to `__m68k_read_tp'" microblaze-linux-gnu: "undefined reference to `__tls_get_addr'" nios2-linux-gnu, s390-linux-gnu and sh4-linux-gnu have a tprel reloc in .got riscv64-linux-gnu has a dynamic relocation in text So only riscv really fails the pr. The rest fail due to test issues or lack of a linker optimisation. Lack of an optimisation isn't really a fail, but it's worth keeping the test to ensure those optimisations don't regress. The xfail targets may not be an exhaustive list. This just tidies test results for those for which I have cross compilers installed. PR 22263 * testsuite/ld-elf/tls.exp: Split pr22263 test into two parts, one to check for -z text errors, the other to check tprel linker optimisation. Supply needed symbols and assembler flags. xfail the linker optimisation on targets known to fail.
2023-05-25Make MI commands const-correctTom Tromey16-187/+250
I've had this patch for a while now and figured I'd update it and send it. It changes MI commands to use a "const char * const" for their argv parameter. Regression tested on x86-64 Fedora 36. Acked-By: Simon Marchi <simon.marchi@efficios.com>
2023-05-26Automatic date update in version.inGDB Administrator1-1/+1
2023-05-25Fix scoped_value_mark not working with empty value chainCiaran Woodward1-2/+3
The scoped_value_mark helper class was setting its internal mark value to NULL to indicate that the value chain had already been freed to mark. However, value_mark() also returns NULL if the value chain is empty at the time of call. This lead to the situation that if the value chain was empty at the time the scoped_value_mark was created, the class would not correctly clean up the state when it was destroyed, because it believed it had already been freed. I noticed this because I was setting a watchpoint very early in my debug session, and it was becoming a software watchpoint rather than hardware. Running any command that called evaluate() beforehand (such as 'x 0') would mean that a hardware watchpoint was correctly used. After some careful examination of the differences in execution, I noticed that values were being freed later in the 'bad case', which lead me to notice the issue with scoped_value_mark.
2023-05-25gdb: remove breakpoint_pointer_iteratorSimon Marchi11-366/+360
Remove the breakpoint_pointer_iterator layer. Adjust all users of all_breakpoints and all_tracepoints to use references instead of pointers. Change-Id: I376826f812117cee1e6b199c384a10376973af5d Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-05-25gdbsupport: make filtered_iterator::operator* return the same thing as ↵Simon Marchi1-1/+6
underlying iterator This is the same idea as the previous patch, but for filtered_iterator. Without this patch, I would see this when applying the patch that removes reference_to_pointer_iterator from breakpoint_range: CXX breakpoint.o /home/smarchi/src/binutils-gdb/gdb/breakpoint.c: In function ‘void download_tracepoint_locations()’: /home/smarchi/src/binutils-gdb/gdb/breakpoint.c:11007:41: error: cannot allocate an object of abstract type ‘breakpoint’ 11007 | for (breakpoint &b : all_tracepoints ()) | ^ In file included from /home/smarchi/src/binutils-gdb/gdb/gdbthread.h:26, from /home/smarchi/src/binutils-gdb/gdb/infrun.h:21, from /home/smarchi/src/binutils-gdb/gdb/gdbarch.h:28, from /home/smarchi/src/binutils-gdb/gdb/arch-utils.h:23, from /home/smarchi/src/binutils-gdb/gdb/breakpoint.c:21: /home/smarchi/src/binutils-gdb/gdb/breakpoint.h:619:8: note: because the following virtual functions are pure within ‘breakpoint’: 619 | struct breakpoint : public intrusive_list_node<breakpoint> | ^~~~~~~~~~ /home/smarchi/src/binutils-gdb/gdb/breakpoint.c:250:1: note: ‘virtual breakpoint::~breakpoint()’ 250 | breakpoint::~breakpoint () | ^~~~~~~~~~ Change-Id: I05285ff27d21cb0ab80cba392ec4e959167e3cd7 Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-05-25gdbsupport: make basic_safe_iterator::operator* return the same thing as ↵Simon Marchi1-1/+5
underlying iterator Using the following patch that removes the reference_to_pointer_iterator from breakpoint_range, I would get: CXX breakpoint.o /home/smarchi/src/binutils-gdb/gdb/breakpoint.c: In function ‘void breakpoint_program_space_exit(program_space*)’: /home/smarchi/src/binutils-gdb/gdb/breakpoint.c:3030:46: error: cannot allocate an object of abstract type ‘breakpoint’ 3030 | for (breakpoint &b : all_breakpoints_safe ()) | ^ In file included from /home/smarchi/src/binutils-gdb/gdb/gdbthread.h:26, from /home/smarchi/src/binutils-gdb/gdb/infrun.h:21, from /home/smarchi/src/binutils-gdb/gdb/gdbarch.h:28, from /home/smarchi/src/binutils-gdb/gdb/arch-utils.h:23, from /home/smarchi/src/binutils-gdb/gdb/breakpoint.c:21: /home/smarchi/src/binutils-gdb/gdb/breakpoint.h:619:8: note: because the following virtual functions are pure within ‘breakpoint’: 619 | struct breakpoint : public intrusive_list_node<breakpoint> | ^~~~~~~~~~ /home/smarchi/src/binutils-gdb/gdb/breakpoint.c:250:1: note: ‘virtual breakpoint::~breakpoint()’ 250 | breakpoint::~breakpoint () | ^~~~~~~~~~ This is because the operator* method of the basic_safe_iterator iterator wrapper returns a value_type. So, even if the method of the underlying iterator (breakpoint_iterator, an intrusive_list iterator) returns a `breakpoint &`, the method of the wrapper returns a `breakpoint`. I think it would make sense for iterator wrappers such as basic_safe_iterator to return the exact same thing as the iterator they wrap. At least, it fixes my problem. Change-Id: Ibbcd390ac03d2fb6ae4854923750c8d7c3c04e8a Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-05-25gdb: link breakpoints with intrusive_listSimon Marchi2-31/+18
Change-Id: I043d8d6f3dd864d80d5088f6ffc2c098337249ea Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-05-25gdb: remove bp_location_pointer_iteratorSimon Marchi10-181/+172
Remove the bp_location_pointer_iterator layer. Adjust all users of breakpoint::locations to use references instead of pointers. Change-Id: Iceed34f5e0f5790a9cf44736aa658be6d1ba1afa Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-05-25gdb: use intrusive_list for breakpoint locationsSimon Marchi3-150/+172
Replace the hand-maintained linked lists of breakpoint locations with and intrusive list. - Remove breakpoint::loc, add breakpoint::m_locations. - Add methods for the various manipulations that need to be done on the location list, while maintaining reasonably good encapsulation. - bp_location currently has a default constructor because of one use in hoist_existing_locations. hoist_existing_locations now returns a bp_location_list, and doesn't need the default-constructor bp_location anymore, so remove the bp_location default constructor. - I needed to add a call to clear_locations in delete_breakpoint to avoid a use-after-free. - Add a breakpoint::last_loc method, for use in set_breakpoint_condition. bp_location_range uses reference_to_pointer_iterator, so that all existing callers of breakpoint::locations don't need to change right now. It will be removed in the next patch. The rest of the changes are to adapt the call sites to use the new methods, of breakpoint::locations, rather than breakpoint::loc directly. Change-Id: I25f7ee3d66a4e914a0540589ac414b3b820b6e70 Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-05-25gdbsupport: add missing increment/decrement operators to ↵Simon Marchi1-0/+18
reference_to_pointer_iterator Using the following patch, I would get this build failure: CXX breakpoint.o In file included from /usr/include/c++/13.1.1/bits/stl_algobase.h:66, from /usr/include/c++/13.1.1/bits/hashtable_policy.h:36, from /usr/include/c++/13.1.1/bits/hashtable.h:35, from /usr/include/c++/13.1.1/bits/unordered_map.h:33, from /usr/include/c++/13.1.1/unordered_map:41, from /usr/include/c++/13.1.1/functional:63, from /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/ptid.h:35, from /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/common-defs.h:206, from /home/smarchi/src/binutils-gdb/gdb/defs.h:26, from /home/smarchi/src/binutils-gdb/gdb/breakpoint.c:20: /usr/include/c++/13.1.1/bits/stl_iterator_base_funcs.h: In instantiation of ‘constexpr void std::__advance(_BidirectionalIterator&, _Distance, bidirectional_iterator_tag) [with _BidirectionalIterator = reference_to_pointer_iterator<intrusive_list_iterator<bp_location, intrusive_base_node<bp_location> > >; _Distance = long int]’: /usr/include/c++/13.1.1/bits/stl_iterator_base_funcs.h:224:21: required from ‘constexpr void std::advance(_InputIterator&, _Distance) [with _InputIterator = reference_to_pointer_iterator<intrusive_list_iterator<bp_location, intrusive_base_node<bp_location> > >; _Distance = long int]’ /usr/include/c++/13.1.1/bits/stl_iterator_base_funcs.h:237:19: required from ‘constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type) [with _InputIterator = reference_to_pointer_iterator<intrusive_list_iterator<bp_location, intrusive_base_node<bp_location> > >; typename iterator_traits<_Iter>::difference_type = long int]’ /home/smarchi/src/binutils-gdb/gdb/breakpoint.c:1073:19: required from here /usr/include/c++/13.1.1/bits/stl_iterator_base_funcs.h:179:11: error: no match for ‘operator--’ (operand type is ‘reference_to_pointer_iterator<intrusive_list_iterator<bp_location, intrusive_base_node<bp_location> > >’) 179 | --__i; | ^~~~~ This points out that while intrusive_list_iterator has an operator--, the reference_to_pointer_iterator wrapper does not. I'm not to sure why the compiler chooses the overload of __advance that accepts a _BidirectionalIterator, given that reference_to_pointer_iterator can't be decremented, but adding those operators seems like the right thing to do in any case, for completeness. Change-Id: I8e2044b6734fadf0f21093047cf35bb7080dbdc3 Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-05-25gdb: add breakpoint::first_loc methodsSimon Marchi9-69/+82
Add convenience first_loc methods to struct breakpoint (const and non-const overloads). A subsequent patch changes the list of locations to be an intrusive_list and makes the actual list private, so these spots would need to change from: b->loc to something ugly like: *b->locations ().begin () That would make the code much heavier and not readable. There is a surprisingly big number of places that access the first location of breakpoints. Whether this is correct, or these spots fail to consider the possibility of multi-location breakpoints, I don't know. But anyhow, I think that using this instead: b->first_loc () conveys the intention better than the other two forms. Change-Id: Ibbefe3e4ca6cdfe570351fe7e2725f2ce11d1e95 Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-05-25gdb: add breakpoint "has locations" methodsSimon Marchi8-37/+53
Add three convenience methods to struct breakpoint: - has_locations: returns true if the breakpoint has at least one location - has_single_location: returns true if the breakpoint has exactly one location - has_multiple_locations: returns true if the breakpoint has more than one location A subsequent patch changes the list of breakpoints to be an intrusive_list, so all these spots would need to change. But in any case, I think that this: if (b->has_multiple_locations ()) conveys the intention better than: if (b->loc != nullptr && b->loc->next != nullptr) Change-Id: Ib18c3605fd35d425ef9df82cb7aacff1606c6747 Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-05-25gdb: constify breakpoint::print_it parameterSimon Marchi9-23/+21
The print_it method itself is const. In a subsequent patch, the locations that come out of a const breakpoint will be const as well. It will therefore be needed to make the last_loc output parameter const as well. Make that change now to reduce the size of the following patches. Change-Id: I7ed962950bc9582646e31e2e42beca2a1c9c5105 Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-05-25gdb: make some breakpoint methods use `this`Simon Marchi4-29/+19
Some implementations of breakpoint::check_status and breakpoint::print_it do this: struct breakpoint *b = bs->breakpoint_at; bs->breakpoint_at is always the same as `this` (we can get convinced by looking at the call sites of check_status and print_it), so it would just be clearer to access fields through `this` instead. Change-Id: Ic542a64fcd88e31ae2aad6feff1da278c7086891 Reviewed-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com> Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-05-25gdb: get gdbarch from syscall_catchpoint instead of locationSimon Marchi1-6/+0
I noticed some methods of syscall_catchpoint doing this: struct gdbarch *gdbarch = loc->owner->gdbarch; `loc` is the list of locations of this catchpoint. Logically, the owner the locations are this catchpoint. So this just ends up getting this->gdbarch. Remove the unnecessary indirection through the loc. syscall_catchpoint::print_recreate does something slightly different, getting its arch from the loc: struct gdbarch *gdbarch = loc->gdbarch; I suppose it's always going to be the same arch, so get it from the catchpoint there too. Change-Id: I6f6a6f8e0cd7cfb754cecfb6249e71ec12ba4855 Reviewed-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com> Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-05-25PR29189, dlltool delaylibs corrupt float/double argumentsAlan Modra1-13/+39
PR 29189 * dlltool.c (i386_x64_trampoline): Save and restore xmm0-5. Make use of parameter save area for integer arg regs. Comment.
2023-05-25Automatic date update in version.inGDB Administrator1-1/+1
2023-05-24gdbsupport: add support for references to checked_static_castSimon Marchi2-9/+35
Add a checked_static_cast overload that works with references. A bad dynamic cast with references throws std::bad_cast, it would be possible to implement the new overload based on that, but it seemed simpler to just piggy back off the existing function. I found some potential uses of this new overload in amd-dbgapi-target.c, update them to illustrate the use of the new overload. To build amd-dbgapi-target.c, on needs the amd-dbgapi library, which I don't expect many people to have. But I have it, and it builds fine here. I did test the new overload by making a purposely bad cast and it did catch it. Change-Id: Id6b6a7db09fe3b4aa43cddb60575ff5f46761e96 Reviewed-By: Lancelot SIX <lsix@lancelotsix.com> Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-05-24gdb/testsuite: fix race in gdb.server/multi-ui-errors.expAndrew Burgess1-1/+1
After this commit: commit ed32754a8c7919feffc6ddb66ff1c532e4a4d1cd Date: Thu Mar 9 10:45:03 2023 +0100 [gdb/testsuite] Fix gdb.server/multi-ui-errors.exp for remote target I noticed the occasional failure in gdb.server/multi-ui-errors.exp, which looked like this: (gdb) PASS: gdb.server/multi-ui-errors.exp: interact with GDB's main UI interrupt (gdb) Program received signal SIGINT, Interrupt. 0x00007ffff7d501e7 in nanosleep () from /lib64/libc.so.6 FAIL: gdb.server/multi-ui-errors.exp: interrupt (timeout) PASS: gdb.server/multi-ui-errors.exp: interrupt arrived p server_pid $1 = 718174 (gdb) PASS: gdb.server/multi-ui-errors.exp: p server_pid This is triggered by this code in gdb.server/multi-ui-errors.exp: gdb_test "interrupt" gdb_test_multiple "" "interrupt arrived" { -re "Program received signal SIGINT, Interrupt\\.\r\n" { pass $gdb_test_name } } The problem here is that the first interrupt will trigger the prompt to be printed, and then, after some time the inferior will be interrupted. However the default pattern for gdb_test includes a '$' end anchor. If expect sees the prompt with nothing following it then everything is fine, and the test passes. However, if the interrupt is quick and so what expect sees is this: (gdb) Program received signal SIGINT, Interrupt. 0x00007ffff7d501e7 in nanosleep () from /lib64/libc.so.6 In this case the end anchor means that the gdb_test fails to match, and eventually times out. Fix this by passing -no-prompt-anchor to gdb_test. Reviewed-By: Tom de Vries <tdevries@suse.de>
2023-05-24gdb, infcmd: Support jump command with same line in multiple symtabsMatti Puputti6-2/+154
If a header file defining a static function is included in multiple source files, each calling the function, and GDB is asked to jump to a line inside that function, there would be multiple locations matching the target. The solution in this commit is to select the location in the current symtab. Reviewed-By: Eli Zaretskii <eliz@gnu.org> Approved-By: Andrew Burgess <aburgess@redhat.com>
2023-05-24Add "args" and "env" parameters to DAP launch requestTom Tromey5-12/+178
This patch augments the DAP launch request with some optional new parameters that let the client control the command-line arguments and the environment of the inferior. Reviewed-By: Andrew Burgess <aburgess@redhat.com> Reviewed-By: Eli Zaretskii <eliz@gnu.org>
2023-05-24Add attributes and methods to gdb.InferiorTom Tromey5-0/+263
This adds two new attributes and three new methods to gdb.Inferior. The attributes let Python code see the command-line arguments and the name of "main". Argument setting is also supported. The methods let Python code manipulate the inferior's environment variables. Reviewed-By: Eli Zaretskii <eliz@gnu.org>
2023-05-24Remove accidentally added fileAndreas Schwab1-6/+0
2023-05-24Don't optimise bfd_seek to same positionAlan Modra1-4/+0
It's not worth avoiding an fseek to the same position, and can cause problems if the linker's output file (which is opened "w+") is read, because that can result in writing, reading, then writing again. POSIX.1-2017 (IEEE Std 1003.1) says of fopen: "When a file is opened with update mode ('+' as the second or third character in the mode argument), both input and output may be performed on the associated stream. However, the application shall ensure that output is not directly followed by input without an intervening call to fflush() or to a file positioning function (fseek(), fsetpos(), or rewind()), and input is not directly followed by output without an intervening call to a file positioning function, unless the input operation encounters end-of-file." * bfdio.c (bfd_seek): Always call iovec->bseek.
2023-05-24Automatic date update in version.inGDB Administrator1-1/+1
2023-05-23Handle DAP evaluate request without a frame IDTom Tromey3-1/+89
DAP specifies that if an evaluate request does not have a frameID parameter, then the expression is evaluated in the global scope.
2023-05-23Add global_context parameter to gdb.parse_and_evalTom Tromey5-7/+40
This adds a 'global_context' parse_and_eval to gdb.parse_and_eval. This lets users request a parse that is done at "global scope". I considered letting callers pass in a block instead, with None meaning "global" -- but then there didn't seem to be a clean way to express the default for this parameter. Reviewed-By: Eli Zaretskii <eliz@gnu.org>
2023-05-23Add flags to parse_and_evalTom Tromey2-3/+3
This adds a flags parameter to parse_and_eval.
2023-05-23Add PARSER_LEAVE_BLOCK_ALONE flagTom Tromey2-16/+27
This adds a PARSER_LEAVE_BLOCK_ALONE flag, and changes the parse API to respect it. This flag lets callers avoid any change to the passed-in block and expression PC, letting them specify the context exactly. In particular, now nullptr can be used to indicate that the parse should not examine any local variables.
2023-05-23Add PARSER_DEBUG flagTom Tromey8-9/+16
This adds a new PARSER_DEBUG constant and changes the parser code to use it. This lets us make the 'parser_debug' global 'static'.