--- i386-linux-tdep.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) --- a/i386-linux-tdep.c +++ b/i386-linux-tdep.c @@ -439,6 +439,25 @@ i386_linux_intx80_sysenter_record (struc return 0; } +static int +i386_linux_segment_base (struct regcache *regcache, int regnum, + ULONGEST *base) +{ + ULONGEST value; + + /* Check if the target */ + if (current_target.to_get_segment_base == NULL) + return -1; + + /* Get the regnum reg's value. */ + regcache_raw_read_unsigned (regcache, regnum, &value); + + if (current_target.to_get_segment_base (value >> 3 ,base) != 0) + return -1; + + return 0; +} + #define I386_LINUX_xstate 270 #define I386_LINUX_frame_size 732 @@ -787,6 +806,7 @@ i386_linux_init_abi (struct gdbarch_info tdep->i386_intx80_record = i386_linux_intx80_sysenter_record; tdep->i386_sysenter_record = i386_linux_intx80_sysenter_record; + tdep->i386_segment_base = i386_linux_segment_base; /* N_FUN symbols in shared libaries have 0 for their values and need to be relocated. */