aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-12-27PR31191, objcopy leaves temporary filesAlan Modra1-23/+24
Fix the ENOTDIR rmdir too. PR 31191 * objcopy.c (copy_archive): Localise uses of "l". Remove const from name_list.name. Unlink output element on bfd_close error, and NULL list->name to indicate file is removed. Adjust cleanup to prevent rmdir on non-existent file.
2023-12-26sim: common: pull in newlib extensions for Linux compatibilityMike Frysinger2-1/+122
Since newlib allows people to opt-in to extra errno names, pull them into our table too. The values don't conflict with each other -- the newlib names & values are distinct from newlib's Linux compatibility.
2023-12-27Automatic date update in version.inGDB Administrator1-1/+1
2023-12-26Automatic date update in version.inGDB Administrator1-1/+1
2023-12-25binutils: SECURITY: use https URIMike Frysinger1-2/+2
2023-12-25LoongArch: Add testsuit for DESC and tls transition and tls relaxation.Lulu Cai23-0/+472
2023-12-25LoongArch: Add support for TLS LD/GD/DESC relaxationmengqinggang13-543/+795
The pcalau12i + addi.d of TLS LD/GD/DESC relax to pcaddi. Relaxation is only performed when the TLS model transition is not possible.
2023-12-25LoongArch: Add tls transition support.Lulu Cai2-1/+221
Transitions between DESC->IE/LE and IE->LE are supported now. 1. For DESC -> LE: pcalau12i $a0,%desc_pc_hi20(var) => lu12i.w $a0,%le_hi20(var) addi.d $a0,$a0,%desc_pc_lo12(var) => ori $a0,$a0,%le_lo12(var) ld.d $a1,$a0,%desc_ld(var) => NOP jirl $ra,$a1,%desc_call(var) => NOP add.d $a0,$a0,$tp 2. For DESC -> IE: pcalau12i $a0,%desc_pc_hi20(var) => pcalau12i $a0,%ie_pc_hi20(var) addi.d $a0,$a0,%desc_pc_lo12(var) => ld.d $a0,$a0,%ie_pc_lo12(var) ld.d $a1,$a0,%desc_ld(var) => NOP jirl $ra,$a1,%desc_call(var) => NOP add.d $a0,$a0,$tp 3. For IE -> LE: pcalau12i $a0,%ie_pc_hi20(var) => lu12i.w $a0,%le_hi20(var) ld.d $a0,$a0,%ie_pc_lo12(var) => ori $a0,$a0,%le_lo12(var) add.d $a0,$a0,$tp 4. When a tls variable is accessed using both DESC and IE, DESC transitions to IE and uses the same GOT entry as IE.
2023-12-25LoongArch: Add support for TLSDESC in ld.Lulu Cai1-22/+146
1.The linker for each DESC generates a R_LARCH_TLS_DESC64 dynamic relocation, which relocation is placed at .rela.dyn. TLSDESC always allocates two GOT slots and one dynamic relocation space to TLSDESC. 2. When using multiple ways to access the same TLS variable, a maximum of 5 GOT slots are used. For example, using GD, TLSDESC, and IE to access the same TLS variable, GD always uses the first two of the five GOT, TLSDESC uses the third and fourth, and IE uses the last.
2023-12-25LoongArch: Add new relocs and macro for TLSDESC.Lulu Cai7-4/+349
The normal DESC instruction sequence is: pcalau12i $a0,%desc_pc_hi20(var) #R_LARCH_TLS_DESC_PC_HI20 addi.d $a0,$a0,%desc_pc_lo12(var) #R_LARCH_TLS_DESC_PC_LO12 ld.d $ra,$a0,%desc_ld(var) #R_LARCH_TLS_DESC_LD jirl $ra,$ra,%desc_call(var) #R_LARCH_TLS_DESC_CALL add.d $a0,$a0,$tp
2023-12-25Automatic date update in version.inGDB Administrator1-1/+1
2023-12-25Re: LoongArch: Add support for <b ".L1"> and <beq, $t0, $t1, ".L1">Alan Modra1-14/+16
This fixes the buffer overflow added in commit 22b78fad28, and a few other problems. * loongarch-coder.c (loongarch_split_args_by_comma): Don't overflow buffer when args == "". Don't remove unbalanced quotes. Don't trim last arg if max number of args exceeded.
2023-12-24gdb: make value::allocate_register_lazy store id of next non-inline frameSimon Marchi4-25/+21
Some spots loop on the frame chain to find the first next non-inline frame, and pass that as the "next frame" to value::allocate_register_lazy / value::allocate_register. This is necessary if the value is used in the process of computing the id of "this frame". If the frame next to "this frame" is inlined into "this frame", then you that next frame won't have a computed id yet. You have to go past that to find the next non-inline frame, which will have a computed id. In other cases, it's fine to store the id of an inline frame as the "next frame id" in a register struct value. When trying to unwind a register from it, it will just call inline_frame_prev_register, which will forward the request to the next next frame, until we hit the next physical frame. I think it would make things simpler to just never store the id of an inline frame as the next frame id of register struct values, and go with the first next non-inline frame directly. This way, we don't have to wonder which code paths have to skip inline frames when creating register values and which don't. So, change value::allocate_register_lazy to do that work, and remove the loops for the callers that did it. Change-Id: Ic88115dac49dc14e3053c95f92050062b24b7310
2023-12-24gdb: remove VALUE_REGNUM, add value::regnumSimon Marchi7-36/+26
Remove VALUE_REGNUM, replace it with a method on struct value. Set `m_location.reg.regnum` directly from value::allocate_register_lazy, which is fine because allocate_register_lazy is a static creation function for struct value. Change-Id: Id632502357da971617d9dce1e2eab9b56dbcf52d
2023-12-24gdb: remove VALUE_NEXT_FRAME_ID, add value::next_frame_idSimon Marchi4-36/+21
Remove VALUE_NEXT_FRAME_ID, replace it with a method on struct value. Set `m_location.reg.next_frame_id` directly from value::allocate_register_lazy, which is fine because allocate_register_lazy is a static creation function for struct value. Change-Id: Ic9f0f239c166a88dccfee836f9f51871e67548e6
2023-12-24gdb: implement address_from_register using value_from_registerSimon Marchi1-37/+4
As explained in the comment removed by the previous commit "gdb: pass non-nullptr frame to gdbarch_value_from_register in address_from_register", address_from_register copies some implementation bits from value_from_register: /* This routine may be called during early unwinding, at a time where the ID of FRAME is not yet known. Calling value_from_register would therefore abort in get_frame_id. However, since we only need a temporary value that is never used as lvalue, we actually do not really need to set its VALUE_NEXT_FRAME_ID. Therefore, we re-implement the core of value_from_register, but use the null_frame_id. */ This is no longer relevant, since we now create a value with a valid next frame id, so change address_from_register to use value_from_register. Change-Id: I189bd96f28735ed9f47750ffd73764c459ec6f43
2023-12-24gdb: remove read_frame_register_value's frame parameterSimon Marchi2-13/+13
By now, all register struct values should have a valid next frame id (assuming they are created using value::allocate_register or value::allocate_register_lazy), so there should be no need to pass a frame alongside the value to read_frame_register_value. Remove the frame parameter and adjust read_frame_register_value accordingly. While at it, make read_frame_register_value static, it's only used in findvar.c. Change-Id: I118959ef8c628499297c67810916e8ba9934bfac
2023-12-24gdb: add type parameter to value::allocate_register and add ↵Simon Marchi4-35/+37
value::allocate_register_lazy Some places that create register struct values don't use register_type to obtain the value type. This prevents them from using the current version of value::allocate_register. One spot (value_of_register_lazy) also creates a lazy register value. Add a value::allocate_register_lazy method. Add some type parameters to value::allocate_register and value::allocate_register_lazy, to let the caller specify the type to use for the value. The parameters default to nullptr, in which case we use register_type to obtain the type. Change-Id: I640ec0a5a0f4a55eba12d515dbfd25933229f8ec
2023-12-24gdb: pass non-nullptr frame to gdbarch_value_from_register in ↵Simon Marchi2-20/+9
address_from_register address_from_register used to pass null_frame_id to gdbarch_value_from_register as "this frame"'s id, because it's possible for it to be called during unwind, when "this frame"'s id is not yet known. This create an oddity where those register struct values are created without a valid next frame id. I would much prefer for things to be consistent and have all register struct values to have a valid next frame id. Since gdbarch_value_from_register takes a frame_info_ptr now, rather than a frame_id, we can pass down "this frame", even if it doesn't have a valid id. gdbarch_value_from_register implementations can obtain the next frame from it. However, it's possible for the "this frame"'s next frame to be an inline frame, inlined in "this frame", in which case that next frame's id is also not known. So, loop until we get to the next non-inline frame (which is actually the frame where registers for "this frame" are unwound from). This is the same thing that we do in value_of_register_lazy, for the same reason. A later patch will factor out this "while next frame is inline" loop to apply it to all register struct values, so this is somewhat temporary. Change-Id: If487c82620cc5a4a4ea5807f0a0bad80ab984078
2023-12-24gdb: pass frame_info_ptr to gdbarch_value_from_registerSimon Marchi7-38/+33
Pass a frame_info_ptr rather than a frame_id. This avoids having to do a frame lookup on the callee side, when we can just pass the frame down directly. I think this fixes a bug in rs6000-tdep.c where the id of the wrong frame was set to `VALUE_NEXT_FRAME_ID (v)`. Change-Id: I77039bc87ea8fc5262f16d0e1446515efa21c565
2023-12-24gdb: don't set frame id after calling cooked_read_valueSimon Marchi1-1/+0
I don't think that setting the next frame id is needed there, all code paths in cooked_read_value do set it properly, AFAIK. Change-Id: Idb9d9e6f89c2c95c5ebfeec2a63fde89ed84cf3d
2023-12-24sim: cris: rvdummy: delete unused variableMike Frysinger1-1/+0
2023-12-24sim: cgen: mark cgen_rtx_error noreturnMike Frysinger1-1/+1
Since this function never returns, mark it as such to fix some unused variable warnings in error code paths. For example, cris triggers: sim/cris/semcrisv10f-switch.c:3558:11: error: variable 'tmp_newval' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] Even though it has an "else" path that calls this error function.
2023-12-24sim: cgen: regenerate decode tablesMike Frysinger9-5827/+5827
Integrate some changes from upstream cgen that tightened up the generated output. Shouldn't be any functional changes here.
2023-12-24sim: sh: refine pwsb & pwad nopsMike Frysinger1-0/+2
Since these insns don't do anything and are effectively ignored, return early to avoid doing any common processing at the end as that requires initializing variables like "res" with something.
2023-12-24sim: sh: fix plds Dz,MACL implementationMike Frysinger1-1/+1
The plds Dz,MACL insn stores the Dz bit into MACL. The current code was storing the "res" variable into Dz and then into MACL, but not setting "res" to anything. Delete that logic and make it match the existing plds Dz,MACH insn.
2023-12-24Automatic date update in version.inGDB Administrator1-1/+1
2023-12-23sim: warnings: rework individual flag disable into dedicated varsMike Frysinger4-51/+157
The -Wshadow=local is too new for some compilers, so move it to a var that we test at configure time.
2023-12-22gprofng: fix build problems on linux-muslVladimir Mezentsev11-25/+41
ino64_t, off64_t, fpos64_t, stat64, __u64 are not defined on linux-musl. Fixed by declaring these types for linux-musl. 2023-12-21 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/30779 PR gprofng/29593 * common/gp-defs.h: Define ino64_t, off64_t, fpos64_t for linux-musl. * libcollector/unwind.c: Define __u64 for linux-musl. * src/util.h: Define dbe_stat_t. * src/ClassFile.cc: Use dbe_stat_t instead of "struct stat64". * src/Dbe.cc: Likewise. * src/DbeFile.cc: Likewise. * src/DbeFile.h: Likewise. * src/DbeSession.cc: Likewise. * src/Experiment.cc: Likewise. * src/checks.cc: Likewise. * src/util.cc: Likewise.
2023-12-22sim: sh: fix -Wshadow=local warningsMike Frysinger1-2/+2
Rename the var to avoid shadowing & clobbering the higher context.
2023-12-22sim: riscv: fix -Wshadow=local warningsMike Frysinger1-6/+4
Inline the one usage of sd in these macros to avoid possible shadowing.
2023-12-22sim: ppc: fix -Wshadow=local warningsMike Frysinger1-3/+3
Use a local name in the macro to avoid shadowing wherever it's used.
2023-12-22sim: mips: fix -Wshadow=local warningsMike Frysinger1-5/+2
Delete redundant decls when the existing scope has the same var and type available for use.
2023-12-22sim: m68hc11: fix -Wshadow=local warningsMike Frysinger3-4/+3
Delete redundant decls when the existing scope has the same var and type available for use.
2023-12-22sim: m32c: fix -Wshadow=local warningsMike Frysinger2-12/+9
These decoders declare a lot of common variables for use by substeps, and then shadows a few because of how the opc generator is implemented. Easiest way around it is to rename the per-substep vars as needed as anything more would require substantial changes to the opc logic.
2023-12-22sim: iq2000: fix -Wshadow=local warningsMike Frysinger1-1/+1
Delete redundant decls.
2023-12-22sim: h8300: fix -Wshadow=local warningsMike Frysinger1-2/+2
Delete conflicting decls when the existing scope has vars of the same name & type for this exact use.
2023-12-22sim: frv: fix -Wshadow=local warningsMike Frysinger2-4/+3
Delete redundant decls, and rename conflicting vars.
2023-12-22sim: erc32: fix -Wshadow=local warningsMike Frysinger1-32/+31
Rename shadowed vars with different types to avoid confusion.
2023-12-22sim: cris: disable -Wshadow=local in generated mloop filesMike Frysinger2-1/+5
The mloop files include CGEN generated switch files which have some nested assignments that expand into repeated shadowed variables. Fixing this looks fairly non-trivial as it appears to be interplay between the common CGEN code and how this particular set of cris insns are defined. Disable the warning instead. In file included from sim/cris/mloop.in:286: sim/cris/semcrisv10f-switch.c: In function ‘crisv10f_engine_run_full’: sim/cris/semcrisv10f-switch.c:12383:8: error: declaration of ‘opval’ shadows a previous local [-Werror=shadow=local] 12383 | SI opval = tmp_addr; | ^~~~~ sim/cris/semcrisv10f-switch.c:12371:9: note: shadowed declaration is here 12371 | USI opval = ({ SI tmp_addr; | ^~~~~ And the code looks like: USI opval = ({ ... { SI opval = tmp_addr; ... } ... }); Since the CGEN code treats "opval" as an internal variable that the cpu definitions don't have direct access to, the likelihood of this being a real bug is low, so leave it be. The warning is suppressed for more code that is hand written (e.g. the mloop logic), but disabling for the entire file is the easiest way to suppress while keeping it on everywhere else in the sim.
2023-12-22sim: cris: fix -Wshadow=local warningsMike Frysinger2-2/+0
Delete redundant local decls.
2023-12-22sim: common: fix -Wshadow=local warningsMike Frysinger2-3/+3
Rename shadowed vars with different types, and delete redundant decls.
2023-12-22sim: bfin: fix -Wshadow=local warningsMike Frysinger1-3/+3
Rename the shadowed var to avoid confusion with the function argument as to which address this code is using.
2023-12-22sim: arm: fix -Wshadow=local warningsMike Frysinger3-46/+30
Remove duplicate nested variable declarations, rename some to avoid confusion when the type is different or the original value should be retained, and fix some weirdness with nested enums in structs.
2023-12-22sim: aarch64: fix -Wshadow=local warningsMike Frysinger1-21/+21
These functions have local vars named "val" of type float, and then create nested vars named "val" of type double. This is a bit confusing and causes build time warnings.
2023-12-23Automatic date update in version.inGDB Administrator1-1/+1
2023-12-22Check for rogue DAP exceptions in test suiteTom Tromey1-1/+33
This changes the test suite to look for rogue DAP exceptions in the log file, and issue a "fail" if one is found. Reviewed-By: Kévin Le Gouguec <legouguec@adacore.com>
2023-12-22Avoid exception from attach in DAPTom Tromey2-6/+30
I noticed that the DAP attach test case (and similarly remoted-dap.exp) had a rogue exception stack trace in the log. It turns out that an attach will generate a stop that does not have a reason. This patch fixes the problem in the _on_stop event listener by making it a bit more careful when examining the event reason. It also adds some machinery so that attach stops can be suppressed, which I think is the right thing to do. Reviewed-By: Kévin Le Gouguec <legouguec@adacore.com>
2023-12-22Add DAP log level parameterTom Tromey5-6/+64
This adds a new parameter to control the DAP logging level. By default, "expected" exceptions are not logged, but the parameter lets the user change this when more logging is desired. This also changes a couple of spots to avoid logging the stack trace for a DAPException. This patch also documents the existing DAP logging parameter. I forgot to document this before. Reviewed-By: Eli Zaretskii <eliz@gnu.org> Reviewed-By: Kévin Le Gouguec <legouguec@adacore.com>
2023-12-22Introduce and use DAPExceptionTom Tromey6-17/+37
This introduces a new DAPException class, and then changes various spots in the DAP implementation to wrap "expected" exceptions in this. This class will help detect rogue exceptions caused by bugs in the implementation. Reviewed-By: Kévin Le Gouguec <legouguec@adacore.com>