GDB raises SIGSEGV error in String local variable changing
Original Reporter info from Mantis: rfsanet
-
Reporter name:
Original Reporter info from Mantis: rfsanet
- Reporter name:
Description:
When I try to change the value of a variable of type String at runtime using the window of local variables, Lazarus returns the error SIGSEGV.
The error occurs for the function TGDBMIDebugger.GDBModify of the gdbmidebugger.pp unit: ExecuteCommand('-gdb-set var %s := %s', [AExpression, S], [cfIgnoreError, cfExternal], R) and (R.State <> dsError);
Perhaps for local variable String, the correct command should be: call strncpy(texto, "NewValue", NewSize).
The NewSize value will be the greater of Initial value and New Value.
Steps to reproduce:
Unzip Project.7z file in the path C:\TEST\PROJECT
Run cmd.exe
gdb.exe
file project1.exe
break 20
run
set var TextVar := "NewValue"
cont
Error:
Program received signal SIGSEGV, Segmentation fault.
0x0044a0f6 in LCLPROC_$$_CONVERTUTF8TOUTF16$crc2EBDF3EE ()
Alternative commands:
Unzip Project.7z file in the path C:\TEST\PROJECT
Run cmd.exe
gdb.exe
file project1.exe
break 20
run
call strncpy(TextVar, "NewValue", strlen("InitialValue"))
cont
Error: none
Mantis conversion info:
- Mantis ID: 20287
- OS: Win32
- Platform: i386
- Monitored by: » rfsanet (rfsanet)